net/mlx5: Refactor esw QoS to support generalized operations
Subsystems (3)
Tariq Toukan
maintainerv3 cover net/mlx5: Refactor esw QoS to support generalized operations
Hi,
This patch series from the team to mlx5 core driver consists of one main QoS part followed by small misc patches.
This main part (patches 1 to 11) by Carolina refactors the QoS handling to generalize operations on scheduling groups and vports. These changes are necessary to support new features that will extend group functionality, introduce new group types, and support deeper hierarchies.
Additionally, this refactor updates the terminology from "group" to "node" to better reflect the hardware’s rate hierarchy and its use of scheduling element nodes.
Simplify group scheduling element creation:
- net/mlx5: Refactor QoS group scheduling element creation
Refactor to support generalized operations for QoS:
- net/mlx5: Introduce node type to rate group structure
- net/mlx5: Add parent group support in rate group structure
- net/mlx5: Restrict domain list insertion to root TSAR ancestors
- net/mlx5: Rename vport QoS group reference to parent
- net/mlx5: Introduce node struct and rename group terminology to node
- net/mlx5: Refactor vport scheduling element creation function
- net/mlx5: Refactor vport QoS to use scheduling node structure
- net/mlx5: Remove vport QoS enabled flag
Support generalized operations for QoS elements:
- net/mlx5: Simplify QoS scheduling element configuration
- net/mlx5: Generalize QoS operations for nodes and vports
On top, patch 12 by Moshe handles FW request to move to drop mode.
In patch 13, Benjamin Poirier removes an empty eswitch flow table when not used, which improves packet processing performance.
Patches 14 and 15 by Moshe are small field renamings as preparation for future fields addition to these structures.
Series generated against:
commit c531f2269a53 ("net: bcmasp: enable SW timestamping")
Regards,
Tariq
V3:
- Fixed potential NULL dereference for vport sched_node.
- Updated the check in esw_qos_normalize_min_rate to stop on leafs.
V2:
- Declared int err separately to fix the type mismatch with u32.
- Fixed potential NULL dereference in the node allocation error path.
- Removed "rate_node" renamings, as it referred to the old "rate_group".
- Replaced 0 with NULL in mlx5_esw_qos_vport_get_parent.
- Fixed vport node allocation error path.
- Initialized dev in mlx5_esw_qos_vport_disable.
- Access vport_node->esw directly where possible.
Benjamin Poirier (1):
net/mlx5: Only create VEPA flow table when in VEPA mode
Carolina Jubran (11):
net/mlx5: Refactor QoS group scheduling element creation net/mlx5: Introduce node type to rate group structure net/mlx5: Add parent group support in rate group structure net/mlx5: Restrict domain list insertion to root TSAR ancestors net/mlx5: Rename vport QoS group reference to parent net/mlx5: Introduce node struct and rename group terminology to node net/mlx5: Refactor vport scheduling element creation function net/mlx5: Refactor vport QoS to use scheduling node structure net/mlx5: Remove vport QoS enabled flag
net/mlx5: Simplify QoS scheduling element configuration net/mlx5: Generalize QoS operations for nodes and vports
Moshe Shemesh (3):
net/mlx5: Add sync reset drop mode support net/mlx5: fs, rename packet reformat struct member action net/mlx5: fs, rename modify header struct member action
.../mellanox/mlx5/core/en/tc/ct_fs_smfs.c | 4 +- .../mellanox/mlx5/core/esw/devlink_port.c | 2 +- .../mlx5/core/esw/diag/qos_tracepoint.h | 53 +- .../ethernet/mellanox/mlx5/core/esw/legacy.c | 27 +- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 669 +++++++++--------- .../net/ethernet/mellanox/mlx5/core/esw/qos.h | 3 + .../net/ethernet/mellanox/mlx5/core/eswitch.c | 2 + .../net/ethernet/mellanox/mlx5/core/eswitch.h | 25 +- .../net/ethernet/mellanox/mlx5/core/fs_core.h | 4 +- .../ethernet/mellanox/mlx5/core/fw_reset.c | 9 +- .../mellanox/mlx5/core/steering/fs_dr.c | 35 +- 11 files changed, 435 insertions(+), 398 deletions(-)
Signature · 1 line
2.44.0
Tariq Toukan
maintainerPATCH v3 1/15 net/mlx5: Refactor QoS group scheduling element creation
From: Carolina Jubran <[email protected]>
Introduce esw_qos_create_group_sched_elem to handle the creation of group scheduling elements for E-Switch QoS, Transmit Scheduling Arbiter (TSAR).
This reduces duplication and simplifies code for TSAR setup.
--- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +31 -33
@@ -371,6 +371,33 @@ static int esw_qos_set_group_max_rate(struct mlx5_esw_rate_group *group,return err; } +static int esw_qos_create_group_sched_elem (struct mlx5_core_dev *dev,u32 parent_element_id, +u32 *tsar_ix) +{ +u32 tsar_ctx[MLX5_ST_SZ_DW (scheduling_context)] = {}; +void *attr; + +if (!mlx5_qos_element_type_supported (dev, +SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR , +SCHEDULING_HIERARCHY_E_SWITCH ) || + !mlx5_qos_tsar_type_supported (dev, +TSAR_ELEMENT_TSAR_TYPE_DWRR , +SCHEDULING_HIERARCHY_E_SWITCH )) +return -EOPNOTSUPP ; + +MLX5_SET (scheduling_context, tsar_ctx, element_type, +SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR ); +MLX5_SET (scheduling_context, tsar_ctx, parent_element_id, + parent_element_id); + attr =MLX5_ADDR_OF (scheduling_context, tsar_ctx, element_attributes); +MLX5_SET (tsar_element, attr, tsar_type,TSAR_ELEMENT_TSAR_TYPE_DWRR ); + +return mlx5_create_scheduling_element_cmd (dev, +SCHEDULING_HIERARCHY_E_SWITCH , + tsar_ctx, + tsar_ix); +} +static int esw_qos_vport_create_sched_element (struct mlx5_vport *vport,u32 max_rate,u32 bw_share) {
@@ -496,21 +523,11 @@ static void __esw_qos_free_rate_group(struct mlx5_esw_rate_group *group)static struct mlx5_esw_rate_group *__esw_qos_create_rate_group (struct mlx5_eswitch *esw,struct netlink_ext_ack *extack) { -u32 tsar_ctx[MLX5_ST_SZ_DW (scheduling_context)] = {};struct mlx5_esw_rate_group *group; -int tsar_ix, err; -void *attr; +u32 tsar_ix; +int err; -MLX5_SET (scheduling_context, tsar_ctx, element_type, -SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR ); -MLX5_SET (scheduling_context, tsar_ctx, parent_element_id, - esw->qos.root_tsar_ix); - attr =MLX5_ADDR_OF (scheduling_context, tsar_ctx, element_attributes); -MLX5_SET (tsar_element, attr, tsar_type,TSAR_ELEMENT_TSAR_TYPE_DWRR ); - err =mlx5_create_scheduling_element_cmd (esw->dev, -SCHEDULING_HIERARCHY_E_SWITCH , - tsar_ctx, - &tsar_ix); + err =esw_qos_create_group_sched_elem (esw->dev, esw->qos.root_tsar_ix, &tsar_ix);if (err) {NL_SET_ERR_MSG_MOD (extack,"E-Switch create TSAR for group failed" );return ERR_PTR (err);
@@ -591,32 +608,13 @@ static int __esw_qos_destroy_rate_group(struct mlx5_esw_rate_group *group,static int esw_qos_create (struct mlx5_eswitch *esw,struct netlink_ext_ack *extack) { -u32 tsar_ctx[MLX5_ST_SZ_DW (scheduling_context)] = {};struct mlx5_core_dev *dev = esw->dev; -void *attr;int err;if (!MLX5_CAP_GEN (dev, qos) || !MLX5_CAP_QOS (dev, esw_scheduling))return -EOPNOTSUPP ; -if (!mlx5_qos_element_type_supported (dev, -SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR , -SCHEDULING_HIERARCHY_E_SWITCH ) || - !mlx5_qos_tsar_type_supported (dev, -TSAR_ELEMENT_TSAR_TYPE_DWRR , -SCHEDULING_HIERARCHY_E_SWITCH )) -return -EOPNOTSUPP ; - -MLX5_SET (scheduling_context, tsar_ctx, element_type, -SCHEDULING_CONTEXT_ELEMENT_TYPE_TSAR ); - - attr =MLX5_ADDR_OF (scheduling_context, tsar_ctx, element_attributes); -MLX5_SET (tsar_element, attr, tsar_type,TSAR_ELEMENT_TSAR_TYPE_DWRR ); - - err =mlx5_create_scheduling_element_cmd (dev, -SCHEDULING_HIERARCHY_E_SWITCH , - tsar_ctx, - &esw->qos.root_tsar_ix); + err =esw_qos_create_group_sched_elem (esw->dev,0 , &esw->qos.root_tsar_ix);if (err) {esw_warn (dev,"E-Switch create root TSAR failed (%d)\n" , err);return err;
Signature · 1 line
2.44.0
Re: [PATCH net-next V3 01/15] net/mlx5: Refactor QoS group scheduling element creation
Quoted 8 lines
From: Carolina Jubran <[email protected]>
Introduce
esw_qos_create_group_sched_elemto handle the creation of group scheduling elements for E-Switch QoS, Transmit Scheduling Arbiter (TSAR).This reduces duplication and simplifies code for TSAR setup.
Tariq Toukan
maintainerPATCH v3 2/15 net/mlx5: Introduce node type to rate group structure
In reply to Tariq ToukanFrom: Carolina Jubran <[email protected]>
Introduce the sched_node_type enum to represent both the group and its members as scheduling nodes in the rate hierarchy.
Add the type field to the rate group structure to specify the type of the node membership in the rate hierarchy.
Generalize comments to reflect this flexibility within the rate group structure.
--- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +18 -10
@@ -61,6 +61,10 @@ static void esw_qos_domain_release(struct mlx5_eswitch *esw) esw->qos.domain =NULL ; } +enum sched_node_type { +SCHED_NODE_TYPE_VPORTS_TSAR , +}; +struct mlx5_esw_rate_group {u32 tsar_ix;/* Bandwidth parameters. */
@@ -68,11 +72,13 @@ struct mlx5_esw_rate_group {u32 min_rate;/* A computed value indicating relative min_rate between group members. */ u32 bw_share; -/* Membership in the qos domain 'groups' list. */ +/* Membership in the parent list. */ struct list_head parent_entry; +/* The type of this group node in the rate hierarchy. */ +enum sched_node_type type;/* The eswitch this group belongs to. */ struct mlx5_eswitch *esw; -/* Vport members of this group.*/ +/* Members of this group.*/ struct list_head members; };
@@ -499,7 +505,7 @@ static int esw_qos_vport_update_group(struct mlx5_vport *vport, }static struct mlx5_esw_rate_group * -__esw_qos_alloc_rate_group (struct mlx5_eswitch *esw,u32 tsar_ix) +__esw_qos_alloc_rate_group (struct mlx5_eswitch *esw,u32 tsar_ix,enum sched_node_type type) {struct mlx5_esw_rate_group *group;
@@ -509,6 +515,7 @@ __esw_qos_alloc_rate_group(struct mlx5_eswitch *esw, u32 tsar_ix) group->esw = esw; group->tsar_ix = tsar_ix; + group->type = type;INIT_LIST_HEAD (&group->members);list_add_tail (&group->parent_entry, &esw->qos.domain->groups);return group;
@@ -521,7 +528,7 @@ static void __esw_qos_free_rate_group(struct mlx5_esw_rate_group *group) }static struct mlx5_esw_rate_group * -__esw_qos_create_rate_group (struct mlx5_eswitch *esw,struct netlink_ext_ack *extack) +__esw_qos_create_vports_rate_group (struct mlx5_eswitch *esw,struct netlink_ext_ack *extack) {struct mlx5_esw_rate_group *group;u32 tsar_ix;
@@ -533,7 +540,7 @@ __esw_qos_create_rate_group(struct mlx5_eswitch *esw, struct netlink_ext_ack *exreturn ERR_PTR (err); } - group =__esw_qos_alloc_rate_group (esw, tsar_ix); + group =__esw_qos_alloc_rate_group (esw, tsar_ix,SCHED_NODE_TYPE_VPORTS_TSAR );if (!group) {NL_SET_ERR_MSG_MOD (extack,"E-Switch alloc group failed" ); err = -ENOMEM ;
@@ -563,7 +570,7 @@ static int esw_qos_get(struct mlx5_eswitch *esw, struct netlink_ext_ack *extack)static void esw_qos_put (struct mlx5_eswitch *esw);static struct mlx5_esw_rate_group * -esw_qos_create_rate_group (struct mlx5_eswitch *esw,struct netlink_ext_ack *extack) +esw_qos_create_vports_rate_group (struct mlx5_eswitch *esw,struct netlink_ext_ack *extack) {struct mlx5_esw_rate_group *group;int err;
@@ -576,7 +583,7 @@ esw_qos_create_rate_group(struct mlx5_eswitch *esw, struct netlink_ext_ack *extaif (err)return ERR_PTR (err); - group =__esw_qos_create_rate_group (esw, extack); + group =__esw_qos_create_vports_rate_group (esw, extack);if (IS_ERR (group))esw_qos_put (esw);
@@ -621,12 +628,13 @@ static int esw_qos_create(struct mlx5_eswitch *esw, struct netlink_ext_ack *exta }if (MLX5_CAP_QOS (dev, log_esw_max_sched_depth)) { - esw->qos.group0 =__esw_qos_create_rate_group (esw, extack); + esw->qos.group0 =__esw_qos_create_vports_rate_group (esw, extack); }else {/* The eswitch doesn't support scheduling groups. * Create a software-only group0 using the root TSAR to attach vport QoS to. */ -if (!__esw_qos_alloc_rate_group (esw, esw->qos.root_tsar_ix)) +if (!__esw_qos_alloc_rate_group (esw, esw->qos.root_tsar_ix, +SCHED_NODE_TYPE_VPORTS_TSAR )) esw->qos.group0 =ERR_PTR (-ENOMEM ); }if (IS_ERR (esw->qos.group0)) {
@@ -1038,7 +1046,7 @@ int mlx5_esw_devlink_rate_node_new(struct devlink_rate *rate_node, void **priv, goto unlock; } - group =esw_qos_create_rate_group (esw, extack); + group =esw_qos_create_vports_rate_group (esw, extack);if (IS_ERR (group)) { err =PTR_ERR (group); goto unlock;
Signature · 1 line
2.44.0
Re: [PATCH net-next V3 02/15] net/mlx5: Introduce node type to rate group structure
Quoted 8 lines
Introduce the
sched_node_typeenum to represent both the group and its members as scheduling nodes in the rate hierarchy.Add the
typefield to the rate group structure to specify the type of the node membership in the rate hierarchy.Generalize comments to reflect this flexibility within the rate group structure.
Tariq Toukan
maintainerPATCH v3 3/15 net/mlx5: Add parent group support in rate group structure
In reply to Tariq ToukanFrom: Carolina Jubran <[email protected]>
Introduce a parent field in the mlx5_esw_rate_group structure to support hierarchical group relationships.
The parent can reference another group or be set to NULL, indicating the group is connected to the root TSAR.
This change enables the ability to manage groups in a hierarchical structure for future enhancements.
--- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +11 -6
@@ -72,6 +72,8 @@ struct mlx5_esw_rate_group {u32 min_rate;/* A computed value indicating relative min_rate between group members. */ u32 bw_share; +/* The parent group of this group. */ +struct mlx5_esw_rate_group *parent;/* Membership in the parent list. */ struct list_head parent_entry;/* The type of this group node in the rate hierarchy. */
@@ -505,7 +507,8 @@ static int esw_qos_vport_update_group(struct mlx5_vport *vport, }static struct mlx5_esw_rate_group * -__esw_qos_alloc_rate_group (struct mlx5_eswitch *esw,u32 tsar_ix,enum sched_node_type type) +__esw_qos_alloc_rate_group (struct mlx5_eswitch *esw,u32 tsar_ix,enum sched_node_type type, +struct mlx5_esw_rate_group *parent) {struct mlx5_esw_rate_group *group;
@@ -516,6 +519,7 @@ __esw_qos_alloc_rate_group(struct mlx5_eswitch *esw, u32 tsar_ix, enum sched_nod group->esw = esw; group->tsar_ix = tsar_ix; group->type = type; + group->parent = parent;INIT_LIST_HEAD (&group->members);list_add_tail (&group->parent_entry, &esw->qos.domain->groups);return group;
@@ -528,7 +532,8 @@ static void __esw_qos_free_rate_group(struct mlx5_esw_rate_group *group) }static struct mlx5_esw_rate_group * -__esw_qos_create_vports_rate_group (struct mlx5_eswitch *esw,struct netlink_ext_ack *extack) +__esw_qos_create_vports_rate_group (struct mlx5_eswitch *esw,struct mlx5_esw_rate_group *parent, +struct netlink_ext_ack *extack) {struct mlx5_esw_rate_group *group;u32 tsar_ix;
@@ -540,7 +545,7 @@ __esw_qos_create_vports_rate_group(struct mlx5_eswitch *esw, struct netlink_ext_return ERR_PTR (err); } - group =__esw_qos_alloc_rate_group (esw, tsar_ix,SCHED_NODE_TYPE_VPORTS_TSAR ); + group =__esw_qos_alloc_rate_group (esw, tsar_ix,SCHED_NODE_TYPE_VPORTS_TSAR , parent);if (!group) {NL_SET_ERR_MSG_MOD (extack,"E-Switch alloc group failed" ); err = -ENOMEM ;
@@ -583,7 +588,7 @@ esw_qos_create_vports_rate_group(struct mlx5_eswitch *esw, struct netlink_ext_acif (err)return ERR_PTR (err); - group =__esw_qos_create_vports_rate_group (esw, extack); + group =__esw_qos_create_vports_rate_group (esw,NULL , extack);if (IS_ERR (group))esw_qos_put (esw);
@@ -628,13 +633,13 @@ static int esw_qos_create(struct mlx5_eswitch *esw, struct netlink_ext_ack *exta }if (MLX5_CAP_QOS (dev, log_esw_max_sched_depth)) { - esw->qos.group0 =__esw_qos_create_vports_rate_group (esw, extack); + esw->qos.group0 =__esw_qos_create_vports_rate_group (esw,NULL , extack); }else {/* The eswitch doesn't support scheduling groups. * Create a software-only group0 using the root TSAR to attach vport QoS to. */ if (!__esw_qos_alloc_rate_group (esw, esw->qos.root_tsar_ix, -SCHED_NODE_TYPE_VPORTS_TSAR )) +SCHED_NODE_TYPE_VPORTS_TSAR ,NULL )) esw->qos.group0 =ERR_PTR (-ENOMEM ); }if (IS_ERR (esw->qos.group0)) {
Signature · 1 line
2.44.0
Re: [PATCH net-next V3 03/15] net/mlx5: Add parent group support in rate group structure
Quoted 8 lines
Introduce a
parentfield in themlx5_esw_rate_groupstructure to support hierarchical group relationships.The
parentcan reference another group or be set toNULL, indicating the group is connected to the root TSAR.This change enables the ability to manage groups in a hierarchical structure for future enhancements.
Tariq Toukan
maintainerPATCH v3 4/15 net/mlx5: Restrict domain list insertion to root TSAR ancestors
In reply to Tariq ToukanFrom: Carolina Jubran <[email protected]>
Update the logic for adding rate groups to the E-Switch domain list, ensuring only groups with the root Transmit Scheduling Arbiter as their parent are included.
--- drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +4 -1
@@ -511,6 +511,7 @@ __esw_qos_alloc_rate_group(struct mlx5_eswitch *esw, u32 tsar_ix, enum sched_nod struct mlx5_esw_rate_group *parent) {struct mlx5_esw_rate_group *group; +struct list_head *parent_list; group =kzalloc (sizeof (*group),GFP_KERNEL );if (!group)
@@ -521,7 +522,9 @@ __esw_qos_alloc_rate_group(struct mlx5_eswitch *esw, u32 tsar_ix, enum sched_nod group->type = type; group->parent = parent;INIT_LIST_HEAD (&group->members); -list_add_tail (&group->parent_entry, &esw->qos.domain->groups); + parent_list = parent ? &parent->members : &esw->qos.domain->groups; +list_add_tail (&group->parent_entry, parent_list); +return group; }
Signature · 1 line
2.44.0
Re: [PATCH net-next V3 04/15] net/mlx5: Restrict domain list insertion to root TSAR ancestors
Quoted 3 lines
Update the logic for adding rate groups to the E-Switch domain list, ensuring only groups with the root Transmit Scheduling Arbiter as their parent are included.
Tariq Toukan
maintainerPATCH v3 5/15 net/mlx5: Rename vport QoS group reference to parent
In reply to Tariq ToukanFrom: Carolina Jubran <[email protected]>
Rename the group field in the mlx5_vport structure to parent to clarify the vport's role as a member of a parent group and distinguish it from the concept of a general group.
Additionally, rename group_entry to parent_entry to reflect this update.
This distinction will be important for handling more complex group structures and scheduling elements.
--- .../mlx5/core/esw/diag/qos_tracepoint.h | 8 ++-- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 42 +++++++++---------- .../net/ethernet/mellanox/mlx5/core/eswitch.h | 6 ++- 3 files changed, 29 insertions(+), 27 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/qos_tracepoint.h +4 -4
@@ -35,18 +35,18 @@ DECLARE_EVENT_CLASS(mlx5_esw_vport_qos_template, __field(unsigned int, sched_elem_ix) __field(unsigned int, bw_share) __field(unsigned int, max_rate) - __field(void *, group) + __field(void *, parent) ), TP_fast_assign(__assign_str(devname); __entry->vport_id = vport->vport; __entry->sched_elem_ix = vport->qos.esw_sched_elem_ix; __entry->bw_share = bw_share; __entry->max_rate = max_rate; - __entry->group = vport->qos.group; + __entry->parent = vport->qos.parent; ), -TP_printk ("(%s) vport=%hu sched_elem_ix=%u bw_share=%u, max_rate=%u group=%p\n" , +TP_printk ("(%s) vport=%hu sched_elem_ix=%u bw_share=%u, max_rate=%u parent=%p\n" ,__get_str (devname), __entry->vport_id, __entry->sched_elem_ix, - __entry->bw_share, __entry->max_rate, __entry->group + __entry->bw_share, __entry->max_rate, __entry->parent ) );
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +21 -21
136 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +4 -2
@@ -221,8 +221,10 @@ struct mlx5_vport {u32 max_rate;/* A computed value indicating relative min_rate between vports in a group. */ u32 bw_share; -struct mlx5_esw_rate_group *group; -struct list_head group_entry; +/* The parent group of this vport scheduling element. */ +struct mlx5_esw_rate_group *parent; +/* Membership in the parent 'members' list. */ +struct list_head parent_entry; } qos;u16 vport;
Signature · 1 line
2.44.0
Re: [PATCH net-next V3 05/15] net/mlx5: Rename vport QoS group reference to parent
Quoted 9 lines
Rename the
groupfield in themlx5_vportstructure toparentto clarify the vport's role as a member of a parent group and distinguish it from the concept of a general group.Additionally, rename
group_entrytoparent_entryto reflect this update.This distinction will be important for handling more complex group structures and scheduling elements.
Tariq Toukan
maintainerPATCH v3 6/15 net/mlx5: Introduce node struct and rename group terminology to node
In reply to Tariq ToukanFrom: Carolina Jubran <[email protected]>
Introduce the mlx5_esw_sched_node struct, consolidating all rate hierarchy related details, including membership and scheduling parameters.
Since the group concept aligns with the mlx5_esw_sched_node, replace the mlx5_esw_rate_group struct with it and rename the "group" terminology to "node" throughout the rate hierarchy.
All relevant code paths and structures have been updated to use the "node" terminology accordingly, laying the groundwork for future patches that will unify the handling of different types of members within the rate hierarchy.
--- .../mellanox/mlx5/core/esw/devlink_port.c | 2 +- .../mlx5/core/esw/diag/qos_tracepoint.h | 40 +- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 374 +++++++++--------- .../net/ethernet/mellanox/mlx5/core/eswitch.h | 16 +- 4 files changed, 217 insertions(+), 215 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c +1 -1
@@ -195,7 +195,7 @@ void mlx5_esw_offloads_devlink_port_unregister(struct mlx5_vport *vport)return ; dl_port = vport->dl_port; -mlx5_esw_qos_vport_update_group (vport,NULL ,NULL ); +mlx5_esw_qos_vport_update_node (vport,NULL ,NULL );devl_rate_leaf_destroy (&dl_port->dl_port);devl_port_unregister (&dl_port->dl_port);
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/qos_tracepoint.h +20 -20
@@ -62,57 +62,57 @@ DEFINE_EVENT(mlx5_esw_vport_qos_template, mlx5_esw_vport_qos_config,TP_ARGS (dev, vport, bw_share, max_rate) ); -DECLARE_EVENT_CLASS (mlx5_esw_group_qos_template, +DECLARE_EVENT_CLASS (mlx5_esw_node_qos_template, TP_PROTO(const struct mlx5_core_dev *dev, - const struct mlx5_esw_rate_group *group, + const struct mlx5_esw_sched_node *node, unsigned int tsar_ix), -TP_ARGS (dev, group, tsar_ix), +TP_ARGS (dev, node, tsar_ix), TP_STRUCT__entry(__string(devname, dev_name(dev->device)) - __field(const void *, group) + __field(const void *, node) __field(unsigned int, tsar_ix) ), TP_fast_assign(__assign_str(devname); - __entry->group = group; + __entry->node = node; __entry->tsar_ix = tsar_ix; ), -TP_printk ("(%s) group=%p tsar_ix=%u\n" , -__get_str (devname), __entry->group, __entry->tsar_ix +TP_printk ("(%s) node=%p tsar_ix=%u\n" , +__get_str (devname), __entry->node, __entry->tsar_ix ) ); -DEFINE_EVENT (mlx5_esw_group_qos_template, mlx5_esw_group_qos_create, +DEFINE_EVENT (mlx5_esw_node_qos_template, mlx5_esw_node_qos_create, TP_PROTO(const struct mlx5_core_dev *dev, - const struct mlx5_esw_rate_group *group, + const struct mlx5_esw_sched_node *node, unsigned int tsar_ix), -TP_ARGS (dev, group, tsar_ix) +TP_ARGS (dev, node, tsar_ix) ); -DEFINE_EVENT (mlx5_esw_group_qos_template, mlx5_esw_group_qos_destroy, +DEFINE_EVENT (mlx5_esw_node_qos_template, mlx5_esw_node_qos_destroy, TP_PROTO(const struct mlx5_core_dev *dev, - const struct mlx5_esw_rate_group *group, + const struct mlx5_esw_sched_node *node, unsigned int tsar_ix), -TP_ARGS (dev, group, tsar_ix) +TP_ARGS (dev, node, tsar_ix) ); -TRACE_EVENT (mlx5_esw_group_qos_config, +TRACE_EVENT (mlx5_esw_node_qos_config, TP_PROTO(const struct mlx5_core_dev *dev, - const struct mlx5_esw_rate_group *group, + const struct mlx5_esw_sched_node *node, unsigned int tsar_ix, u32 bw_share, u32 max_rate), -TP_ARGS (dev, group, tsar_ix, bw_share, max_rate), +TP_ARGS (dev, node, tsar_ix, bw_share, max_rate), TP_STRUCT__entry(__string(devname, dev_name(dev->device)) - __field(const void *, group) + __field(const void *, node) __field(unsigned int, tsar_ix) __field(unsigned int, bw_share) __field(unsigned int, max_rate) ), TP_fast_assign(__assign_str(devname); - __entry->group = group; + __entry->node = node; __entry->tsar_ix = tsar_ix; __entry->bw_share = bw_share; __entry->max_rate = max_rate; ), -TP_printk ("(%s) group=%p tsar_ix=%u bw_share=%u max_rate=%u\n" , -__get_str (devname), __entry->group, __entry->tsar_ix, +TP_printk ("(%s) node=%p tsar_ix=%u bw_share=%u max_rate=%u\n" , +__get_str (devname), __entry->node, __entry->tsar_ix, __entry->bw_share, __entry->max_rate ) );
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +188 -186
767 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +8 -8
@@ -222,7 +222,7 @@ struct mlx5_vport {/* A computed value indicating relative min_rate between vports in a group. */ u32 bw_share;/* The parent group of this vport scheduling element. */ -struct mlx5_esw_rate_group *parent; +struct mlx5_esw_sched_node *parent;/* Membership in the parent 'members' list. */ struct list_head parent_entry; } qos;
@@ -372,11 +372,11 @@ struct mlx5_eswitch {refcount_t refcnt;u32 root_tsar_ix;struct mlx5_qos_domain *domain; -/* Contains all vports with QoS enabled but no explicit group. -* Cannot be NULL if QoS is enabled, but may be a fake group -* referencing the root TSAR if the esw doesn't support groups. +/* Contains all vports with QoS enabled but no explicit node. +* Cannot be NULL if QoS is enabled, but may be a fake node +* referencing the root TSAR if the esw doesn't support nodes. */ -struct mlx5_esw_rate_group *group0; +struct mlx5_esw_sched_node *node0; } qos;struct mlx5_esw_bridge_offloads *br_offloads;
@@ -436,9 +436,9 @@ int mlx5_eswitch_set_vport_trust(struct mlx5_eswitch *esw, u16 vport_num, bool setting);int mlx5_eswitch_set_vport_rate (struct mlx5_eswitch *esw,u16 vport,u32 max_rate,u32 min_rate); -int mlx5_esw_qos_vport_update_group (struct mlx5_vport *vport, -struct mlx5_esw_rate_group *group, -struct netlink_ext_ack *extack); +int mlx5_esw_qos_vport_update_node (struct mlx5_vport *vport, +struct mlx5_esw_sched_node *node, +struct netlink_ext_ack *extack);int mlx5_eswitch_set_vepa (struct mlx5_eswitch *esw,u8 setting);int mlx5_eswitch_get_vepa (struct mlx5_eswitch *esw,u8 *setting); int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,
Signature · 1 line
2.44.0
Re: [PATCH net-next V3 06/15] net/mlx5: Introduce node struct and rename group terminology to node
Quoted 4 lines
Introduce the
mlx5_esw_sched_nodestruct, consolidating all rate hierarchy related details, including membership and scheduling parameters.
Quoted 8 lines
Since the group concept aligns with the
mlx5_esw_sched_node, replace themlx5_esw_rate_groupstruct with it and rename the "group" terminology to "node" throughout the rate hierarchy.All relevant code paths and structures have been updated to use the "node" terminology accordingly, laying the groundwork for future patches that will unify the handling of different types of members within the rate hierarchy.
Tariq Toukan
maintainerPATCH v3 7/15 net/mlx5: Refactor vport scheduling element creation function
In reply to Tariq ToukanFrom: Carolina Jubran <[email protected]>
Modify the vport scheduling element creation function to get the parent node directly, aligning it with the group creation function.
This ensures a consistent flow for scheduling elements creation, as the parent nodes already contain the device and parent element index.
--- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +15 -12
@@ -407,10 +407,10 @@ static int esw_qos_create_node_sched_elem(struct mlx5_core_dev *dev, u32 parent_ tsar_ix); } -static int esw_qos_vport_create_sched_element (struct mlx5_vport *vport, -u32 max_rate,u32 bw_share) +static int +esw_qos_vport_create_sched_element (struct mlx5_vport *vport,struct mlx5_esw_sched_node *parent, +u32 max_rate,u32 bw_share,u32 *sched_elem_ix) { -struct mlx5_esw_sched_node *parent = vport->qos.parent;u32 sched_ctx[MLX5_ST_SZ_DW (scheduling_context)] = {};struct mlx5_core_dev *dev = parent->esw->dev;void *attr;
@@ -432,7 +432,7 @@ static int esw_qos_vport_create_sched_element(struct mlx5_vport *vport, err =mlx5_create_scheduling_element_cmd (dev,SCHEDULING_HIERARCHY_E_SWITCH , sched_ctx, - &vport->qos.esw_sched_elem_ix); + sched_elem_ix);if (err) { esw_warn(dev, "E-Switch create vport scheduling element failed (vport=%d,err=%d)\n",
@@ -459,21 +459,23 @@ static int esw_qos_update_node_scheduling_element(struct mlx5_vport *vport,return err; } -esw_qos_vport_set_parent (vport, new_node);/* Use new node max rate if vport max rate is unlimited. */ max_rate = vport->qos.max_rate ? vport->qos.max_rate : new_node->max_rate; - err =esw_qos_vport_create_sched_element (vport, max_rate, vport->qos.bw_share); + err =esw_qos_vport_create_sched_element (vport, new_node, max_rate, vport->qos.bw_share, + &vport->qos.esw_sched_elem_ix);if (err) {NL_SET_ERR_MSG_MOD (extack,"E-Switch vport node set failed." ); goto err_sched; } +esw_qos_vport_set_parent (vport, new_node); +return 0 ; err_sched: -esw_qos_vport_set_parent (vport, curr_node); max_rate = vport->qos.max_rate ? vport->qos.max_rate : curr_node->max_rate; -if (esw_qos_vport_create_sched_element (vport, max_rate, vport->qos.bw_share)) +if (esw_qos_vport_create_sched_element (vport, curr_node, max_rate, vport->qos.bw_share, + &vport->qos.esw_sched_elem_ix))esw_warn (curr_node->esw->dev,"E-Switch vport node restore failed (vport=%d)\n" , vport->vport);
@@ -717,13 +719,14 @@ static int esw_qos_vport_enable(struct mlx5_vport *vport,if (err)return err; -INIT_LIST_HEAD (&vport->qos.parent_entry); -esw_qos_vport_set_parent (vport, esw->qos.node0); - - err =esw_qos_vport_create_sched_element (vport, max_rate, bw_share); + err =esw_qos_vport_create_sched_element (vport, esw->qos.node0, max_rate, bw_share, + &vport->qos.esw_sched_elem_ix);if (err) goto err_out; +INIT_LIST_HEAD (&vport->qos.parent_entry); +esw_qos_vport_set_parent (vport, esw->qos.node0); + vport->qos.enabled = true;trace_mlx5_esw_vport_qos_create (vport->dev, vport, bw_share, max_rate);
Signature · 1 line
2.44.0
Tariq Toukan
maintainerPATCH v3 8/15 net/mlx5: Refactor vport QoS to use scheduling node structure
In reply to Tariq ToukanFrom: Carolina Jubran <[email protected]>
Refactor the vport QoS structure by moving group membership and scheduling details into the mlx5_esw_sched_node structure.
This change consolidates the vport into the rate hierarchy by unifying the handling of different types of scheduling element nodes.
In addition, add a direct reference to the mlx5_vport within the mlx5_esw_sched_node structure, to ensure that the vport is easily accessible when a scheduling node is associated with a vport.
--- .../mlx5/core/esw/diag/qos_tracepoint.h | 7 +- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 154 +++++++++++------- .../net/ethernet/mellanox/mlx5/core/esw/qos.h | 3 + .../net/ethernet/mellanox/mlx5/core/eswitch.c | 2 + .../net/ethernet/mellanox/mlx5/core/eswitch.h | 11 +- 5 files changed, 110 insertions(+), 67 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/diag/qos_tracepoint.h +4 -3
@@ -9,6 +9,7 @@#include <linux/tracepoint.h> #include "eswitch.h" +#include "qos.h" TRACE_EVENT(mlx5_esw_vport_qos_destroy, TP_PROTO(const struct mlx5_core_dev *dev, const struct mlx5_vport *vport),
@@ -19,7 +20,7 @@ TRACE_EVENT(mlx5_esw_vport_qos_destroy, ), TP_fast_assign(__assign_str(devname); __entry->vport_id = vport->vport; - __entry->sched_elem_ix = vport->qos.esw_sched_elem_ix; + __entry->sched_elem_ix =mlx5_esw_qos_vport_get_sched_elem_ix (vport); ),TP_printk ("(%s) vport=%hu sched_elem_ix=%u\n" , __get_str(devname), __entry->vport_id, __entry->sched_elem_ix
@@ -39,10 +40,10 @@ DECLARE_EVENT_CLASS(mlx5_esw_vport_qos_template, ), TP_fast_assign(__assign_str(devname); __entry->vport_id = vport->vport; - __entry->sched_elem_ix = vport->qos.esw_sched_elem_ix; + __entry->sched_elem_ix =mlx5_esw_qos_vport_get_sched_elem_ix (vport); __entry->bw_share = bw_share; __entry->max_rate = max_rate; - __entry->parent = vport->qos.parent; + __entry->parent =mlx5_esw_qos_vport_get_parent (vport); ), TP_printk("(%s) vport=%hu sched_elem_ix=%u bw_share=%u, max_rate=%u parent=%p\n", __get_str(devname), __entry->vport_id, __entry->sched_elem_ix,
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +99 -55
361 lines not on this page · raw message
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.h +3 -0
@@ -13,6 +13,9 @@ int mlx5_esw_qos_set_vport_rate(struct mlx5_vport *evport, u32 max_rate, u32 minbool mlx5_esw_qos_get_vport_rate (struct mlx5_vport *vport,u32 *max_rate,u32 *min_rate);void mlx5_esw_qos_vport_disable (struct mlx5_vport *vport); +u32 mlx5_esw_qos_vport_get_sched_elem_ix (const struct mlx5_vport *vport); +struct mlx5_esw_sched_node *mlx5_esw_qos_vport_get_parent (const struct mlx5_vport *vport); +int mlx5_esw_devlink_rate_leaf_tx_share_set (struct devlink_rate *rate_leaf,void *priv,u64 tx_share,struct netlink_ext_ack *extack); int mlx5_esw_devlink_rate_leaf_tx_max_set(struct devlink_rate *rate_leaf, void *priv,
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +2 -0
@@ -1061,6 +1061,7 @@ static void mlx5_eswitch_clear_vf_vports_info(struct mlx5_eswitch *esw)unsigned long i;mlx5_esw_for_each_vf_vport (esw, i, vport, esw->esw_funcs.num_vfs) { +kfree (vport->qos.sched_node);memset (&vport->qos,0 ,sizeof (vport->qos));memset (&vport->info,0 ,sizeof (vport->info)); vport->info.link_state =MLX5_VPORT_ADMIN_STATE_AUTO ;
@@ -1073,6 +1074,7 @@ static void mlx5_eswitch_clear_ec_vf_vports_info(struct mlx5_eswitch *esw)unsigned long i;mlx5_esw_for_each_ec_vf_vport (esw, i, vport, esw->esw_funcs.num_ec_vfs) { +kfree (vport->qos.sched_node);memset (&vport->qos,0 ,sizeof (vport->qos));memset (&vport->info,0 ,sizeof (vport->info)); vport->info.link_state =MLX5_VPORT_ADMIN_STATE_AUTO ;
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +2 -9
@@ -216,15 +216,8 @@ struct mlx5_vport {struct {/* Initially false, set to true whenever any QoS features are used. */ bool enabled; -u32 esw_sched_elem_ix; -u32 min_rate; -u32 max_rate; -/* A computed value indicating relative min_rate between vports in a group. */ -u32 bw_share; -/* The parent group of this vport scheduling element. */ -struct mlx5_esw_sched_node *parent; -/* Membership in the parent 'members' list. */ -struct list_head parent_entry; +/* Vport scheduling element node. */ +struct mlx5_esw_sched_node *sched_node; } qos;u16 vport;
Signature · 1 line
2.44.0
Tariq Toukan
maintainerPATCH v3 9/15 net/mlx5: Remove vport QoS enabled flag
In reply to Tariq ToukanFrom: Carolina Jubran <[email protected]>
Remove the enabled flag from the vport->qos struct, as QoS now relies solely on the sched_node pointer to determine whether QoS features are in use.
Currently, the vport qos struct consists only of the sched_node, introducing an unnecessary two-level reference. However, the qos struct is retained as it will be extended in future patches to support new QoS features.
--- drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c | 13 ++++++------- drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 2 -- 2 files changed, 6 insertions(+), 9 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +6 -7
@@ -742,7 +742,7 @@ static int esw_qos_vport_enable(struct mlx5_vport *vport,int err;esw_assert_qos_lock_held (esw); -if (vport->qos.enabled) +if (vport->qos.sched_node)return 0 ; err =esw_qos_get (esw, extack);
@@ -761,7 +761,6 @@ static int esw_qos_vport_enable(struct mlx5_vport *vport, goto err_alloc; } - vport->qos.enabled = true; vport->qos.sched_node->vport = vport;trace_mlx5_esw_vport_qos_create (vport->dev, vport, bw_share, max_rate);
@@ -787,9 +786,9 @@ void mlx5_esw_qos_vport_disable(struct mlx5_vport *vport)lockdep_assert_held (&esw->state_lock);esw_qos_lock (esw); -if (!vport->qos.enabled) - goto unlock; vport_node = vport->qos.sched_node; +if (!vport_node) + goto unlock;WARN (vport_node->parent != esw->qos.node0,"Disabling QoS on port before detaching it from node" );
@@ -836,7 +835,7 @@ bool mlx5_esw_qos_get_vport_rate(struct mlx5_vport *vport, u32 *max_rate, u32 *mbool enabled;esw_qos_lock (esw); - enabled = vport->qos.enabled; + enabled = !!vport->qos.sched_node;if (enabled) { *max_rate = vport->qos.sched_node->max_rate; *min_rate = vport->qos.sched_node->min_rate;
@@ -933,7 +932,7 @@ int mlx5_esw_qos_modify_vport_rate(struct mlx5_eswitch *esw, u16 vport_num, u32 }esw_qos_lock (esw); -if (!vport->qos.enabled) { +if (!vport->qos.sched_node) {/* Eswitch QoS wasn't enabled yet. Enable it and vport QoS. */ err =esw_qos_vport_enable (vport, rate_mbps,0 ,NULL ); }else {
@@ -1142,7 +1141,7 @@ int mlx5_esw_qos_vport_update_node(struct mlx5_vport *vport, }esw_qos_lock (esw); -if (!vport->qos.enabled && !node) +if (!vport->qos.sched_node && !node) goto unlock; err =esw_qos_vport_enable (vport,0 ,0 , extack);
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +0 -2
@@ -214,8 +214,6 @@ struct mlx5_vport {/* Protected with the E-Switch qos domain lock. */ struct { -/* Initially false, set to true whenever any QoS features are used. */ -bool enabled;/* Vport scheduling element node. */ struct mlx5_esw_sched_node *sched_node; } qos;
Signature · 1 line
2.44.0
Tariq Toukan
maintainerPATCH v3 10/15 net/mlx5: Simplify QoS scheduling element configuration
In reply to Tariq ToukanFrom: Carolina Jubran <[email protected]>
Simplify the configuration of QoS scheduling elements by removing the separate functions esw_qos_node_config and esw_qos_vport_config.
Instead, directly use the existing esw_qos_sched_elem_config function for both nodes and vports.
This unification helps in generalizing operations on scheduling elements nodes.
--- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 86 +++++++++---------- 1 file changed, 40 insertions(+), 46 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +40 -46
@@ -66,6 +66,11 @@ enum sched_node_type { SCHED_NODE_TYPE_VPORT, }; +static const char *const sched_node_type_str[] = { + [SCHED_NODE_TYPE_VPORTS_TSAR ] ="vports TSAR" , + [SCHED_NODE_TYPE_VPORT ] ="vport" , +}; +struct mlx5_esw_sched_node {u32 ix;/* Bandwidth parameters. */
@@ -113,11 +118,27 @@ mlx5_esw_qos_vport_get_parent(const struct mlx5_vport *vport)return vport->qos.sched_node->parent; } -static int esw_qos_sched_elem_config (struct mlx5_core_dev *dev,u32 sched_elem_ix, -u32 max_rate,u32 bw_share) +static void esw_qos_sched_elem_config_warn (struct mlx5_esw_sched_node *node,int err) +{ +if (node->vport) { +esw_warn (node->esw->dev, +"E-Switch modify %s scheduling element failed (vport=%d,err=%d)\n" , + sched_node_type_str[node->type], node->vport->vport, err); +return ; + } + +esw_warn (node->esw->dev, +"E-Switch modify %s scheduling element failed (err=%d)\n" , + sched_node_type_str[node->type], err); +} + +static int esw_qos_sched_elem_config (struct mlx5_esw_sched_node *node,u32 max_rate,u32 bw_share, +struct netlink_ext_ack *extack) {u32 sched_ctx[MLX5_ST_SZ_DW (scheduling_context)] = {}; +struct mlx5_core_dev *dev = node->esw->dev;u32 bitmask =0 ; +int err;if (!MLX5_CAP_GEN (dev, qos) || !MLX5_CAP_QOS (dev, esw_scheduling))return -EOPNOTSUPP ;
@@ -127,46 +148,22 @@ static int esw_qos_sched_elem_config(struct mlx5_core_dev *dev, u32 sched_elem_i bitmask |=MODIFY_SCHEDULING_ELEMENT_IN_MODIFY_BITMASK_MAX_AVERAGE_BW ; bitmask |=MODIFY_SCHEDULING_ELEMENT_IN_MODIFY_BITMASK_BW_SHARE ; -return mlx5_modify_scheduling_element_cmd (dev, -SCHEDULING_HIERARCHY_E_SWITCH , - sched_ctx, - sched_elem_ix, - bitmask); -} - -static int esw_qos_node_config (struct mlx5_esw_sched_node *node, -u32 max_rate,u32 bw_share,struct netlink_ext_ack *extack) -{ -struct mlx5_core_dev *dev = node->esw->dev; -int err; - - err =esw_qos_sched_elem_config (dev, node->ix, max_rate, bw_share); -if (err) -NL_SET_ERR_MSG_MOD (extack,"E-Switch modify node TSAR element failed" ); - -trace_mlx5_esw_node_qos_config (dev, node, node->ix, bw_share, max_rate); - -return err; -} - -static int esw_qos_vport_config (struct mlx5_vport *vport, -u32 max_rate,u32 bw_share, -struct netlink_ext_ack *extack) -{ -struct mlx5_esw_sched_node *vport_node = vport->qos.sched_node; -struct mlx5_core_dev *dev = vport_node->parent->esw->dev; -int err; - - err =esw_qos_sched_elem_config (dev, vport_node->ix, max_rate, bw_share); + err =mlx5_modify_scheduling_element_cmd (dev, +SCHEDULING_HIERARCHY_E_SWITCH , + sched_ctx, + node->ix, + bitmask);if (err) { -esw_warn (dev, -"E-Switch modify vport scheduling element failed (vport=%d,err=%d)\n" , - vport->vport, err); -NL_SET_ERR_MSG_MOD (extack,"E-Switch modify vport scheduling element failed" ); +esw_qos_sched_elem_config_warn (node, err); +NL_SET_ERR_MSG_MOD (extack,"E-Switch modify scheduling element failed" ); +return err; } -trace_mlx5_esw_vport_qos_config (dev, vport, bw_share, max_rate); +if (node->type ==SCHED_NODE_TYPE_VPORTS_TSAR ) +trace_mlx5_esw_node_qos_config (dev, node, node->ix, bw_share, max_rate); +else if (node->type ==SCHED_NODE_TYPE_VPORT ) +trace_mlx5_esw_vport_qos_config (dev, node->vport, bw_share, max_rate);return 0 ; }
@@ -246,8 +243,7 @@ static int esw_qos_normalize_node_min_rate(struct mlx5_esw_sched_node *node,if (bw_share == vport_node->bw_share)continue ; - err =esw_qos_vport_config (vport_node->vport, vport_node->max_rate, bw_share, - extack); + err =esw_qos_sched_elem_config (vport_node, vport_node->max_rate, bw_share, extack);if (err)return err;
@@ -274,7 +270,7 @@ static int esw_qos_normalize_min_rate(struct mlx5_eswitch *esw, struct netlink_eif (bw_share == node->bw_share)continue ; - err =esw_qos_node_config (node, node->max_rate, bw_share, extack); + err =esw_qos_sched_elem_config (node, node->max_rate, bw_share, extack);if (err)return err;
@@ -338,8 +334,7 @@ static int esw_qos_set_vport_max_rate(struct mlx5_vport *vport,if (!max_rate) act_max_rate = vport_node->parent->max_rate; - err =esw_qos_vport_config (vport, act_max_rate, vport_node->bw_share, extack); - + err =esw_qos_sched_elem_config (vport_node, act_max_rate, vport_node->bw_share, extack);if (!err) vport_node->max_rate = max_rate;
@@ -384,7 +379,7 @@ static int esw_qos_set_node_max_rate(struct mlx5_esw_sched_node *node,if (node->max_rate == max_rate)return 0 ; - err =esw_qos_node_config (node, max_rate, node->bw_share, extack); + err =esw_qos_sched_elem_config (node, max_rate, node->bw_share, extack);if (err)return err;
@@ -395,8 +390,7 @@ static int esw_qos_set_node_max_rate(struct mlx5_esw_sched_node *node,if (vport_node->max_rate)continue ; - err =esw_qos_vport_config (vport_node->vport, max_rate, vport_node->bw_share, - extack); + err =esw_qos_sched_elem_config (vport_node, max_rate, vport_node->bw_share, extack);if (err)NL_SET_ERR_MSG_MOD (extack,"E-Switch vport implicit rate limit setting failed" );
Signature · 1 line
2.44.0
Tariq Toukan
maintainerPATCH v3 11/15 net/mlx5: Generalize QoS operations for nodes and vports
In reply to Tariq ToukanFrom: Carolina Jubran <[email protected]>
Refactor QoS normalization and rate calculation functions to operate on mlx5_esw_sched_node, allowing for generalized handling of both vports and nodes.
--- .../net/ethernet/mellanox/mlx5/core/esw/qos.c | 115 +++++++----------- 1 file changed, 43 insertions(+), 72 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/qos.c +43 -72
@@ -168,45 +168,18 @@ static int esw_qos_sched_elem_config(struct mlx5_esw_sched_node *node, u32 max_rreturn 0 ; } -static u32 esw_qos_calculate_node_min_rate_divider (struct mlx5_esw_sched_node *node) -{ -u32 fw_max_bw_share =MLX5_CAP_QOS (node->esw->dev, max_tsar_bw_share); -struct mlx5_esw_sched_node *vport_node; -u32 max_guarantee =0 ; - -/* Find max min_rate across all vports in this node. -* This will correspond to fw_max_bw_share in the final bw_share calculation. -*/ -list_for_each_entry (vport_node, &node->children, entry) { -if (vport_node->min_rate > max_guarantee) - max_guarantee = vport_node->min_rate; - } - -if (max_guarantee) -return max_t (u32, max_guarantee / fw_max_bw_share,1 ); - -/* If vports max min_rate divider is 0 but their node has bw_share -* configured, then set bw_share for vports to minimal value. -*/ -if (node->bw_share) -return 1 ; - -/* A divider of 0 sets bw_share for all node vports to 0, -* effectively disabling min guarantees. -*/ -return 0 ; -} - -static u32 esw_qos_calculate_min_rate_divider (struct mlx5_eswitch *esw) +static u32 esw_qos_calculate_min_rate_divider (struct mlx5_eswitch *esw, +struct mlx5_esw_sched_node *parent) { +struct list_head *nodes = parent ? &parent->children : &esw->qos.domain->nodes;u32 fw_max_bw_share =MLX5_CAP_QOS (esw->dev, max_tsar_bw_share);struct mlx5_esw_sched_node *node;u32 max_guarantee =0 ; -/* Find max min_rate across all esw nodes. +/* Find max min_rate across all nodes. * This will correspond to fw_max_bw_share in the final bw_share calculation. */ -list_for_each_entry (node, &esw->qos.domain->nodes, entry) { +list_for_each_entry (node, nodes, entry) {if (node->esw == esw && node->ix != esw->qos.root_tsar_ix && node->min_rate > max_guarantee) max_guarantee = node->min_rate;
@@ -215,7 +188,14 @@ static u32 esw_qos_calculate_min_rate_divider(struct mlx5_eswitch *esw)if (max_guarantee)return max_t (u32, max_guarantee / fw_max_bw_share,1 ); -/* If no node has min_rate configured, a divider of 0 sets all +/* If nodes max min_rate divider is 0 but their parent has bw_share +* configured, then set bw_share for nodes to minimal value. +*/ + +if (parent && parent->bw_share) +return 1 ; + +/* If the node nodes has min_rate configured, a divider of 0 sets all * nodes' bw_share to 0, effectively disabling min guarantees. */ return 0 ;
@@ -228,59 +208,50 @@ static u32 esw_qos_calc_bw_share(u32 min_rate, u32 divider, u32 fw_max)return min_t (u32,max_t (u32,DIV_ROUND_UP (min_rate, divider),MLX5_MIN_BW_SHARE ), fw_max); } -static int esw_qos_normalize_node_min_rate (struct mlx5_esw_sched_node *node, -struct netlink_ext_ack *extack) +static int esw_qos_update_sched_node_bw_share (struct mlx5_esw_sched_node *node, +u32 divider, +struct netlink_ext_ack *extack) {u32 fw_max_bw_share =MLX5_CAP_QOS (node->esw->dev, max_tsar_bw_share); -u32 divider =esw_qos_calculate_node_min_rate_divider (node); -struct mlx5_esw_sched_node *vport_node;u32 bw_share;int err; -list_for_each_entry (vport_node, &node->children, entry) { - bw_share =esw_qos_calc_bw_share (vport_node->min_rate, divider, fw_max_bw_share); + bw_share =esw_qos_calc_bw_share (node->min_rate, divider, fw_max_bw_share); -if (bw_share == vport_node->bw_share) -continue ; +if (bw_share == node->bw_share) +return 0 ; - err =esw_qos_sched_elem_config (vport_node, vport_node->max_rate, bw_share, extack); -if (err) -return err; + err =esw_qos_sched_elem_config (node, node->max_rate, bw_share, extack); +if (err) +return err; - vport_node->bw_share = bw_share; - } + node->bw_share = bw_share; -return 0 ; +return err; } -static int esw_qos_normalize_min_rate (struct mlx5_eswitch *esw,struct netlink_ext_ack *extack) +static int esw_qos_normalize_min_rate (struct mlx5_eswitch *esw, +struct mlx5_esw_sched_node *parent, +struct netlink_ext_ack *extack) { -u32 fw_max_bw_share =MLX5_CAP_QOS (esw->dev, max_tsar_bw_share); -u32 divider =esw_qos_calculate_min_rate_divider (esw); +struct list_head *nodes = parent ? &parent->children : &esw->qos.domain->nodes; +u32 divider =esw_qos_calculate_min_rate_divider (esw, parent);struct mlx5_esw_sched_node *node; -u32 bw_share; -int err; -list_for_each_entry (node, &esw->qos.domain->nodes, entry) { -if (node->esw != esw || node->ix == esw->qos.root_tsar_ix) -continue ; - bw_share =esw_qos_calc_bw_share (node->min_rate, divider, - fw_max_bw_share); +list_for_each_entry (node, nodes, entry) { +int err; -if (bw_share == node->bw_share) +if (node->esw != esw || node->ix == esw->qos.root_tsar_ix)continue ; - err =esw_qos_sched_elem_config (node, node->max_rate, bw_share, extack); + err =esw_qos_update_sched_node_bw_share (node, divider, extack);if (err)return err; - node->bw_share = bw_share; - -/* All the node's vports need to be set with default bw_share -* to enable them with QOS -*/ - err =esw_qos_normalize_node_min_rate (node, extack); +if (list_empty (&node->children)) +continue ; + err =esw_qos_normalize_min_rate (node->esw, node, extack);if (err)return err; }
@@ -307,7 +278,7 @@ static int esw_qos_set_vport_min_rate(struct mlx5_vport *vport, previous_min_rate = vport_node->min_rate; vport_node->min_rate = min_rate; - err =esw_qos_normalize_node_min_rate (vport_node->parent, extack); + err =esw_qos_normalize_min_rate (vport_node->parent->esw, vport_node->parent, extack);if (err) vport_node->min_rate = previous_min_rate;
@@ -357,13 +328,13 @@ static int esw_qos_set_node_min_rate(struct mlx5_esw_sched_node *node, previous_min_rate = node->min_rate; node->min_rate = min_rate; - err =esw_qos_normalize_min_rate (esw, extack); + err =esw_qos_normalize_min_rate (esw,NULL , extack);if (err) {NL_SET_ERR_MSG_MOD (extack,"E-Switch node min rate setting failed" );/* Attempt restoring previous configuration */ node->min_rate = previous_min_rate; -if (esw_qos_normalize_min_rate (esw, extack)) +if (esw_qos_normalize_min_rate (esw,NULL , extack))NL_SET_ERR_MSG_MOD (extack,"E-Switch BW share restore failed" ); }
@@ -525,8 +496,8 @@ static int esw_qos_vport_update_node(struct mlx5_vport *vport,/* Recalculate bw share weights of old and new nodes */ if (vport_node->bw_share || new_node->bw_share) { -esw_qos_normalize_node_min_rate (curr_node, extack); -esw_qos_normalize_node_min_rate (new_node, extack); +esw_qos_normalize_min_rate (curr_node->esw, curr_node, extack); +esw_qos_normalize_min_rate (new_node->esw, new_node, extack); }return 0 ;
@@ -581,7 +552,7 @@ __esw_qos_create_vports_sched_node(struct mlx5_eswitch *esw, struct mlx5_esw_sch goto err_alloc_node; } - err =esw_qos_normalize_min_rate (esw, extack); + err =esw_qos_normalize_min_rate (esw,NULL , extack);if (err) {NL_SET_ERR_MSG_MOD (extack,"E-Switch nodes normalization failed" ); goto err_min_rate;
@@ -638,7 +609,7 @@ static int __esw_qos_destroy_node(struct mlx5_esw_sched_node *node, struct netliNL_SET_ERR_MSG_MOD (extack,"E-Switch destroy TSAR_ID failed" );__esw_qos_free_node (node); - err =esw_qos_normalize_min_rate (esw, extack); + err =esw_qos_normalize_min_rate (esw,NULL , extack);if (err)NL_SET_ERR_MSG_MOD (extack,"E-Switch nodes normalization failed" );
Signature · 1 line
2.44.0
Tariq Toukan
maintainerPATCH v3 12/15 net/mlx5: Add sync reset drop mode support
In reply to Tariq ToukanFrom: Moshe Shemesh <[email protected]>
On sync reset flow, firmware may request a PF, which already acknowledged the unload event, to move to drop mode. Drop mode means that this PF will reduce polling frequency, as this PF is not going to have another active part in the reset, but only reload back after the reset.
--- drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c +8 -1
@@ -35,6 +35,7 @@ struct mlx5_fw_reset {enum {MLX5_FW_RST_STATE_IDLE =0 ,MLX5_FW_RST_STATE_TOGGLE_REQ =4 , +MLX5_FW_RST_STATE_DROP_MODE =5 , };enum {
@@ -616,6 +617,7 @@ static void mlx5_sync_reset_unload_event(struct work_struct *work)struct mlx5_fw_reset *fw_reset;struct mlx5_core_dev *dev;unsigned long timeout; +int poll_freq =20 ;bool reset_action;u8 rst_state;int err;
@@ -651,7 +653,12 @@ static void mlx5_sync_reset_unload_event(struct work_struct *work) reset_action = true;break ; } -msleep (20 ); +if (rst_state ==MLX5_FW_RST_STATE_DROP_MODE ) { +mlx5_core_info (dev,"Sync Reset Drop mode ack\n" ); +mlx5_set_fw_rst_ack (dev); + poll_freq =1000 ; + } +msleep (poll_freq); }while (!time_after (jiffies, timeout));if (!reset_action) {
Signature · 1 line
2.44.0
Tariq Toukan
maintainerPATCH v3 13/15 net/mlx5: Only create VEPA flow table when in VEPA mode
In reply to Tariq ToukanFrom: Benjamin Poirier <[email protected]>
Currently, when VFs are created, two flow tables are added for the eswitch:
the "fdb" table, which contains rules for each VF and the "vepa_fdb" table. In the default VEB mode, the vepa_fdb table is empty. When switching to VEPA mode, flow steering rules are added to vepa_fdb. Even though the vepa_fdb table is empty in VEB mode, its presence adds some cost to packet processing. In some workloads, this leads to drops which are reported by the rx_discards_phy ethtool counter.
In order to improve performance, only create vepa_fdb when in VEPA mode.
Tests were done on a ConnectX-6 Lx adapter forwarding 64B packets between both ports using dpdk-testpmd. Numbers are Rx-pps for each port, as reported by testpmd.
Without changes:
traffic to unknown mac
testpmd on PF numvfs=0,0 35257998,35264499 numvfs=1,1 24590124,24590888 testpmd on VF with numvfs=1,1 20434338,20434887 traffic to VF mac testpmd on VF with numvfs=1,1 30341014,30340749
With changes:
traffic to unknown mac
testpmd on PF numvfs=0,0 35404361,35383378 numvfs=1,1 29801247,29790757 testpmd on VF with numvfs=1,1 24310435,24309084 traffic to VF mac testpmd on VF with numvfs=1,1 34811436,34781706
--- .../ethernet/mellanox/mlx5/core/esw/legacy.c | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/esw/legacy.c +13 -14
@@ -176,20 +176,10 @@ static void esw_destroy_legacy_vepa_table(struct mlx5_eswitch *esw)static int esw_create_legacy_table (struct mlx5_eswitch *esw) { -int err; -memset (&esw->fdb_table.legacy,0 ,sizeof (struct legacy_fdb ));atomic64_set (&esw->user_count,0 ); - err =esw_create_legacy_vepa_table (esw); -if (err) -return err; - - err =esw_create_legacy_fdb_table (esw); -if (err) -esw_destroy_legacy_vepa_table (esw); - -return err; +return esw_create_legacy_fdb_table (esw); }static void esw_cleanup_vepa_rules (struct mlx5_eswitch *esw)
@@ -259,15 +249,22 @@ static int _mlx5_eswitch_set_vepa_locked(struct mlx5_eswitch *esw,if (!setting) {esw_cleanup_vepa_rules (esw); +esw_destroy_legacy_vepa_table (esw);return 0 ; }if (esw->fdb_table.legacy.vepa_uplink_rule)return 0 ; + err =esw_create_legacy_vepa_table (esw); +if (err) +return err; + spec =kvzalloc (sizeof (*spec),GFP_KERNEL ); -if (!spec) -return -ENOMEM ; +if (!spec) { + err = -ENOMEM ; + goto out; + }/* Uplink rule forward uplink traffic to FDB */ misc =MLX5_ADDR_OF (fte_match_param, spec->match_value, misc_parameters);
@@ -303,8 +300,10 @@ static int _mlx5_eswitch_set_vepa_locked(struct mlx5_eswitch *esw, out:kvfree (spec); -if (err) +if (err) {esw_cleanup_vepa_rules (esw); +esw_destroy_legacy_vepa_table (esw); + }return err; }
Signature · 1 line
2.44.0
Tariq Toukan
maintainerPATCH v3 14/15 net/mlx5: fs, rename packet reformat struct member action
In reply to Tariq ToukanFrom: Moshe Shemesh <[email protected]>
As preparation for HW Steering support, rename packet reformat struct member action to fs_dr_action, to distinguish from fs_hws_action which will be added. Add a pointer where needed to keep code line shorter and more readable.
--- .../net/ethernet/mellanox/mlx5/core/fs_core.h | 2 +- .../mellanox/mlx5/core/steering/fs_dr.c | 23 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +1 -1
@@ -73,7 +73,7 @@ struct mlx5_pkt_reformat {int reformat_type;/* from mlx5_ifc */ enum mlx5_flow_resource_owner owner;union { -struct mlx5_fs_dr_action action; +struct mlx5_fs_dr_action fs_dr_action;u32 id; }; };
drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c +13 -10
@@ -256,6 +256,7 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns, {struct mlx5dr_domain *domain = ns->fs_dr_domain.dr_domain;struct mlx5dr_action_dest *term_actions; +struct mlx5_pkt_reformat *pkt_reformat;struct mlx5dr_match_parameters params;struct mlx5_core_dev *dev = ns->dev;struct mlx5dr_action **fs_dr_actions;
@@ -332,18 +333,19 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns,if (fte->act_dests.action.action &MLX5_FLOW_CONTEXT_ACTION_PACKET_REFORMAT ) {bool is_decap; -if (fte->act_dests.action.pkt_reformat->owner ==MLX5_FLOW_RESOURCE_OWNER_FW ) { + pkt_reformat = fte->act_dests.action.pkt_reformat; +if (pkt_reformat->owner ==MLX5_FLOW_RESOURCE_OWNER_FW ) { err = -EINVAL ;mlx5dr_err (domain,"FW-owned reformat can't be used in SW rule\n" ); goto free_actions; } - is_decap = fte->act_dests.action.pkt_reformat->reformat_type == + is_decap = pkt_reformat->reformat_type ==MLX5_REFORMAT_TYPE_L3_TUNNEL_TO_L2 ;if (is_decap) actions[num_actions++] = - fte->act_dests.action.pkt_reformat->action.dr_action; + pkt_reformat->fs_dr_action.dr_action;else delay_encap_set = true; }
@@ -395,8 +397,7 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns, }if (delay_encap_set) - actions[num_actions++] = - fte->act_dests.action.pkt_reformat->action.dr_action; + actions[num_actions++] = pkt_reformat->fs_dr_action.dr_action;/* The order of the actions below is not important */
@@ -458,9 +459,11 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns, term_actions[num_term_actions].dest = tmp_action;if (dst->dest_attr.vport.flags & -MLX5_FLOW_DEST_VPORT_REFORMAT_ID ) +MLX5_FLOW_DEST_VPORT_REFORMAT_ID ) { + pkt_reformat = dst->dest_attr.vport.pkt_reformat; term_actions[num_term_actions].reformat = - dst->dest_attr.vport.pkt_reformat->action.dr_action; + pkt_reformat->fs_dr_action.dr_action; + } num_term_actions++;break ;
@@ -671,7 +674,7 @@ static int mlx5_cmd_dr_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns } pkt_reformat->owner =MLX5_FLOW_RESOURCE_OWNER_SW ; - pkt_reformat->action.dr_action = action; + pkt_reformat->fs_dr_action.dr_action = action;return 0 ; }
@@ -679,7 +682,7 @@ static int mlx5_cmd_dr_packet_reformat_alloc(struct mlx5_flow_root_namespace *nsstatic void mlx5_cmd_dr_packet_reformat_dealloc (struct mlx5_flow_root_namespace *ns,struct mlx5_pkt_reformat *pkt_reformat) { -mlx5dr_action_destroy (pkt_reformat->action.dr_action); +mlx5dr_action_destroy (pkt_reformat->fs_dr_action.dr_action); } static int mlx5_cmd_dr_modify_header_alloc(struct mlx5_flow_root_namespace *ns,
@@ -836,7 +839,7 @@ int mlx5_fs_dr_action_get_pkt_reformat_id(struct mlx5_pkt_reformat *pkt_reformatcase MLX5_REFORMAT_TYPE_L2_TO_L2_TUNNEL :case MLX5_REFORMAT_TYPE_L2_TO_L3_TUNNEL :case MLX5_REFORMAT_TYPE_INSERT_HDR : -return mlx5dr_action_get_pkt_reformat_id (pkt_reformat->action.dr_action); +return mlx5dr_action_get_pkt_reformat_id (pkt_reformat->fs_dr_action.dr_action); }return -EOPNOTSUPP ; }
Signature · 1 line
2.44.0
Tariq Toukan
maintainerPATCH v3 15/15 net/mlx5: fs, rename modify header struct member action
In reply to Tariq ToukanFrom: Moshe Shemesh <[email protected]>
As preparation for HW Steering support, rename modify header struct member action to fs_dr_action, to distinguish from fs_hws_action which will be added. Add a pointer where needed to keep code line shorter and more readable.
--- .../ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | 2 +- .../net/ethernet/mellanox/mlx5/core/steering/fs_dr.c | 12 +++++++----- 3 files changed, 10 insertions(+), 8 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_smfs.c +2 -2
@@ -318,7 +318,7 @@ mlx5_ct_fs_smfs_ct_rule_add(struct mlx5_ct_fs *fs, struct mlx5_flow_spec *spec, } actions[num_actions++] = smfs_rule->count_action; - actions[num_actions++] = attr->modify_hdr->action.dr_action; + actions[num_actions++] = attr->modify_hdr->fs_dr_action.dr_action; actions[num_actions++] = fs_smfs->fwd_action; nat = (attr->ft == fs_smfs->ct_nat);
@@ -379,7 +379,7 @@ static int mlx5_ct_fs_smfs_ct_rule_update(struct mlx5_ct_fs *fs, struct mlx5_ct_struct mlx5dr_rule *rule; actions[0 ] = smfs_rule->count_action; - actions[1 ] = attr->modify_hdr->action.dr_action; + actions[1 ] = attr->modify_hdr->fs_dr_action.dr_action; actions[2 ] = fs_smfs->fwd_action; rule = mlx5_smfs_rule_create(smfs_rule->smfs_matcher->dr_matcher, spec,
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +1 -1
@@ -63,7 +63,7 @@ struct mlx5_modify_hdr {enum mlx5_flow_namespace_type ns_type;enum mlx5_flow_resource_owner owner;union { -struct mlx5_fs_dr_action action; +struct mlx5_fs_dr_action fs_dr_action;u32 id; }; };
drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c +7 -5
@@ -372,9 +372,11 @@ static int mlx5_cmd_dr_create_fte(struct mlx5_flow_root_namespace *ns, actions[num_actions++] = tmp_action; } -if (fte->act_dests.action.action &MLX5_FLOW_CONTEXT_ACTION_MOD_HDR ) - actions[num_actions++] = - fte->act_dests.action.modify_hdr->action.dr_action; +if (fte->act_dests.action.action &MLX5_FLOW_CONTEXT_ACTION_MOD_HDR ) { +struct mlx5_modify_hdr *modify_hdr = fte->act_dests.action.modify_hdr; + + actions[num_actions++] = modify_hdr->fs_dr_action.dr_action; + }if (fte->act_dests.action.action &MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH ) { tmp_action =create_action_push_vlan (domain, &fte->act_dests.action.vlan[0 ]);
@@ -705,7 +707,7 @@ static int mlx5_cmd_dr_modify_header_alloc(struct mlx5_flow_root_namespace *ns, } modify_hdr->owner =MLX5_FLOW_RESOURCE_OWNER_SW ; - modify_hdr->action.dr_action = action; + modify_hdr->fs_dr_action.dr_action = action;return 0 ; }
@@ -713,7 +715,7 @@ static int mlx5_cmd_dr_modify_header_alloc(struct mlx5_flow_root_namespace *ns,static void mlx5_cmd_dr_modify_header_dealloc (struct mlx5_flow_root_namespace *ns,struct mlx5_modify_hdr *modify_hdr) { -mlx5dr_action_destroy (modify_hdr->action.dr_action); +mlx5dr_action_destroy (modify_hdr->fs_dr_action.dr_action); } static int
Signature · 1 line
2.44.0
This series was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:
Quoted 5 lines · On Wed, 16 Oct 2024 20:36:02 +0300 you wrote:
Hi,
This patch series from the team to mlx5 core driver consists of one main QoS part followed by small misc patches.
Quoted 7 lines
This main part (patches 1 to 11) by Carolina refactors the QoS handling to generalize operations on scheduling groups and vports. These changes are necessary to support new features that will extend group functionality, introduce new group types, and support deeper hierarchies.
[...]
Here is the summary with links:
- [net-next,V3,01/15] net/mlx5: Refactor QoS group scheduling element creation
https://git.kernel.org/netdev/net-next/c/700814fa41ce - [net-next,V3,02/15] net/mlx5: Introduce node type to rate group structure https://git.kernel.org/netdev/net-next/c/4235fe2cb8e9 - [net-next,V3,03/15] net/mlx5: Add parent group support in rate group structure https://git.kernel.org/netdev/net-next/c/54200dbc685c - [net-next,V3,04/15] net/mlx5: Restrict domain list insertion to root TSAR ancestors https://git.kernel.org/netdev/net-next/c/24e54e870d11 - [net-next,V3,05/15] net/mlx5: Rename vport QoS group reference to parent https://git.kernel.org/netdev/net-next/c/72a1d121fa6b - [net-next,V3,06/15] net/mlx5: Introduce node struct and rename group terminology to node https://git.kernel.org/netdev/net-next/c/1c25d4388ba6 - [net-next,V3,07/15] net/mlx5: Refactor vport scheduling element creation function https://git.kernel.org/netdev/net-next/c/88d5fbcb7ba0 - [net-next,V3,08/15] net/mlx5: Refactor vport QoS to use scheduling node structure https://git.kernel.org/netdev/net-next/c/045815fe329a - [net-next,V3,09/15] net/mlx5: Remove vport QoS enabled flag https://git.kernel.org/netdev/net-next/c/ebecc37befb1 - [net-next,V3,10/15] net/mlx5: Simplify QoS scheduling element configuration https://git.kernel.org/netdev/net-next/c/70744a46aabf - [net-next,V3,11/15] net/mlx5: Generalize QoS operations for nodes and vports https://git.kernel.org/netdev/net-next/c/a1903bf50f2e - [net-next,V3,12/15] net/mlx5: Add sync reset drop mode support https://git.kernel.org/netdev/net-next/c/b37f3f2be0f4 - [net-next,V3,13/15] net/mlx5: Only create VEPA flow table when in VEPA mode https://git.kernel.org/netdev/net-next/c/f0ac6209460e - [net-next,V3,14/15] net/mlx5: fs, rename packet reformat struct member action https://git.kernel.org/netdev/net-next/c/1715f0a73233 - [net-next,V3,15/15] net/mlx5: fs, rename modify header struct member action https://git.kernel.org/netdev/net-next/c/7b919caaeb18
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html