* [dpdk-dev] [PATCH] net/sfc: fix TSO limits imposed to the number of Tx queues
@ 2017-01-19 10:46 Andrew Rybchenko
2017-01-23 9:57 ` Ferruh Yigit
2017-01-23 11:06 ` [dpdk-dev] [PATCH v2] " Andrew Rybchenko
0 siblings, 2 replies; 4+ messages in thread
From: Andrew Rybchenko @ 2017-01-19 10:46 UTC (permalink / raw)
To: dev; +Cc: Ivan Malov
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/sfc: fix TSO limits imposed to the number of Tx queues
2017-01-19 10:46 [dpdk-dev] [PATCH] net/sfc: fix TSO limits imposed to the number of Tx queues Andrew Rybchenko
@ 2017-01-23 9:57 ` Ferruh Yigit
2017-01-23 11:06 ` [dpdk-dev] [PATCH v2] " Andrew Rybchenko
1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2017-01-23 9:57 UTC (permalink / raw)
To: Andrew Rybchenko, dev; +Cc: Ivan Malov
On 1/19/2017 10:46 AM, Andrew Rybchenko wrote:
> 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>
Can you please rebase this patch on top of latest next-net, since
another tso patch [1] applied first.
[1]
http://dpdk.org/dev/patchwork/patch/19842/
Thanks,
ferruh
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH v2] net/sfc: fix TSO limits imposed to the number of Tx queues
2017-01-19 10:46 [dpdk-dev] [PATCH] net/sfc: fix TSO limits imposed to the number of Tx queues Andrew Rybchenko
2017-01-23 9:57 ` Ferruh Yigit
@ 2017-01-23 11:06 ` Andrew Rybchenko
2017-01-23 11:42 ` Ferruh Yigit
1 sibling, 1 reply; 4+ messages in thread
From: Andrew Rybchenko @ 2017-01-23 11:06 UTC (permalink / raw)
To: dev; +Cc: Ferruh Yigit, Ivan Malov
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>
---
v2:
* rebase becase of net/sfc: enable TSO by default
drivers/net/sfc/sfc.c | 18 +++++++++++++-----
drivers/net/sfc/sfc_tx.c | 5 -----
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/net/sfc/sfc.c b/drivers/net/sfc/sfc.c
index 457a53e..03ecec2 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,17 @@
if (rc != 0)
goto fail_nic_reset;
+ encp = efx_nic_cfg_get(sa->nic);
+
+ sa->tso = encp->enc_fw_assisted_tso_v2_enabled;
+ if (!sa->tso)
+ sfc_warn(sa, "TSO support isn't available on this adapter");
+
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,10 +633,6 @@
if (rc != 0)
goto fail_set_rss_defaults;
- 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");
-
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 e772584..5a6282c 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/sfc: fix TSO limits imposed to the number of Tx queues
2017-01-23 11:06 ` [dpdk-dev] [PATCH v2] " Andrew Rybchenko
@ 2017-01-23 11:42 ` Ferruh Yigit
0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2017-01-23 11:42 UTC (permalink / raw)
To: Andrew Rybchenko, dev; +Cc: Ivan Malov
On 1/23/2017 11:06 AM, Andrew Rybchenko wrote:
> 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>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-23 11:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-19 10:46 [dpdk-dev] [PATCH] net/sfc: fix TSO limits imposed to the number of Tx queues Andrew Rybchenko
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
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).