All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Noa Osherovich <noaos@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>
Subject: [PATCH net 02/12] net/mlx5: Check FW limitations on log_max_qp before setting it
Date: Wed, 28 Dec 2016 14:58:32 +0200	[thread overview]
Message-ID: <1482929922-32626-3-git-send-email-saeedm@mellanox.com> (raw)
In-Reply-To: <1482929922-32626-1-git-send-email-saeedm@mellanox.com>

From: Noa Osherovich <noaos@mellanox.com>

When setting HCA capabilities, set log_max_qp to be the minimum
between the selected profile's value and the HCA limitation.

Fixes: 938fe83c8dcb ('net/mlx5_core: New device capabilities...')
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 54e5a78..23c12f1 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -503,6 +503,13 @@ static int handle_hca_cap(struct mlx5_core_dev *dev)
 	MLX5_SET(cmd_hca_cap, set_hca_cap, pkey_table_size,
 		 to_fw_pkey_sz(dev, 128));
 
+	/* Check log_max_qp from HCA caps to set in current profile */
+	if (MLX5_CAP_GEN_MAX(dev, log_max_qp) < profile[prof_sel].log_max_qp) {
+		mlx5_core_warn(dev, "log_max_qp value in current profile is %d, changing it to HCA capability limit (%d)\n",
+			       profile[prof_sel].log_max_qp,
+			       MLX5_CAP_GEN_MAX(dev, log_max_qp));
+		profile[prof_sel].log_max_qp = MLX5_CAP_GEN_MAX(dev, log_max_qp);
+	}
 	if (prof->mask & MLX5_PROF_MASK_QP_SIZE)
 		MLX5_SET(cmd_hca_cap, set_hca_cap, log_max_qp,
 			 prof->log_max_qp);
-- 
2.7.4

  parent reply	other threads:[~2016-12-28 12:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-28 12:58 [PATCH net 00/12] Mellanox 100G mlx5 fixes 28-12-2016 Saeed Mahameed
2016-12-28 12:58 ` [PATCH net 01/12] net/mlx5: Disable RoCE on the e-switch management port under switchdev mode Saeed Mahameed
2016-12-28 12:58 ` Saeed Mahameed [this message]
2016-12-28 12:58 ` [PATCH net 03/12] net/mlx5: Cancel recovery work in remove flow Saeed Mahameed
2016-12-28 12:58 ` [PATCH net 04/12] net/mlx5: Avoid shadowing numa_node Saeed Mahameed
2016-12-28 12:58 ` [PATCH net 05/12] net/mlx5: Mask destination mac value in ethtool steering rules Saeed Mahameed
2016-12-28 12:58 ` [PATCH net 06/12] net/mlx5: Release FTE lock in error flow Saeed Mahameed
2016-12-28 12:58 ` [PATCH net 07/12] net/mlx5: Prevent setting multicast macs for VFs Saeed Mahameed
2016-12-28 12:58 ` [PATCH net 08/12] Revert "net/mlx5e: Expose PCIe statistics to ethtool" Saeed Mahameed
2016-12-28 12:58 ` [PATCH net 09/12] Revert "net/mlx5: Add MPCNT register infrastructure" Saeed Mahameed
2016-12-28 12:58 ` [PATCH net 10/12] net/mlx5e: Check ets capability before initializing ets settings Saeed Mahameed
2016-12-28 12:58 ` [PATCH net 11/12] net/mlx5e: Don't sync netdev state when not registered Saeed Mahameed
2016-12-28 12:58 ` [PATCH net 12/12] net/mlx5e: Disable netdev after close Saeed Mahameed
2016-12-28 19:38 ` [PATCH net 00/12] Mellanox 100G mlx5 fixes 28-12-2016 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=1482929922-32626-3-git-send-email-saeedm@mellanox.com \
    --to=saeedm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=noaos@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.