From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18AB923236D; Mon, 2 Jun 2025 14:19:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748873942; cv=none; b=Xnl7PAdR7YcsqkIFv2ddbZmY6pqPjWuKDugoctQPGHtVjlUKeGohE9R1WIcrL/0kHNSge6gMpJFib5uz9znVZVAXpDEKCxqoD8RXbYwvfSc5HJOnrTZZsqIpzrPpsgUq8qA95rgSD+WzwMyxDdsURF7/yM6IH3Bn5IlBKa4dp7I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748873942; c=relaxed/simple; bh=MlK5s+6xIjbxuohX8OmbwyFSjzqODQ8oQvASlX/9Ps4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O8hdLM9k2WJcjVES5otqHilHVf0Y7cZqYqHNEIOLLSBtNHhEXy1Mk0SzGADbiuKHBctURj+au41FqX1XgpXqnS8jyfMEB1kg6Qhxia+Vw6OPx32BoACG2y/00MCE4n6uSJ0CpdBt+ju+cHkIXkIQt9XlHz1GX/mkiin4EIAlsnQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=15DvqWBJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="15DvqWBJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7AADCC4CEEB; Mon, 2 Jun 2025 14:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748873942; bh=MlK5s+6xIjbxuohX8OmbwyFSjzqODQ8oQvASlX/9Ps4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=15DvqWBJNrfQKUmqM+usSMAerFHln2pMIgDrfifH8mm9KgdWyfmB+WiRt7hho3FLe s49QRx26DwlDR/Okm6DHwyP+/EYTBw0/zpUhBxiIZY0q7alcMUzn1mSM+rmxpNaFXk sUeyrM+APIC/K0cYpvdwZLN9zU4UbevJ5b4+GUQE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Carolina Jubran , Yael Chemla , Cosmin Ratiu , Tariq Toukan , Kalesh AP , Paolo Abeni , Sasha Levin Subject: [PATCH 6.6 274/444] net/mlx5e: Avoid WARN_ON when configuring MQPRIO with HTB offload enabled Date: Mon, 2 Jun 2025 15:45:38 +0200 Message-ID: <20250602134352.081259329@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250602134340.906731340@linuxfoundation.org> References: <20250602134340.906731340@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Carolina Jubran [ Upstream commit 689805dcc474c2accb5cffbbcea1c06ee4a54570 ] 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 Reviewed-by: Yael Chemla Reviewed-by: Cosmin Ratiu Signed-off-by: Tariq Toukan Reviewed-by: Kalesh AP Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index d9dc7280302eb..5c6f01abdcb91 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -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: -- 2.39.5