patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 01/12] net/bnxt: fix burst mode get for Arm
       [not found] <20200909155302.28656-1-lance.richardson@broadcom.com>
@ 2020-09-09 15:52 ` Lance Richardson
  2020-09-09 15:52 ` [dpdk-stable] [PATCH 02/12] net/bnxt: fix rxq/txq get information Lance Richardson
  1 sibling, 0 replies; 5+ messages in thread
From: Lance Richardson @ 2020-09-09 15:52 UTC (permalink / raw)
  To: Ajit Khaparde, Somnath Kotur, Ruifeng Wang; +Cc: dev, stable

Transmit and receive burst mode get operations incorrectly return
"Vector SSE" on ARM64 platforms, change to return "Vector Neon"
instead.

Fixes: 3983583414 ("net/bnxt: support NEON")
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Cc: stable@dpdk.org
---
 drivers/net/bnxt/bnxt_ethdev.c | 60 +++++++++++++++++++++-------------
 1 file changed, 38 insertions(+), 22 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 75d055be00..7a77922c0c 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2615,46 +2615,62 @@ bnxt_txq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
 }
 
+static const struct {
+	eth_rx_burst_t pkt_burst;
+	const char *info;
+} bnxt_rx_burst_info[] = {
+	{bnxt_recv_pkts,	"Scalar"},
+#if defined(RTE_ARCH_X86)
+	{bnxt_recv_pkts_vec,	"Vector SSE"},
+#elif defined(RTE_ARCH_ARM64)
+	{bnxt_recv_pkts_vec,	"Vector Neon"},
+#endif
+};
+
 static int
 bnxt_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
 		       struct rte_eth_burst_mode *mode)
 {
 	eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;
+	size_t i;
 
-	if (pkt_burst == bnxt_recv_pkts) {
-		snprintf(mode->info, sizeof(mode->info), "%s",
-			 "Scalar");
-		return 0;
-	}
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
-	if (pkt_burst == bnxt_recv_pkts_vec) {
-		snprintf(mode->info, sizeof(mode->info), "%s",
-			 "Vector SSE");
-		return 0;
+	for (i = 0; i < RTE_DIM(bnxt_rx_burst_info); i++) {
+		if (pkt_burst == bnxt_rx_burst_info[i].pkt_burst) {
+			snprintf(mode->info, sizeof(mode->info), "%s",
+				 bnxt_rx_burst_info[i].info);
+			return 0;
+		}
 	}
-#endif
 
 	return -EINVAL;
 }
 
+static const struct {
+	eth_tx_burst_t pkt_burst;
+	const char *info;
+} bnxt_tx_burst_info[] = {
+	{bnxt_xmit_pkts,	"Scalar"},
+#if defined(RTE_ARCH_X86)
+	{bnxt_xmit_pkts_vec,	"Vector SSE"},
+#elif defined(RTE_ARCH_ARM64)
+	{bnxt_xmit_pkts_vec,	"Vector Neon"},
+#endif
+};
+
 static int
 bnxt_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
 		       struct rte_eth_burst_mode *mode)
 {
 	eth_tx_burst_t pkt_burst = dev->tx_pkt_burst;
+	size_t i;
 
-	if (pkt_burst == bnxt_xmit_pkts) {
-		snprintf(mode->info, sizeof(mode->info), "%s",
-			 "Scalar");
-		return 0;
-	}
-#if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64)
-	if (pkt_burst == bnxt_xmit_pkts_vec) {
-		snprintf(mode->info, sizeof(mode->info), "%s",
-			 "Vector SSE");
-		return 0;
+	for (i = 0; i < RTE_DIM(bnxt_tx_burst_info); i++) {
+		if (pkt_burst == bnxt_tx_burst_info[i].pkt_burst) {
+			snprintf(mode->info, sizeof(mode->info), "%s",
+				 bnxt_tx_burst_info[i].info);
+			return 0;
+		}
 	}
-#endif
 
 	return -EINVAL;
 }
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-stable] [PATCH 02/12] net/bnxt: fix rxq/txq get information
       [not found] <20200909155302.28656-1-lance.richardson@broadcom.com>
  2020-09-09 15:52 ` [dpdk-stable] [PATCH 01/12] net/bnxt: fix burst mode get for Arm Lance Richardson
@ 2020-09-09 15:52 ` Lance Richardson
  2020-09-11 14:41   ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
  1 sibling, 1 reply; 5+ messages in thread
From: Lance Richardson @ 2020-09-09 15:52 UTC (permalink / raw)
  To: Ajit Khaparde, Somnath Kotur; +Cc: dev, stable

