From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 756ADC6FD20 for ; Tue, 21 Mar 2023 21:11:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230157AbjCUVLq (ORCPT ); Tue, 21 Mar 2023 17:11:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbjCUVLn (ORCPT ); Tue, 21 Mar 2023 17:11:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BC13580CA for ; Tue, 21 Mar 2023 14:11:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B75A261E67 for ; Tue, 21 Mar 2023 21:11:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F5CCC433A8; Tue, 21 Mar 2023 21:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679433101; bh=rXzO4vylVY3czvHRnLMeGVFWLV0kNkXJphhLQF9bjDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PV0o2H0SA7Qrye8P3RJSZhmnnMExcWh9Xr/FBu+znnPkAXO4v4apv4FyVCfdTt0eS LvIWDj5MJBFCFWZIzHg8UytP8AatYEaln038sqk9lLytGnqHlOmVeG7Fbo+JF8XKs0 1N/1zjUOqLolKYQ+/o+HpgX2ZPp/9Tct4Io2AzVD1NSd3GcZ0rWkL63n7df3mm0AyJ exWSCekYjo/buoziyYlhegDwUHhXdT/IIfa+phO3mrddJYRTyF86ff11OfPEhsjYyQ lU0UiijQtZ4KWwqTe1zPBk9YJ35FGMS/LDtkprGf3Ln0qXLIRzgh4A8ieEn5K3wKfs VH+xjnHpZSAJw== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Maher Sanalla , Moshe Shemesh Subject: [net 6/7] net/mlx5: Read the TC mapping of all priorities on ETS query Date: Tue, 21 Mar 2023 14:11:34 -0700 Message-Id: <20230321211135.47711-7-saeed@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230321211135.47711-1-saeed@kernel.org> References: <20230321211135.47711-1-saeed@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Maher Sanalla When ETS configurations are queried by the user to get the mapping assignment between packet priority and traffic class, only priorities up to maximum TCs are queried from QTCT register in FW to retrieve their assigned TC, leaving the rest of the priorities mapped to the default TC #0 which might be misleading. Fix by querying the TC mapping of all priorities on each ETS query, regardless of the maximum number of TCs configured in FW. Fixes: 820c2c5e773d ("net/mlx5e: Read ETS settings directly from firmware") Signed-off-by: Maher Sanalla Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c index 2449731b7d79..89de92d06483 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c @@ -117,12 +117,14 @@ static int mlx5e_dcbnl_ieee_getets(struct net_device *netdev, if (!MLX5_CAP_GEN(priv->mdev, ets)) return -EOPNOTSUPP; - ets->ets_cap = mlx5_max_tc(priv->mdev) + 1; - for (i = 0; i < ets->ets_cap; i++) { + for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) { err = mlx5_query_port_prio_tc(mdev, i, &ets->prio_tc[i]); if (err) return err; + } + ets->ets_cap = mlx5_max_tc(priv->mdev) + 1; + for (i = 0; i < ets->ets_cap; i++) { err = mlx5_query_port_tc_group(mdev, i, &tc_group[i]); if (err) return err; -- 2.39.2