Skip to content

Commit

Permalink
net/mlx5e: Avoid WARN_ON when configuring MQPRIO with HTB offload ena…
Browse files Browse the repository at this point in the history
…bled

[ 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 <cjubran@nvidia.com>
Reviewed-by: Yael Chemla <ychemla@nvidia.com>
Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Carolina Jubran authored and Greg Kroah-Hartman committed Jun 4, 2025
1 parent f312bd5 commit 090c0ba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/ethernet/mellanox/mlx5/core/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3627,8 +3627,11 @@ static int mlx5e_setup_tc_mqprio(struct mlx5e_priv *priv,
/* MQPRIO is another toplevel qdisc that can't be attached
* simultaneously with the offloaded HTB.
*/
if (WARN_ON(mlx5e_selq_is_htb_enabled(&priv->selq)))
return -EINVAL;
if (mlx5e_selq_is_htb_enabled(&priv->selq)) {
NL_SET_ERR_MSG_MOD(mqprio->extack,
"MQPRIO cannot be configured when HTB offload is enabled.");
return -EOPNOTSUPP;
}

switch (mqprio->mode) {
case TC_MQPRIO_MODE_DCB:
Expand Down

0 comments on commit 090c0ba

Please sign in to comment.