netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sathya Perla <sathya.perla@emulex.com>
To: <netdev@vger.kernel.org>
Subject: [PATCH net-next 12/12] be2net: query max_tx_qs for BE3 super-nic profile from FW
Date: Mon, 1 Sep 2014 11:54:24 +0530	[thread overview]
Message-ID: <1409552664-15990-13-git-send-email-sathya.perla@emulex.com> (raw)
In-Reply-To: <1409552664-15990-1-git-send-email-sathya.perla@emulex.com>

From: Suresh Reddy <Suresh.Reddy@emulex.com>

In the BE3 super-nic profile, the max_tx_qs value can vary for each function.
So the driver needs to query this value from FW instead of using the
pre-defined constant BE3_MAX_TX_QS.

Signed-off-by: Suresh Reddy <Suresh.Reddy@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index f3235d1..a30156b 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3324,10 +3324,19 @@ static void BEx_get_resources(struct be_adapter *adapter,
 	 */
 	if (BE2_chip(adapter) || use_sriov ||  (adapter->port_num > 1) ||
 	    !be_physfn(adapter) || (be_is_mc(adapter) &&
-	    !(adapter->function_caps & BE_FUNCTION_CAPS_RSS)))
+	    !(adapter->function_caps & BE_FUNCTION_CAPS_RSS))) {
 		res->max_tx_qs = 1;
-	else
+	} else if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) {
+		struct be_resources super_nic_res = {0};
+		/* On a SuperNIC profile, the driver needs to use the
+		 * GET_PROFILE_CONFIG cmd to query the per-function TXQ limits
+		 */
+		be_cmd_get_profile_config(adapter, &super_nic_res, 0);
+		/* Some old versions of BE3 FW don't report max_tx_qs value */
+		res->max_tx_qs = super_nic_res.max_tx_qs ? : BE3_MAX_TX_QS;
+	} else {
 		res->max_tx_qs = BE3_MAX_TX_QS;
+	}
 
 	if ((adapter->function_caps & BE_FUNCTION_CAPS_RSS) &&
 	    !use_sriov && be_physfn(adapter))
-- 
1.7.1

  parent reply	other threads:[~2014-09-01  6:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01  6:24 [PATCH net-next 00/12] be2net: patch set Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 01/12] be2net: add a few log messages Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 02/12] be2net: shorten AMAP_GET/SET_BITS() macro calls Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 03/12] be2net: add a description for counter rx_input_fifo_overflow_drop Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 04/12] be2net: Add TX completion error statistics in ethtool Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 05/12] be2net: Add a dma_mapping_error counter " Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 06/12] be2net: fix log messages in lancer FW download path Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 07/12] be2net: remove unncessary gotos Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 08/12] be2net: define BE_MAX_MTU Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 09/12] be2net: make be_cmd_get_regs() return a status Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 10/12] be2net: get rid of TX budget Sathya Perla
2014-09-01  6:24 ` [PATCH net-next 11/12] be2net: define macro for_all_tx_queues_on_eq() Sathya Perla
2014-09-01  6:24 ` Sathya Perla [this message]
2014-09-01 13:10   ` [PATCH net-next 12/12] be2net: query max_tx_qs for BE3 super-nic profile from FW Sergei Shtylyov
2014-09-02  4:08     ` Sathya Perla
2014-09-04 19:28       ` Jiri Pirko

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=1409552664-15990-13-git-send-email-sathya.perla@emulex.com \
    --to=sathya.perla@emulex.com \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).