DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Cc: Ivan Malov <ivan.malov@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH] net/sfc: fix TSO limits imposed to the number of Tx queues
Date: Thu, 19 Jan 2017 10:46:03 +0000	[thread overview]
Message-ID: <1484822763-13107-1-git-send-email-arybchenko@solarflare.com> (raw)

From: Ivan Malov <ivan.malov@oktetlabs.ru>

The number of Tx queues requested by the user must not be overridden;
instead, the limits imposed by TSO must be applied to the advertised
maximum

Fixes: fec33d5bb3eb ("net/sfc: support firmware-assisted TSO")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andrew Lee <alee@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@solarflare.com>
---
 drivers/net/sfc/sfc.c    | 26 +++++++++++++++++---------
 drivers/net/sfc/sfc_tx.c |  5 -----
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 648ad8c..d35754c 100644
--- a/drivers/net/sfc/sfc.c
+++ b/drivers/net/sfc/sfc.c
@@ -203,6 +203,13 @@
 	limits.edl_max_txq_count =
 		MIN(encp->enc_txq_limit,
 		    limits.edl_max_evq_count - 1 - limits.edl_max_rxq_count);
+
+	if (sa->tso)
+		limits.edl_max_txq_count =
+			MIN(limits.edl_max_txq_count,
+			    encp->enc_fw_assisted_tso_v2_n_contexts /
+			    encp->enc_hw_pf_count);
+
 	SFC_ASSERT(limits.edl_max_txq_count >= limits.edl_min_rxq_count);
 
 	/* Configure the minimum required resources needed for the
@@ -601,12 +608,21 @@
 	if (rc != 0)
 		goto fail_nic_reset;
 
+	encp = efx_nic_cfg_get(sa->nic);
+
+#ifdef RTE_LIBRTE_SFC_EFX_TSO
+	sa->tso = encp->enc_fw_assisted_tso_v2_enabled;
+	if (!sa->tso)
+		sfc_warn(sa, "TSO support isn't available on this adapter");
+#else /* !RTE_LIBRTE_SFC_EFX_TSO */
+	sa->tso = B_FALSE;
+#endif /* RTE_LIBRTE_SFC_EFX_TSO */
+
 	sfc_log_init(sa, "estimate resource limits");
 	rc = sfc_estimate_resource_limits(sa);
 	if (rc != 0)
 		goto fail_estimate_rsrc_limits;
 
-	encp = efx_nic_cfg_get(sa->nic);
 	sa->txq_max_entries = encp->enc_txq_max_ndescs;
 	SFC_ASSERT(rte_is_power_of_2(sa->txq_max_entries));
 
@@ -621,14 +637,6 @@
 	if (rc != 0)
 		goto fail_set_rss_defaults;
 
-#ifdef RTE_LIBRTE_SFC_EFX_TSO
-	sa->tso = efx_nic_cfg_get(sa->nic)->enc_fw_assisted_tso_v2_enabled;
-	if (!sa->tso)
-		sfc_warn(sa, "TSO support isn't available on this adapter");
-#else /* !RTE_LIBRTE_SFC_EFX_TSO */
-	sa->tso = B_FALSE;
-#endif /* RTE_LIBRTE_SFC_EFX_TSO */
-
 	sfc_log_init(sa, "fini nic");
 	efx_nic_fini(enp);
 
diff --git a/drivers/net/sfc/sfc_tx.c b/drivers/net/sfc/sfc_tx.c
index 3e64c0f..1292af3 100644
--- a/drivers/net/sfc/sfc_tx.c
+++ b/drivers/net/sfc/sfc_tx.c
@@ -312,11 +312,6 @@
 
 	sa->txq_count = sa->eth_dev->data->nb_tx_queues;
 
-	if (sa->tso)
-		sa->txq_count = MIN(sa->txq_count,
-		   efx_nic_cfg_get(sa->nic)->enc_fw_assisted_tso_v2_n_contexts /
-		   efx_nic_cfg_get(sa->nic)->enc_hw_pf_count);
-
 	sa->txq_info = rte_calloc_socket("sfc-txqs", sa->txq_count,
 					 sizeof(sa->txq_info[0]), 0,
 					 sa->socket_id);
-- 
1.8.2.3

             reply	other threads:[~2017-01-19 10:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19 10:46 Andrew Rybchenko [this message]
2017-01-23  9:57 ` Ferruh Yigit
2017-01-23 11:06 ` [dpdk-dev] [PATCH v2] " Andrew Rybchenko
2017-01-23 11:42   ` Ferruh Yigit

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=1484822763-13107-1-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ivan.malov@oktetlabs.ru \
    /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).