Skip to content

Commit b82e496

Browse files
cjubrangregkh
authored andcommitted
net/mlx5e: Avoid WARN_ON when configuring MQPRIO with HTB offload enabled
[ Upstream commit 689805d ] When attempting to enable MQPRIO while HTB offload is already configured, the driver currently returns `-EINVAL` and triggers a `WARN_ON`, leading to an unnecessary call trace. Update the code to handle this case more gracefully by returning `-EOPNOTSUPP` instead, while also providing a helpful user message. Signed-off-by: Carolina Jubran <[email protected]> Reviewed-by: Yael Chemla <[email protected]> Reviewed-by: Cosmin Ratiu <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Reviewed-by: Kalesh AP <[email protected]> Signed-off-by: Paolo Abeni <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 9152627 commit b82e496

File tree

1 file changed

+5
-2
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3759,8 +3759,11 @@ static int mlx5e_setup_tc_mqprio(struct mlx5e_priv *priv,
37593759
/* MQPRIO is another toplevel qdisc that can't be attached
37603760
* simultaneously with the offloaded HTB.
37613761
*/
3762-
if (WARN_ON(mlx5e_selq_is_htb_enabled(&priv->selq)))
3763-
return -EINVAL;
3762+
if (mlx5e_selq_is_htb_enabled(&priv->selq)) {
3763+
NL_SET_ERR_MSG_MOD(mqprio->extack,
3764+
"MQPRIO cannot be configured when HTB offload is enabled.");
3765+
return -EOPNOTSUPP;
3766+
}
37643767

37653768
switch (mqprio->mode) {
37663769
case TC_MQPRIO_MODE_DCB:

0 commit comments

Comments
 (0)