DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/vmxnet3: fix RSS setting on v4
@ 2019-08-21 16:37 Eduard Serra Miralles
  2019-09-13 18:44 ` Yong Wang
  2020-03-03 20:44 ` [dpdk-dev] [PATCH v2] " Eduard Serra Miralles
  0 siblings, 2 replies; 8+ messages in thread
From: Eduard Serra Miralles @ 2019-08-21 16:37 UTC (permalink / raw)
  To: Yong Wang; +Cc: dev

When calling to setup RSS on v4 API, ESX will expect
IPv4/6 TCP RSS to be set/requested mandatorily.

This patch will:
- Set IPv4/6 TCP RSS when these have not been set. A warning
message is thrown to make sure we warn the application we are
setting IPv4/6 TCP RSS when not set.
- An additional check has been added to dodge RSS configuration
altogether unless MQ_RSS has been requested, similar to v3.

The alternative (returning error) was considered, the intent
is to ease the task of setting up and running vmxnet3 in situations
where it's supposted to be most strightforward (testpmd, pktgen).

Signed-off-by: Eduard Serra <eserra@vmware.com>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.h | 4 ++++
 drivers/net/vmxnet3/vmxnet3_rxtx.c   | 8 ++++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 57feb37..0a7047e 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -769,7 +769,8 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 		PMD_INIT_LOG(DEBUG, "Failed to setup memory region\n");
 	}
 
