public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel•org>
To: "David S. Miller" <davem@davemloft•net>,
	Jakub Kicinski <kuba@kernel•org>
Cc: netdev@vger•kernel.org, Tariq Toukan <tariqt@nvidia•com>,
	Maxim Mikityanskiy <maximmi@mellanox•com>,
	Saeed Mahameed <saeedm@nvidia•com>
Subject: [net-next 01/15] net/mlx5e: Enforce minimum value check for ICOSQ size
Date: Wed, 24 Mar 2021 22:04:24 -0700	[thread overview]
Message-ID: <20210325050438.261511-2-saeed@kernel.org> (raw)
In-Reply-To: <20210325050438.261511-1-saeed@kernel.org>

From: Tariq Toukan <tariqt@nvidia•com>

The ICOSQ size should not go below MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE.
Enforce this where it's missing.

Signed-off-by: Tariq Toukan <tariqt@nvidia•com>
Reviewed-by: Maxim Mikityanskiy <maximmi@mellanox•com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia•com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia•com>
---
 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;
 	}
-- 
2.30.2


  reply	other threads:[~2021-03-25  5:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25  5:04 [pull request][net-next 00/15] mlx5 updates 2021-03-24 Saeed Mahameed
2021-03-25  5:04 ` Saeed Mahameed [this message]
2021-03-25  5:04 ` [net-next 02/15] net/mlx5: DR, Fix potential shift wrapping of 32-bit value in STEv1 getter Saeed Mahameed
2021-03-25  5:04 ` [net-next 03/15] net/mlx5e: alloc the correct size for indirection_rqt Saeed Mahameed
2021-03-25  5:04 ` [net-next 04/15] net/mlx5e: Pass q_counter indentifier as parameter to rq_param builders Saeed Mahameed
2021-03-25  5:04 ` [net-next 05/15] net/mlx5e: Move params logic into its dedicated file Saeed Mahameed
2021-03-25 23:44   ` David Miller
2021-03-25  5:04 ` [net-next 06/15] net/mlx5e: Restrict usage of mlx5e_priv in params logic functions Saeed Mahameed
2021-03-25  5:04 ` [net-next 07/15] net/mlx5e: Allow creating mpwqe info without channel Saeed Mahameed
2021-03-25  5:04 ` [net-next 08/15] net/mlx5: Add helper to set time-stamp translator on a queue Saeed Mahameed
2021-03-25  5:04 ` [net-next 09/15] net/mlx5e: Generalize open RQ Saeed Mahameed
2021-03-25  5:04 ` [net-next 10/15] net/mlx5e: Generalize RQ activation Saeed Mahameed
2021-03-25  5:04 ` [net-next 11/15] net/mlx5e: Generalize close RQ Saeed Mahameed
2021-03-25  5:04 ` [net-next 12/15] net/mlx5e: Generalize direct-TIRs and direct-RQTs API Saeed Mahameed
2021-03-25  5:04 ` [net-next 13/15] net/mlx5e: Generalize PTP implementation Saeed Mahameed
2021-03-25  5:04 ` [net-next 14/15] net/mlx5e: Cleanup PTP Saeed Mahameed
2021-03-25  5:04 ` [net-next 15/15] net/mlx5: Fix spelling mistakes in mlx5_core_info message Saeed Mahameed
2021-03-25 23:43 ` [pull request][net-next 00/15] mlx5 updates 2021-03-24 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210325050438.261511-2-saeed@kernel.org \
    --to=saeed@kernel$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=kuba@kernel$(echo .)org \
    --cc=maximmi@mellanox$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=saeedm@nvidia$(echo .)com \
    --cc=tariqt@nvidia$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox