From patchwork Thu Mar 25 05:04:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12162939 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63D4DC433E0 for ; Thu, 25 Mar 2021 05:05:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E94061A1E for ; Thu, 25 Mar 2021 05:05:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229782AbhCYFE5 (ORCPT ); Thu, 25 Mar 2021 01:04:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:47878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbhCYFEn (ORCPT ); Thu, 25 Mar 2021 01:04:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 669B761A1E; Thu, 25 Mar 2021 05:04:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616648682; bh=+oXYI8YfqBdWLv7Ez8Kvq2TXo91gb1fS5BSoR47LKwU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cG4yDoDAcyjKSCTGWCzIvjL/qvZR8iU3V0+KjxrhJKddorp5ADExm5aZ3sS64n8X1 gjThLnBmID4w1DSh872PFODwTib7kuD2LE0Vwcf3w6xSp/ZtwWdmNfBjnSsxH4koL/ 9a4FIKQCfu1sBlQAjtw7hNaJzK3hAl06/xkvx9haq+X6Xy/NDbhFVnaRRn1+7v6qRl RzxWc0qcXK4Ufn800jTmU/x52BxeEyyJLtLd1nIA+QYVXmvjVAF0twlMlyntRC0Jf5 I4l+JroKS4ywmdQnN3nat6D/qiu0AhM6gg/vaR3eudUasj+dztpo/87u15OpWhuqI6 xGNvClFqHof6g== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Tariq Toukan , Maxim Mikityanskiy , Saeed Mahameed Subject: [net-next 01/15] net/mlx5e: Enforce minimum value check for ICOSQ size Date: Wed, 24 Mar 2021 22:04:24 -0700 Message-Id: <20210325050438.261511-2-saeed@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210325050438.261511-1-saeed@kernel.org> References: <20210325050438.261511-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Tariq Toukan The ICOSQ size should not go below MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE. Enforce this where it's missing. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 5 +++-- 1 file changed, 3 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 9c08f0bd1fcc..bf966178d0e6 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -2368,8 +2368,9 @@ static u8 mlx5e_build_icosq_log_wq_sz(struct mlx5e_params *params, { switch (params->rq_wq_type) { case MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ: - return order_base_2(MLX5E_UMR_WQEBBS) + - mlx5e_get_rq_log_wq_sz(rqp->rqc); + return max_t(u8, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE, + order_base_2(MLX5E_UMR_WQEBBS) + + mlx5e_get_rq_log_wq_sz(rqp->rqc)); default: /* MLX5_WQ_TYPE_CYCLIC */ return MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE; }