-	if (VMXNET3_VERSION_GE_4(hw)) {
+	if (VMXNET3_VERSION_GE_4(hw) &&
+	    dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
 		/* Check for additional RSS  */
 		ret = vmxnet3_v4_rss_configure(dev);
 		if (ret != VMXNET3_SUCCESS) {
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index 8c2b6f8..6e3ce7d 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -38,6 +38,10 @@
 	ETH_RSS_NONFRAG_IPV4_UDP | \
 	ETH_RSS_NONFRAG_IPV6_UDP)
 
+#define VMXNET3_MANDATORY_V4_RSS ( \
+	ETH_RSS_NONFRAG_IPV4_TCP | \
+	ETH_RSS_NONFRAG_IPV6_TCP)
+
 /* RSS configuration structure - shared with device through GPA */
 typedef struct VMXNET3_RSSConf {
 	uint16_t   hashType;
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 7794d74..dd99684 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -1311,6 +1311,14 @@ vmxnet3_v4_rss_configure(struct rte_eth_dev *dev)
 
 	cmdInfo->setRSSFields = 0;
 	port_rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
+
+	if ((port_rss_conf->rss_hf & VMXNET3_MANDATORY_V4_RSS) !=
+	    VMXNET3_MANDATORY_V4_RSS) {
+		PMD_INIT_LOG(WARNING, "RSS: IPv4/6 TCP is required for vmxnet3 v4 RSS,"
+			     "automatically setting it");
+		port_rss_conf->rss_hf |= VMXNET3_MANDATORY_V4_RSS;
+	}
+
 	rss_hf = port_rss_conf->rss_hf &
 		(VMXNET3_V4_RSS_MASK | VMXNET3_RSS_OFFLOAD_ALL);
 
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH] net/vmxnet3: fix RSS setting on v4
  2019-08-21 16:37 [dpdk-dev] [PATCH] net/vmxnet3: fix RSS setting on v4 Eduard Serra Miralles
@ 2019-09-13 18:44 ` Yong Wang
  2019-09-13 20:10   ` Eduard Serra Miralles
  2020-03-03 20:44 ` [dpdk-dev] [PATCH v2] " Eduard Serra Miralles
  1 sibling, 1 reply; 8+ messages in thread
From: Yong Wang @ 2019-09-13 18:44 UTC (permalink / raw)
  To: Eduard Serra Miralles; +Cc: dev

-----Original Message-----
From: Eduard Serra Miralles <eserra@vmware.com>
Date: Wednesday, August 21, 2019 at 9:37 AM
To: Yong Wang <yongwang@vmware.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: [PATCH] net/vmxnet3: fix RSS setting on v4

    When calling to setup RSS on v4 API, ESX will expect
    IPv4/6 TCP RSS to be set/requested mandatorily.
    
    This patch will:
    - Set IPv4/6 TCP RSS when these have not been set. A warning
    message is thrown to make sure we warn the application we are
    setting IPv4/6 TCP RSS when not set.

Why we are enforcing TCP RSS?  I would think it's up to the user to decide what to request based on their specific needs and we should support RSS even when it does not request TCP RSS.

    - An additional check has been added to dodge RSS configuration
    altogether unless MQ_RSS has been requested, similar to v3.
    
    The alternative (returning error) was considered, the intent
    is to ease the task of setting up and running vmxnet3 in situations
    where it's supposted to be most strightforward (testpmd, pktgen).
    
    Signed-off-by: Eduard Serra <eserra@vmware.com>
    ---
     drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++-
     drivers/net/vmxnet3/vmxnet3_ethdev.h | 4 ++++
     drivers/net/vmxnet3/vmxnet3_rxtx.c   | 8 ++++++++
     3 files changed, 14 insertions(+), 1 deletion(-)
    
    diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
    index 57feb37..0a7047e 100644
    --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
    +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
    @@ -769,7 +769,8 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
     		PMD_INIT_LOG(DEBUG, "Failed to setup memory region\n");
     	}
     
    -	if (VMXNET3_VERSION_GE_4(hw)) {
    +	if (VMXNET3_VERSION_GE_4(hw) &&
    +	    dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
     		/* Check for additional RSS  */
     		ret = vmxnet3_v4_rss_configure(dev);
     		if (ret != VMXNET3_SUCCESS) {
    diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
    index 8c2b6f8..6e3ce7d 100644
    --- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
    +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
    @@ -38,6 +38,10 @@
     	ETH_RSS_NONFRAG_IPV4_UDP | \
     	ETH_RSS_NONFRAG_IPV6_UDP)
     
    +#define VMXNET3_MANDATORY_V4_RSS ( \
    +	ETH_RSS_NONFRAG_IPV4_TCP | \
    +	ETH_RSS_NONFRAG_IPV6_TCP)
    +
     /* RSS configuration structure - shared with device through GPA */
     typedef struct VMXNET3_RSSConf {
     	uint16_t   hashType;
    diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
    index 7794d74..dd99684 100644
    --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
    +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
    @@ -1311,6 +1311,14 @@ vmxnet3_v4_rss_configure(struct rte_eth_dev *dev)
     
     	cmdInfo->setRSSFields = 0;
     	port_rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
    +
    +	if ((port_rss_conf->rss_hf & VMXNET3_MANDATORY_V4_RSS) !=
    +	    VMXNET3_MANDATORY_V4_RSS) {
    +		PMD_INIT_LOG(WARNING, "RSS: IPv4/6 TCP is required for vmxnet3 v4 RSS,"
    +			     "automatically setting it");
    +		port_rss_conf->rss_hf |= VMXNET3_MANDATORY_V4_RSS;
    +	}
    +
     	rss_hf = port_rss_conf->rss_hf &
     		(VMXNET3_V4_RSS_MASK | VMXNET3_RSS_OFFLOAD_ALL);
     
    -- 
    2.7.4
    
    


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

* Re: [dpdk-dev] [PATCH] net/vmxnet3: fix RSS setting on v4
  2019-09-13 18:44 ` Yong Wang
@ 2019-09-13 20:10   ` Eduard Serra Miralles
  2019-09-16 19:01     ` Yong Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Eduard Serra Miralles @ 2019-09-13 20:10 UTC (permalink / raw)
  To: Yong Wang; +Cc: dev

I think so too. Apparently however, ESX is mandatorily expecting that underneath. If not set, config will fail.





________________________________
From: Yong Wang <yongwang@vmware.com>
Sent: Friday, September 13, 2019 11:44:38 AM
To: Eduard Serra Miralles <eserra@vmware.com>
Cc: dev@dpdk.org <dev@dpdk.org>
Subject: Re: [PATCH] net/vmxnet3: fix RSS setting on v4

-----Original Message-----
From: Eduard Serra Miralles <eserra@vmware.com>
Date: Wednesday, August 21, 2019 at 9:37 AM
To: Yong Wang <yongwang@vmware.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: [PATCH] net/vmxnet3: fix RSS setting on v4

    When calling to setup RSS on v4 API, ESX will expect
    IPv4/6 TCP RSS to be set/requested mandatorily.

    This patch will:
    - Set IPv4/6 TCP RSS when these have not been set. A warning
    message is thrown to make sure we warn the application we are
    setting IPv4/6 TCP RSS when not set.

Why we are enforcing TCP RSS?  I would think it's up to the user to decide what to request based on their specific needs and we should support RSS even when it does not request TCP RSS.

    - An additional check has been added to dodge RSS configuration
    altogether unless MQ_RSS has been requested, similar to v3.

    The alternative (returning error) was considered, the intent
    is to ease the task of setting up and running vmxnet3 in situations
    where it's supposted to be most strightforward (testpmd, pktgen).

    Signed-off-by: Eduard Serra <eserra@vmware.com>
    ---
     drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++-
     drivers/net/vmxnet3/vmxnet3_ethdev.h | 4 ++++
     drivers/net/vmxnet3/vmxnet3_rxtx.c   | 8 ++++++++
     3 files changed, 14 insertions(+), 1 deletion(-)

    diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
    index 57feb37..0a7047e 100644
    --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
    +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
    @@ -769,7 +769,8 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
                 PMD_INIT_LOG(DEBUG, "Failed to setup memory region\n");
         }

    -   if (VMXNET3_VERSION_GE_4(hw)) {
    +   if (VMXNET3_VERSION_GE_4(hw) &&
    +       dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
                 /* Check for additional RSS  */
                 ret = vmxnet3_v4_rss_configure(dev);
                 if (ret != VMXNET3_SUCCESS) {
    diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
    index 8c2b6f8..6e3ce7d 100644
    --- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
    +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
    @@ -38,6 +38,10 @@
         ETH_RSS_NONFRAG_IPV4_UDP | \
         ETH_RSS_NONFRAG_IPV6_UDP)

    +#define VMXNET3_MANDATORY_V4_RSS ( \
    +   ETH_RSS_NONFRAG_IPV4_TCP | \
    +   ETH_RSS_NONFRAG_IPV6_TCP)
    +
     /* RSS configuration structure - shared with device through GPA */
     typedef struct VMXNET3_RSSConf {
         uint16_t   hashType;
    diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
    index 7794d74..dd99684 100644
    --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
    +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
    @@ -1311,6 +1311,14 @@ vmxnet3_v4_rss_configure(struct rte_eth_dev *dev)

         cmdInfo->setRSSFields = 0;
         port_rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
    +
    +   if ((port_rss_conf->rss_hf & VMXNET3_MANDATORY_V4_RSS) !=
    +       VMXNET3_MANDATORY_V4_RSS) {
    +           PMD_INIT_LOG(WARNING, "RSS: IPv4/6 TCP is required for vmxnet3 v4 RSS,"
    +                        "automatically setting it");
    +           port_rss_conf->rss_hf |= VMXNET3_MANDATORY_V4_RSS;
    +   }
    +
         rss_hf = port_rss_conf->rss_hf &
                 (VMXNET3_V4_RSS_MASK | VMXNET3_RSS_OFFLOAD_ALL);

    --
    2.7.4




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

* Re: [dpdk-dev] [PATCH] net/vmxnet3: fix RSS setting on v4
  2019-09-13 20:10   ` Eduard Serra Miralles
@ 2019-09-16 19:01     ` Yong Wang
  2019-10-08 17:55       ` Ferruh Yigit
  0 siblings, 1 reply; 8+ messages in thread
From: Yong Wang @ 2019-09-16 19:01 UTC (permalink / raw)
  To: Eduard Serra Miralles; +Cc: dev


From: Eduard Serra Miralles <eserra@vmware.com>
Date: Friday, September 13, 2019 at 1:10 PM
To: Yong Wang <yongwang@vmware.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [PATCH] net/vmxnet3: fix RSS setting on v4


I think so too. Apparently however, ESX is mandatorily expecting that underneath. If not set, config will fail.





________________________________
From: Yong Wang <yongwang@vmware.com>
Sent: Friday, September 13, 2019 11:44:38 AM
To: Eduard Serra Miralles <eserra@vmware.com>
Cc: dev@dpdk.org <dev@dpdk.org>
Subject: Re: [PATCH] net/vmxnet3: fix RSS setting on v4

-----Original Message-----
From: Eduard Serra Miralles <eserra@vmware.com>
Date: Wednesday, August 21, 2019 at 9:37 AM
To: Yong Wang <yongwang@vmware.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: [PATCH] net/vmxnet3: fix RSS setting on v4

    When calling to setup RSS on v4 API, ESX will expect
    IPv4/6 TCP RSS to be set/requested mandatorily.

    This patch will:
    - Set IPv4/6 TCP RSS when these have not been set. A warning
    message is thrown to make sure we warn the application we are
    setting IPv4/6 TCP RSS when not set.

Why we are enforcing TCP RSS?  I would think it's up to the user to decide what to request based on their specific needs and we should support RSS even when it does not request TCP RSS.

    - An additional check has been added to dodge RSS configuration
    altogether unless MQ_RSS has been requested, similar to v3.

    The alternative (returning error) was considered, the intent
    is to ease the task of setting up and running vmxnet3 in situations
    where it's supposted to be most strightforward (testpmd, pktgen).

    Signed-off-by: Eduard Serra <eserra@vmware.com>
    ---
Acked-by: Yong Wang <yongwang@vmware.com>

     drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++-
     drivers/net/vmxnet3/vmxnet3_ethdev.h | 4 ++++
     drivers/net/vmxnet3/vmxnet3_rxtx.c   | 8 ++++++++
     3 files changed, 14 insertions(+), 1 deletion(-)

    diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
    index 57feb37..0a7047e 100644
    --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
    +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
    @@ -769,7 +769,8 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
                 PMD_INIT_LOG(DEBUG, "Failed to setup memory region\n");
         }

    -   if (VMXNET3_VERSION_GE_4(hw)) {
    +   if (VMXNET3_VERSION_GE_4(hw) &&
    +       dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
                 /* Check for additional RSS  */
                 ret = vmxnet3_v4_rss_configure(dev);
                 if (ret != VMXNET3_SUCCESS) {
    diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
    index 8c2b6f8..6e3ce7d 100644
    --- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
    +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
    @@ -38,6 +38,10 @@
         ETH_RSS_NONFRAG_IPV4_UDP | \
         ETH_RSS_NONFRAG_IPV6_UDP)

    +#define VMXNET3_MANDATORY_V4_RSS ( \
    +   ETH_RSS_NONFRAG_IPV4_TCP | \
    +   ETH_RSS_NONFRAG_IPV6_TCP)
    +
     /* RSS configuration structure - shared with device through GPA */
     typedef struct VMXNET3_RSSConf {
         uint16_t   hashType;
    diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
    index 7794d74..dd99684 100644
    --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
    +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
    @@ -1311,6 +1311,14 @@ vmxnet3_v4_rss_configure(struct rte_eth_dev *dev)

         cmdInfo->setRSSFields = 0;
         port_rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
    +
    +   if ((port_rss_conf->rss_hf & VMXNET3_MANDATORY_V4_RSS) !=
    +       VMXNET3_MANDATORY_V4_RSS) {
    +           PMD_INIT_LOG(WARNING, "RSS: IPv4/6 TCP is required for vmxnet3 v4 RSS,"
    +                        "automatically setting it");
    +           port_rss_conf->rss_hf |= VMXNET3_MANDATORY_V4_RSS;
    +   }
    +
         rss_hf = port_rss_conf->rss_hf &
                 (VMXNET3_V4_RSS_MASK | VMXNET3_RSS_OFFLOAD_ALL);

    --
    2.7.4



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

* Re: [dpdk-dev] [PATCH] net/vmxnet3: fix RSS setting on v4
  2019-09-16 19:01     ` Yong Wang
@ 2019-10-08 17:55       ` Ferruh Yigit
  0 siblings, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2019-10-08 17:55 UTC (permalink / raw)
  To: Yong Wang, Eduard Serra Miralles; +Cc: dev

On 9/16/2019 8:01 PM, Yong Wang wrote:
> 
> From: Eduard Serra Miralles <eserra@vmware.com>
> Date: Friday, September 13, 2019 at 1:10 PM
> To: Yong Wang <yongwang@vmware.com>
> Cc: "dev@dpdk.org" <dev@dpdk.org>
> Subject: RE: [PATCH] net/vmxnet3: fix RSS setting on v4
> 
> 
> I think so too. Apparently however, ESX is mandatorily expecting that underneath. If not set, config will fail.
> 
> 
> 
> 
> 
> ________________________________
> From: Yong Wang <yongwang@vmware.com>
> Sent: Friday, September 13, 2019 11:44:38 AM
> To: Eduard Serra Miralles <eserra@vmware.com>
> Cc: dev@dpdk.org <dev@dpdk.org>
> Subject: Re: [PATCH] net/vmxnet3: fix RSS setting on v4
> 
> -----Original Message-----
> From: Eduard Serra Miralles <eserra@vmware.com>
> Date: Wednesday, August 21, 2019 at 9:37 AM
> To: Yong Wang <yongwang@vmware.com>
> Cc: "dev@dpdk.org" <dev@dpdk.org>
> Subject: [PATCH] net/vmxnet3: fix RSS setting on v4
> 
>     When calling to setup RSS on v4 API, ESX will expect
>     IPv4/6 TCP RSS to be set/requested mandatorily.
> 
>     This patch will:
>     - Set IPv4/6 TCP RSS when these have not been set. A warning
>     message is thrown to make sure we warn the application we are
>     setting IPv4/6 TCP RSS when not set.
> 
> Why we are enforcing TCP RSS?  I would think it's up to the user to decide what to request based on their specific needs and we should support RSS even when it does not request TCP RSS.
> 
>     - An additional check has been added to dodge RSS configuration
>     altogether unless MQ_RSS has been requested, similar to v3.
> 
>     The alternative (returning error) was considered, the intent
>     is to ease the task of setting up and running vmxnet3 in situations
>     where it's supposted to be most strightforward (testpmd, pktgen).
> 
>     Signed-off-by: Eduard Serra <eserra@vmware.com>
>     ---
> Acked-by: Yong Wang <yongwang@vmware.com>

Sorry I missed your ack here, since it was not quoted patchwork also missed it.


Eduard,
Can you please provide a Fixes tag, that will be useful to backport fix to the
stable trees?

Thanks,
ferruh

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

* [dpdk-dev] [PATCH v2] net/vmxnet3: fix RSS setting on v4
  2019-08-21 16:37 [dpdk-dev] [PATCH] net/vmxnet3: fix RSS setting on v4 Eduard Serra Miralles
  2019-09-13 18:44 ` Yong Wang
@ 2020-03-03 20:44 ` Eduard Serra Miralles
  2020-03-04  2:35   ` [dpdk-dev] [PATCH] [v3] " Eduard Serra Miralles
  1 sibling, 1 reply; 8+ messages in thread
From: Eduard Serra Miralles @ 2020-03-03 20:44 UTC (permalink / raw)
  To: dev; +Cc: Yong Wang

When calling to setup RSS on v4 API, ESX will expect
IPv4/6 TCP RSS to be set/requested mandatorily.

This patch will:
- Set IPv4/6 TCP RSS when these have not been set. A warning
message is thrown to make sure we warn the application we are
setting IPv4/6 TCP RSS when not set.
- An additional check has been added to dodge RSS configuration
altogether unless MQ_RSS has been requested, similar to v3.

The alternative (returning error) was considered, the intent
is to ease the task of setting up and running vmxnet3 in situations
where it's supposted to be most strightforward (testpmd, pktgen).

Signed-off-by: Eduard Serra <eserra@vmware.com>
Fixes: #400 (https://bugs.dpdk.org/show_bug.cgi?id=400)
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.h | 4 ++++
 drivers/net/vmxnet3/vmxnet3_rxtx.c   | 8 ++++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 6e6efa9..705e976 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -771,7 +771,8 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 		PMD_INIT_LOG(DEBUG, "Failed to setup memory region\n");
 	}
 
-	if (VMXNET3_VERSION_GE_4(hw)) {
+	if (VMXNET3_VERSION_GE_4(hw) &&
+	    dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
 		/* Check for additional RSS  */
 		ret = vmxnet3_v4_rss_configure(dev);
 		if (ret != VMXNET3_SUCCESS) {
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index 8c2b6f8..dd685b0 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -38,6 +38,10 @@
 	ETH_RSS_NONFRAG_IPV4_UDP | \
 	ETH_RSS_NONFRAG_IPV6_UDP)
 
+#define VMXNET3_MANDATORY_V4_RSS ( \
+	ETH_RSS_NONFRAG_IPV4_TCP | \
+	ETH_RSS_NONFRAG_IPV6_TCP)
+
 /* RSS configuration structure - shared with device through GPA */
 typedef struct VMXNET3_RSSConf {
 	uint16_t   hashType;
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 7794d74..dd99684 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -1311,6 +1311,14 @@ vmxnet3_v4_rss_configure(struct rte_eth_dev *dev)
 
 	cmdInfo->setRSSFields = 0;
 	port_rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
+
+	if ((port_rss_conf->rss_hf & VMXNET3_MANDATORY_V4_RSS) !=
+	    VMXNET3_MANDATORY_V4_RSS) {
+		PMD_INIT_LOG(WARNING, "RSS: IPv4/6 TCP is required for vmxnet3 v4 RSS,"
+			     "automatically setting it");
+		port_rss_conf->rss_hf |= VMXNET3_MANDATORY_V4_RSS;
+	}
+
 	rss_hf = port_rss_conf->rss_hf &
 		(VMXNET3_V4_RSS_MASK | VMXNET3_RSS_OFFLOAD_ALL);
 
-- 
2.7.4


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

* [dpdk-dev] [PATCH] [v3] net/vmxnet3: fix RSS setting on v4
  2020-03-03 20:44 ` [dpdk-dev] [PATCH v2] " Eduard Serra Miralles
@ 2020-03-04  2:35   ` Eduard Serra Miralles
  2020-03-05 14:19     ` Ferruh Yigit
  0 siblings, 1 reply; 8+ messages in thread
From: Eduard Serra Miralles @ 2020-03-04  2:35 UTC (permalink / raw)
  To: dev; +Cc: Yong Wang

When calling to setup RSS on v4 API, ESX will expect
IPv4/6 TCP RSS to be set/requested mandatorily.

This patch will:
- Set IPv4/6 TCP RSS when these have not been set. A warning
message is thrown to make sure we warn the application we are
setting IPv4/6 TCP RSS when not set.
- An additional check has been added to dodge RSS configuration
altogether unless MQ_RSS has been requested, similar to v3.

The alternative (returning error) was considered, the intent
is to ease the task of setting up and running vmxnet3 in situations
where it's supposted to be most strightforward (testpmd, pktgen).

Open bug for this:
https://bugs.dpdk.org/show_bug.cgi?id=400

Signed-off-by: Eduard Serra <eserra@vmware.com>
Acked-by: Yong Wang <yongwang@vmware.com>
Fixes: 643fba770705 ("net/vmxnet3: v4 boot and guest UDP RSS configuration")
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++-
 drivers/net/vmxnet3/vmxnet3_ethdev.h | 4 ++++
 drivers/net/vmxnet3/vmxnet3_rxtx.c   | 8 ++++++++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 6e6efa9..705e976 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -771,7 +771,8 @@ vmxnet3_dev_start(struct rte_eth_dev *dev)
 		PMD_INIT_LOG(DEBUG, "Failed to setup memory region\n");
 	}
 
-	if (VMXNET3_VERSION_GE_4(hw)) {
+	if (VMXNET3_VERSION_GE_4(hw) &&
+	    dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS) {
 		/* Check for additional RSS  */
 		ret = vmxnet3_v4_rss_configure(dev);
 		if (ret != VMXNET3_SUCCESS) {
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.h b/drivers/net/vmxnet3/vmxnet3_ethdev.h
index 8c2b6f8..dd685b0 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.h
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.h
@@ -38,6 +38,10 @@
 	ETH_RSS_NONFRAG_IPV4_UDP | \
 	ETH_RSS_NONFRAG_IPV6_UDP)
 
+#define VMXNET3_MANDATORY_V4_RSS ( \
+	ETH_RSS_NONFRAG_IPV4_TCP | \
+	ETH_RSS_NONFRAG_IPV6_TCP)
+
 /* RSS configuration structure - shared with device through GPA */
 typedef struct VMXNET3_RSSConf {
 	uint16_t   hashType;
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 7794d74..dd99684 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -1311,6 +1311,14 @@ vmxnet3_v4_rss_configure(struct rte_eth_dev *dev)
 
 	cmdInfo->setRSSFields = 0;
 	port_rss_conf = &dev->data->dev_conf.rx_adv_conf.rss_conf;
+
+	if ((port_rss_conf->rss_hf & VMXNET3_MANDATORY_V4_RSS) !=
+	    VMXNET3_MANDATORY_V4_RSS) {
+		PMD_INIT_LOG(WARNING, "RSS: IPv4/6 TCP is required for vmxnet3 v4 RSS,"
+			     "automatically setting it");
+		port_rss_conf->rss_hf |= VMXNET3_MANDATORY_V4_RSS;
+	}
+
 	rss_hf = port_rss_conf->rss_hf &
 		(VMXNET3_V4_RSS_MASK | VMXNET3_RSS_OFFLOAD_ALL);
 
-- 
2.7.4


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

* Re: [dpdk-dev] [PATCH] [v3] net/vmxnet3: fix RSS setting on v4
  2020-03-04  2:35   ` [dpdk-dev] [PATCH] [v3] " Eduard Serra Miralles
@ 2020-03-05 14:19     ` Ferruh Yigit
  0 siblings, 0 replies; 8+ messages in thread
From: Ferruh Yigit @ 2020-03-05 14:19 UTC (permalink / raw)
  To: Eduard Serra Miralles, dev; +Cc: Yong Wang

On 3/4/2020 2:35 AM, Eduard Serra Miralles wrote:
> When calling to setup RSS on v4 API, ESX will expect
> IPv4/6 TCP RSS to be set/requested mandatorily.
> 
> This patch will:
> - Set IPv4/6 TCP RSS when these have not been set. A warning
> message is thrown to make sure we warn the application we are
> setting IPv4/6 TCP RSS when not set.
> - An additional check has been added to dodge RSS configuration
> altogether unless MQ_RSS has been requested, similar to v3.
> 
> The alternative (returning error) was considered, the intent
> is to ease the task of setting up and running vmxnet3 in situations
> where it's supposted to be most strightforward (testpmd, pktgen).
> 
> Open bug for this:
> https://bugs.dpdk.org/show_bug.cgi?id=400
> 
> Signed-off-by: Eduard Serra <eserra@vmware.com>
> Acked-by: Yong Wang <yongwang@vmware.com>
> Fixes: 643fba770705 ("net/vmxnet3: v4 boot and guest UDP RSS configuration")

    Bugzilla ID: 400
    Fixes: 643fba770705 ("net/vmxnet3: add v4 boot and guest UDP RSS config")
    Cc: stable@dpdk.org

Applied to dpdk-next-net/master, thanks.


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

end of thread, other threads:[~2020-03-05 14:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-21 16:37 [dpdk-dev] [PATCH] net/vmxnet3: fix RSS setting on v4 Eduard Serra Miralles
2019-09-13 18:44 ` Yong Wang
2019-09-13 20:10   ` Eduard Serra Miralles
2019-09-16 19:01     ` Yong Wang
2019-10-08 17:55       ` Ferruh Yigit
2020-03-03 20:44 ` [dpdk-dev] [PATCH v2] " Eduard Serra Miralles
2020-03-04  2:35   ` [dpdk-dev] [PATCH] [v3] " Eduard Serra Miralles
2020-03-05 14:19     ` 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).