Return correct values for Rx/Tx offloads and for rx_drop_en.

Fixes: 2fc201884be8 ("net/bnxt: support rxq/txq get information")
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Cc: stable@dpdk.org
---
 drivers/net/bnxt/bnxt_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 7a77922c0c..5585f872d0 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2588,8 +2588,9 @@ bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->nb_desc = rxq->nb_rx_desc;
 
 	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
-	qinfo->conf.rx_drop_en = 0;
+	qinfo->conf.rx_drop_en = 1;
 	qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
+	qinfo->conf.offloads = dev->data->dev_conf.rxmode.offloads;
 }
 
 static void
@@ -2613,6 +2614,7 @@ bnxt_txq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.tx_free_thresh = txq->tx_free_thresh;
 	qinfo->conf.tx_rs_thresh = 0;
 	qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
+	qinfo->conf.offloads = dev->data->dev_conf.txmode.offloads;
 }
 
 static const struct {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH 02/12] net/bnxt: fix rxq/txq get information
  2020-09-09 15:52 ` [dpdk-stable] [PATCH 02/12] net/bnxt: fix rxq/txq get information Lance Richardson
@ 2020-09-11 14:41   ` Ferruh Yigit
  2020-09-18 18:41     ` Lance Richardson
  0 siblings, 1 reply; 5+ messages in thread
From: Ferruh Yigit @ 2020-09-11 14:41 UTC (permalink / raw)
  To: Lance Richardson, Ajit Khaparde, Somnath Kotur; +Cc: dev, stable

On 9/9/2020 4:52 PM, Lance Richardson wrote:
> Return correct values for Rx/Tx offloads and for rx_drop_en.
> 
> Fixes: 2fc201884be8 ("net/bnxt: support rxq/txq get information")
> Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
> Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
> Cc: stable@dpdk.org
> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index 7a77922c0c..5585f872d0 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -2588,8 +2588,9 @@ bnxt_rxq_info_get_op(struct rte_eth_dev *dev, uint16_t queue_id,
>  	qinfo->nb_desc = rxq->nb_rx_desc;
>  
>  	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
> -	qinfo->conf.rx_drop_en = 0;
> +	qinfo->conf.rx_drop_en = 1;

Why 0 is wrong but 1 is correct?

Technically 'rx_drop_en' is a user configuration, which is set via
'rte_eth_rx_queue_setup()' API.

bnxt seems not honoring this config option at all.

Based on HW capability, I think two things can be done,
1) Configure the HW based on config request, and return configured value in
'bnxt_rxq_info_get_op()'. see 'ixgbe'.

2) If HW is not configurable, check the value in 'rte_eth_rx_queue_setup()'
a) return error if unsupported value requested. see 'sfc'.
b) log a warning and overwrite the requested config with whatever supported.
And for both a & b, return current config in the 'bnxt_rxq_info_get_op()'

>  	qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
> +	qinfo->conf.offloads = dev->data->dev_conf.rxmode.offloads;

This is for queue specific offloads, you are returning port offloads.
As far as I can see bnxt doesn't have any queue specific offload, so this can be
dropped.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH 02/12] net/bnxt: fix rxq/txq get information
  2020-09-11 14:41   ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
@ 2020-09-18 18:41     ` Lance Richardson
  2020-09-21 11:05       ` Ferruh Yigit
  0 siblings, 1 reply; 5+ messages in thread
From: Lance Richardson @ 2020-09-18 18:41 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Ajit Khaparde, Somnath Kotur, dev, stable

On Fri, Sep 11, 2020 at 10:41 AM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> > -     qinfo->conf.rx_drop_en = 0;
> > +     qinfo->conf.rx_drop_en = 1;
>
> Why 0 is wrong but 1 is correct?
>
> Technically 'rx_drop_en' is a user configuration, which is set via
> 'rte_eth_rx_queue_setup()' API.
>
> bnxt seems not honoring this config option at all.
>
> Based on HW capability, I think two things can be done,
> 1) Configure the HW based on config request, and return configured value in
> 'bnxt_rxq_info_get_op()'. see 'ixgbe'.
>
> 2) If HW is not configurable, check the value in 'rte_eth_rx_queue_setup()'
> a) return error if unsupported value requested. see 'sfc'.
> b) log a warning and overwrite the requested config with whatever supported.
> And for both a & b, return current config in the 'bnxt_rxq_info_get_op()'
>
> >       qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
> > +     qinfo->conf.offloads = dev->data->dev_conf.rxmode.offloads;
>
Hi Ferruh,

Apologies, this somehow didn't make it to my inbox.

I believe case (2) applies here, rx_drop_en is not currently configurable in hw,
so this change was intended to accurately report the effective value. I'm not
sure whether (2a) or (2b) would be better, but (2b) seems less likely to cause
issues for existing applications.

>
> This is for queue specific offloads, you are returning port offloads.
> As far as I can see bnxt doesn't have any queue specific offload, so this can be
> dropped.

It wasn't clear to me whether this was intended to report the difference between
the offload configuration for the queue and the offload configuration
for the port
or the effective offload configuration for the queue. I noticed that
several other
PMDs (e.g. mlx5, netvsc, sfc) report the offload configuration for the port in
rx/tx_queue_info_get(). The sfc PMD reports the offload configuration for the
port combined with queue-specific offloads, based on those examples this
seemed to be correct. I guess you're saying those are also incorrect?

Thanks,
   Lance

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH 02/12] net/bnxt: fix rxq/txq get information
  2020-09-18 18:41     ` Lance Richardson
@ 2020-09-21 11:05       ` Ferruh Yigit
  0 siblings, 0 replies; 5+ messages in thread
From: Ferruh Yigit @ 2020-09-21 11:05 UTC (permalink / raw)
  To: Lance Richardson; +Cc: Ajit Khaparde, Somnath Kotur, dev, stable

On 9/18/2020 7:41 PM, Lance Richardson wrote:
> On Fri, Sep 11, 2020 at 10:41 AM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>>> -     qinfo->conf.rx_drop_en = 0;
>>> +     qinfo->conf.rx_drop_en = 1;
>>
>> Why 0 is wrong but 1 is correct?
>>
>> Technically 'rx_drop_en' is a user configuration, which is set via
>> 'rte_eth_rx_queue_setup()' API.
>>
>> bnxt seems not honoring this config option at all.
>>
>> Based on HW capability, I think two things can be done,
>> 1) Configure the HW based on config request, and return configured value in
>> 'bnxt_rxq_info_get_op()'. see 'ixgbe'.
>>
>> 2) If HW is not configurable, check the value in 'rte_eth_rx_queue_setup()'
>> a) return error if unsupported value requested. see 'sfc'.
>> b) log a warning and overwrite the requested config with whatever supported.
>> And for both a & b, return current config in the 'bnxt_rxq_info_get_op()'
>>
>>>        qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
>>> +     qinfo->conf.offloads = dev->data->dev_conf.rxmode.offloads;
>>
> Hi Ferruh,
> 
> Apologies, this somehow didn't make it to my inbox.
> 
> I believe case (2) applies here, rx_drop_en is not currently configurable in hw,
> so this change was intended to accurately report the effective value. I'm not
> sure whether (2a) or (2b) would be better, but (2b) seems less likely to cause
> issues for existing applications.
 >

I guess (2a) may cause more issues with existing applications, 
applications previously running without problem may now start failing if 
PMD starts returning error.

In (2b) execution will be same, and if PMD already doesn't support NOT 
dropping, functionality will be same, only configuration will reflect 
what is actually happening instead of what user thinks happening.

> 
>>
>> This is for queue specific offloads, you are returning port offloads.
>> As far as I can see bnxt doesn't have any queue specific offload, so this can be
>> dropped.
> 
> It wasn't clear to me whether this was intended to report the difference between
> the offload configuration for the queue and the offload configuration
> for the port
> or the effective offload configuration for the queue. I noticed that
> several other
> PMDs (e.g. mlx5, netvsc, sfc) report the offload configuration for the port in
> rx/tx_queue_info_get(). The sfc PMD reports the offload configuration for the
> port combined with queue-specific offloads, based on those examples this
> seemed to be correct. I guess you're saying those are also incorrect?
> 

May bad, they look OK, "the effective offload configuration for the 
queue" makes more sense here.
I guess I confused same fields should hold the queue specific offloads 
when used for 'rte_eth_rx_queue_setup()'

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-21 11:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200909155302.28656-1-lance.richardson@broadcom.com>
2020-09-09 15:52 ` [dpdk-stable] [PATCH 01/12] net/bnxt: fix burst mode get for Arm Lance Richardson
2020-09-09 15:52 ` [dpdk-stable] [PATCH 02/12] net/bnxt: fix rxq/txq get information Lance Richardson
2020-09-11 14:41   ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
2020-09-18 18:41     ` Lance Richardson
2020-09-21 11:05       ` 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).