Skip to content

Commit 4ddf77f

Browse files
dickmanmaorSaeed Mahameed
authored andcommitted
net/mlx5e: QoS, Fix wrongfully setting parent_element_id on MODIFY_SCHEDULING_ELEMENT
According to HW spec parent_element_id field should be reserved (0x0) when calling MODIFY_SCHEDULING_ELEMENT command. This patch remove the wrong initialization of reserved field, parent_element_id, on mlx5_qos_update_node. Fixes: 214baf2 ("net/mlx5e: Support HTB offload") Signed-off-by: Maor Dickman <[email protected]> Reviewed-by: Eli Cohen <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent f51471d commit 4ddf77f

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/htb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ mlx5e_htb_update_children(struct mlx5e_htb *htb, struct mlx5e_qos_node *node,
637637
if (child->bw_share == old_bw_share)
638638
continue;
639639

640-
err_one = mlx5_qos_update_node(htb->mdev, child->hw_id, child->bw_share,
640+
err_one = mlx5_qos_update_node(htb->mdev, child->bw_share,
641641
child->max_average_bw, child->hw_id);
642642
if (!err && err_one) {
643643
err = err_one;
@@ -671,7 +671,7 @@ mlx5e_htb_node_modify(struct mlx5e_htb *htb, u16 classid, u64 rate, u64 ceil,
671671
mlx5e_htb_convert_rate(htb, rate, node->parent, &bw_share);
672672
mlx5e_htb_convert_ceil(htb, ceil, &max_average_bw);
673673

674-
err = mlx5_qos_update_node(htb->mdev, node->parent->hw_id, bw_share,
674+
err = mlx5_qos_update_node(htb->mdev, bw_share,
675675
max_average_bw, node->hw_id);
676676
if (err) {
677677
NL_SET_ERR_MSG_MOD(extack, "Firmware error when modifying a node.");

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,12 @@ int mlx5_qos_create_root_node(struct mlx5_core_dev *mdev, u32 *id)
6262
return mlx5_qos_create_inner_node(mdev, MLX5_QOS_DEFAULT_DWRR_UID, 0, 0, id);
6363
}
6464

65-
int mlx5_qos_update_node(struct mlx5_core_dev *mdev, u32 parent_id,
65+
int mlx5_qos_update_node(struct mlx5_core_dev *mdev,
6666
u32 bw_share, u32 max_avg_bw, u32 id)
6767
{
6868
u32 sched_ctx[MLX5_ST_SZ_DW(scheduling_context)] = {0};
6969
u32 bitmask = 0;
7070

71-
MLX5_SET(scheduling_context, sched_ctx, parent_element_id, parent_id);
7271
MLX5_SET(scheduling_context, sched_ctx, bw_share, bw_share);
7372
MLX5_SET(scheduling_context, sched_ctx, max_average_bw, max_avg_bw);
7473

drivers/net/ethernet/mellanox/mlx5/core/qos.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int mlx5_qos_create_leaf_node(struct mlx5_core_dev *mdev, u32 parent_id,
2323
int mlx5_qos_create_inner_node(struct mlx5_core_dev *mdev, u32 parent_id,
2424
u32 bw_share, u32 max_avg_bw, u32 *id);
2525
int mlx5_qos_create_root_node(struct mlx5_core_dev *mdev, u32 *id);
26-
int mlx5_qos_update_node(struct mlx5_core_dev *mdev, u32 parent_id, u32 bw_share,
26+
int mlx5_qos_update_node(struct mlx5_core_dev *mdev, u32 bw_share,
2727
u32 max_avg_bw, u32 id);
2828
int mlx5_qos_destroy_node(struct mlx5_core_dev *mdev, u32 id);
2929

0 commit comments

Comments
 (0)