DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/failsafe: report on supported RSS functions
@ 2018-05-08 18:02 Ophir Munk
  2018-05-09 12:00 ` Gaëtan Rivet
  2018-05-09 13:46 ` [dpdk-dev] [PATCH v2] net/failsafe: advertise " Ophir Munk
  0 siblings, 2 replies; 6+ messages in thread
From: Ophir Munk @ 2018-05-08 18:02 UTC (permalink / raw)
  To: dev, Gaetan Rivet; +Cc: Thomas Monjalon, Olga Shern, Ophir Munk, Shahaf Shuler

Report on failsafe supported RSS functions as part of dev_infos_get
callback. Set failsafe default RSS hash functions to be: ETH_RSS_IP,
ETH_RSS_UDP and ETH_RSS_TCP.
The net result of failsafe RSS hash functions is the logical AND of
the RSS hash functions among all failsafe sub_devices and failsafe own
defaults.

Previous to this commit RSS support was reported as none. Since the
introduction of [1] it is required that all RSS configurations will be
verified.

[1] commit 8863a1fbfc66 ("ethdev: add supported hash function check")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
 drivers/net/failsafe/failsafe_ops.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 6d44884..d18b793 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -83,7 +83,10 @@ static struct rte_eth_dev_info default_infos = {
 		DEV_TX_OFFLOAD_UDP_CKSUM |
 		DEV_TX_OFFLOAD_TCP_CKSUM |
 		DEV_TX_OFFLOAD_TCP_TSO,
-	.flow_type_rss_offloads = 0x0,
+	.flow_type_rss_offloads =
+			ETH_RSS_IP |
+			ETH_RSS_UDP |
+			ETH_RSS_TCP,
 };
 
 static int
@@ -805,26 +808,29 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
 	} else {
 		uint64_t rx_offload_capa;
 		uint64_t rxq_offload_capa;
+		uint64_t rss_offloads_hf;
 
 		rx_offload_capa = default_infos.rx_offload_capa;
 		rxq_offload_capa = default_infos.rx_queue_offload_capa;
+		rss_offloads_hf = default_infos.flow_type_rss_offloads;
 		FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
 			rte_eth_dev_info_get(PORT_ID(sdev),
 					&PRIV(dev)->infos);
 			rx_offload_capa &= PRIV(dev)->infos.rx_offload_capa;
 			rxq_offload_capa &=
 					PRIV(dev)->infos.rx_queue_offload_capa;
+			rss_offloads_hf &=
+					PRIV(dev)->infos.flow_type_rss_offloads;
 		}
 		sdev = TX_SUBDEV(dev);
 		rte_eth_dev_info_get(PORT_ID(sdev), &PRIV(dev)->infos);
 		PRIV(dev)->infos.rx_offload_capa = rx_offload_capa;
 		PRIV(dev)->infos.rx_queue_offload_capa = rxq_offload_capa;
+		PRIV(dev)->infos.flow_type_rss_offloads = rss_offloads_hf;
 		PRIV(dev)->infos.tx_offload_capa &=
 					default_infos.tx_offload_capa;
 		PRIV(dev)->infos.tx_queue_offload_capa &=
 					default_infos.tx_queue_offload_capa;
-		PRIV(dev)->infos.flow_type_rss_offloads &=
-					default_infos.flow_type_rss_offloads;
 	}
 	rte_memcpy(infos, &PRIV(dev)->infos, sizeof(*infos));
 }
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH v1] net/failsafe: report on supported RSS functions
  2018-05-08 18:02 [dpdk-dev] [PATCH v1] net/failsafe: report on supported RSS functions Ophir Munk
@ 2018-05-09 12:00 ` Gaëtan Rivet
  2018-05-09 13:53   ` Ophir Munk
  2018-05-09 13:46 ` [dpdk-dev] [PATCH v2] net/failsafe: advertise " Ophir Munk
  1 sibling, 1 reply; 6+ messages in thread
From: Gaëtan Rivet @ 2018-05-09 12:00 UTC (permalink / raw)
  To: Ophir Munk; +Cc: dev, Thomas Monjalon, Olga Shern, Shahaf Shuler

Hi Ophir,

The commit title could read:

net/failsafe: advertize supported RSS functions

Some nitpicks in the commit log:

On Tue, May 08, 2018 at 06:02:41PM +0000, Ophir Munk wrote:
> Report on failsafe supported RSS functions as part of dev_infos_get
  ^^^^^^^^^
  Advertize

> callback. Set failsafe default RSS hash functions to be: ETH_RSS_IP,
> ETH_RSS_UDP and ETH_RSS_TCP.
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^                              ^^^^^^^^^^

Better on its own line:

     ETH_RSS_IP, ETH_RSS_UDP, and ETH_RSS_TCP.


> The net result of failsafe RSS hash functions is the logical AND of
      ^^^
      should be removed

> the RSS hash functions among all failsafe sub_devices and failsafe own
> defaults.
> 
> Previous to this commit RSS support was reported as none. Since the
> introduction of [1] it is required that all RSS configurations will be
                                                                 ^^^^
                                                                 should be
                                                                 removed
> verified.
> 
> [1] commit 8863a1fbfc66 ("ethdev: add supported hash function check")
> 
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
> ---
>  drivers/net/failsafe/failsafe_ops.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
> index 6d44884..d18b793 100644
> --- a/drivers/net/failsafe/failsafe_ops.c
> +++ b/drivers/net/failsafe/failsafe_ops.c
> @@ -83,7 +83,10 @@ static struct rte_eth_dev_info default_infos = {
>  		DEV_TX_OFFLOAD_UDP_CKSUM |
>  		DEV_TX_OFFLOAD_TCP_CKSUM |
>  		DEV_TX_OFFLOAD_TCP_TSO,
> -	.flow_type_rss_offloads = 0x0,
> +	.flow_type_rss_offloads =
> +			ETH_RSS_IP |
> +			ETH_RSS_UDP |
> +			ETH_RSS_TCP,
>  };
>  
>  static int
> @@ -805,26 +808,29 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
>  	} else {
>  		uint64_t rx_offload_capa;
>  		uint64_t rxq_offload_capa;
> +		uint64_t rss_offloads_hf;

The name would read better as rss_hf_offload_capa.

rss_hash_function_offload_capa is easier to understand than
rss_offloads_hash_function.

>  
>  		rx_offload_capa = default_infos.rx_offload_capa;
>  		rxq_offload_capa = default_infos.rx_queue_offload_capa;
> +		rss_offloads_hf = default_infos.flow_type_rss_offloads;
>  		FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
>  			rte_eth_dev_info_get(PORT_ID(sdev),
>  					&PRIV(dev)->infos);
>  			rx_offload_capa &= PRIV(dev)->infos.rx_offload_capa;
>  			rxq_offload_capa &=
>  					PRIV(dev)->infos.rx_queue_offload_capa;
> +			rss_offloads_hf &=
> +					PRIV(dev)->infos.flow_type_rss_offloads;
>  		}
>  		sdev = TX_SUBDEV(dev);
>  		rte_eth_dev_info_get(PORT_ID(sdev), &PRIV(dev)->infos);
>  		PRIV(dev)->infos.rx_offload_capa = rx_offload_capa;
>  		PRIV(dev)->infos.rx_queue_offload_capa = rxq_offload_capa;
> +		PRIV(dev)->infos.flow_type_rss_offloads = rss_offloads_hf;
>  		PRIV(dev)->infos.tx_offload_capa &=
>  					default_infos.tx_offload_capa;
>  		PRIV(dev)->infos.tx_queue_offload_capa &=
>  					default_infos.tx_queue_offload_capa;
> -		PRIV(dev)->infos.flow_type_rss_offloads &=
> -					default_infos.flow_type_rss_offloads;
>  	}
>  	rte_memcpy(infos, &PRIV(dev)->infos, sizeof(*infos));
>  }
> -- 
> 2.7.4
> 

With those nitpicks fixed,
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>

-- 
Gaëtan Rivet
6WIND

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

* [dpdk-dev] [PATCH v2] net/failsafe: advertise supported RSS functions
  2018-05-08 18:02 [dpdk-dev] [PATCH v1] net/failsafe: report on supported RSS functions Ophir Munk
  2018-05-09 12:00 ` Gaëtan Rivet
@ 2018-05-09 13:46 ` Ophir Munk
  2018-05-09 14:04   ` Gaëtan Rivet
  1 sibling, 1 reply; 6+ messages in thread
From: Ophir Munk @ 2018-05-09 13:46 UTC (permalink / raw)
  To: dev, Gaetan Rivet; +Cc: Thomas Monjalon, Olga Shern, Ophir Munk, Shahaf Shuler

Advertise failsafe supported RSS functions as part of dev_infos_get
callback. Set failsafe default RSS hash functions to be:
ETH_RSS_IP, ETH_RSS_UDP, and ETH_RSS_TCP.
The result of failsafe RSS hash functions is the logical AND of the
RSS hash functions among all failsafe sub_devices and failsafe own
defaults.

Previous to this commit RSS support was reported as none. Since the
introduction of [1] it is required that all RSS configurations be
verified.

[1] commit 8863a1fbfc66 ("ethdev: add supported hash function check")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
v1:
Initial release
v2:
Changes based on review comments (mainly commit message update)

 drivers/net/failsafe/failsafe_ops.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 6d44884..6f85a63 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -83,7 +83,10 @@ static struct rte_eth_dev_info default_infos = {
 		DEV_TX_OFFLOAD_UDP_CKSUM |
 		DEV_TX_OFFLOAD_TCP_CKSUM |
 		DEV_TX_OFFLOAD_TCP_TSO,
-	.flow_type_rss_offloads = 0x0,
+	.flow_type_rss_offloads =
+			ETH_RSS_IP |
+			ETH_RSS_UDP |
+			ETH_RSS_TCP,
 };
 
 static int
@@ -805,26 +808,29 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
 	} else {
 		uint64_t rx_offload_capa;
 		uint64_t rxq_offload_capa;
+		uint64_t rss_hf_offload_capa;
 
 		rx_offload_capa = default_infos.rx_offload_capa;
 		rxq_offload_capa = default_infos.rx_queue_offload_capa;
+		rss_hf_offload_capa = default_infos.flow_type_rss_offloads;
 		FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
 			rte_eth_dev_info_get(PORT_ID(sdev),
 					&PRIV(dev)->infos);
 			rx_offload_capa &= PRIV(dev)->infos.rx_offload_capa;
 			rxq_offload_capa &=
 					PRIV(dev)->infos.rx_queue_offload_capa;
+			rss_hf_offload_capa &=
+					PRIV(dev)->infos.flow_type_rss_offloads;
 		}
 		sdev = TX_SUBDEV(dev);
 		rte_eth_dev_info_get(PORT_ID(sdev), &PRIV(dev)->infos);
 		PRIV(dev)->infos.rx_offload_capa = rx_offload_capa;
 		PRIV(dev)->infos.rx_queue_offload_capa = rxq_offload_capa;
+		PRIV(dev)->infos.flow_type_rss_offloads = rss_hf_offload_capa;
 		PRIV(dev)->infos.tx_offload_capa &=
 					default_infos.tx_offload_capa;
 		PRIV(dev)->infos.tx_queue_offload_capa &=
 					default_infos.tx_queue_offload_capa;
-		PRIV(dev)->infos.flow_type_rss_offloads &=
-					default_infos.flow_type_rss_offloads;
 	}
 	rte_memcpy(infos, &PRIV(dev)->infos, sizeof(*infos));
 }
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH v1] net/failsafe: report on supported RSS functions
  2018-05-09 12:00 ` Gaëtan Rivet
@ 2018-05-09 13:53   ` Ophir Munk
  0 siblings, 0 replies; 6+ messages in thread
From: Ophir Munk @ 2018-05-09 13:53 UTC (permalink / raw)
  To: Gaëtan Rivet; +Cc: dev, Thomas Monjalon, Olga Shern, Shahaf Shuler

Hi,
PATCH v2 was sent 

> -----Original Message-----
> From: Gaëtan Rivet [mailto:gaetan.rivet@6wind.com]
> Sent: Wednesday, May 09, 2018 3:00 PM
> To: Ophir Munk <ophirmu@mellanox.com>
> Cc: dev@dpdk.org; Thomas Monjalon <thomas@monjalon.net>; Olga Shern
> <olgas@mellanox.com>; Shahaf Shuler <shahafs@mellanox.com>
> Subject: Re: [PATCH v1] net/failsafe: report on supported RSS functions
> 
> Hi Ophir,
> 
> The commit title could read:
> 
> net/failsafe: advertize supported RSS functions
> 
> Some nitpicks in the commit log:
> 
> On Tue, May 08, 2018 at 06:02:41PM +0000, Ophir Munk wrote:
> > Report on failsafe supported RSS functions as part of dev_infos_get
>   ^^^^^^^^^
>   Advertize
> 
> > callback. Set failsafe default RSS hash functions to be: ETH_RSS_IP,
> > ETH_RSS_UDP and ETH_RSS_TCP.
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^                              ^^^^^^^^^^
> 
> Better on its own line:
> 
>      ETH_RSS_IP, ETH_RSS_UDP, and ETH_RSS_TCP.
> 
> 
> > The net result of failsafe RSS hash functions is the logical AND of
>       ^^^
>       should be removed
> 
> > the RSS hash functions among all failsafe sub_devices and failsafe own
> > defaults.
> >
> > Previous to this commit RSS support was reported as none. Since the
> > introduction of [1] it is required that all RSS configurations will be
>                                                                  ^^^^
>                                                                  should be
>                                                                  removed
> > verified.
> >
> > [1] commit 8863a1fbfc66 ("ethdev: add supported hash function check")
> >
> > Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
> > ---
> >  drivers/net/failsafe/failsafe_ops.c | 12 +++++++++---
> >  1 file changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/failsafe/failsafe_ops.c
> > b/drivers/net/failsafe/failsafe_ops.c
> > index 6d44884..d18b793 100644
> > --- a/drivers/net/failsafe/failsafe_ops.c
> > +++ b/drivers/net/failsafe/failsafe_ops.c
> > @@ -83,7 +83,10 @@ static struct rte_eth_dev_info default_infos = {
> >  		DEV_TX_OFFLOAD_UDP_CKSUM |
> >  		DEV_TX_OFFLOAD_TCP_CKSUM |
> >  		DEV_TX_OFFLOAD_TCP_TSO,
> > -	.flow_type_rss_offloads = 0x0,
> > +	.flow_type_rss_offloads =
> > +			ETH_RSS_IP |
> > +			ETH_RSS_UDP |
> > +			ETH_RSS_TCP,
> >  };
> >
> >  static int
> > @@ -805,26 +808,29 @@ fs_dev_infos_get(struct rte_eth_dev *dev,
> >  	} else {
> >  		uint64_t rx_offload_capa;
> >  		uint64_t rxq_offload_capa;
> > +		uint64_t rss_offloads_hf;
> 
> The name would read better as rss_hf_offload_capa.
> 
> rss_hash_function_offload_capa is easier to understand than
> rss_offloads_hash_function.
> 
> >
> >  		rx_offload_capa = default_infos.rx_offload_capa;
> >  		rxq_offload_capa = default_infos.rx_queue_offload_capa;
> > +		rss_offloads_hf = default_infos.flow_type_rss_offloads;
> >  		FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {
> >  			rte_eth_dev_info_get(PORT_ID(sdev),
> >  					&PRIV(dev)->infos);
> >  			rx_offload_capa &= PRIV(dev)-
> >infos.rx_offload_capa;
> >  			rxq_offload_capa &=
> >  					PRIV(dev)-
> >infos.rx_queue_offload_capa;
> > +			rss_offloads_hf &=
> > +					PRIV(dev)-
> >infos.flow_type_rss_offloads;
> >  		}
> >  		sdev = TX_SUBDEV(dev);
> >  		rte_eth_dev_info_get(PORT_ID(sdev), &PRIV(dev)->infos);
> >  		PRIV(dev)->infos.rx_offload_capa = rx_offload_capa;
> >  		PRIV(dev)->infos.rx_queue_offload_capa =
> rxq_offload_capa;
> > +		PRIV(dev)->infos.flow_type_rss_offloads = rss_offloads_hf;
> >  		PRIV(dev)->infos.tx_offload_capa &=
> >  					default_infos.tx_offload_capa;
> >  		PRIV(dev)->infos.tx_queue_offload_capa &=
> >
> 	default_infos.tx_queue_offload_capa;
> > -		PRIV(dev)->infos.flow_type_rss_offloads &=
> > -
> 	default_infos.flow_type_rss_offloads;
> >  	}
> >  	rte_memcpy(infos, &PRIV(dev)->infos, sizeof(*infos));  }
> > --
> > 2.7.4
> >
> 
> With those nitpicks fixed,
> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> 
> --
> Gaëtan Rivet
> 6WIND

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

* Re: [dpdk-dev] [PATCH v2] net/failsafe: advertise supported RSS functions
  2018-05-09 13:46 ` [dpdk-dev] [PATCH v2] net/failsafe: advertise " Ophir Munk
@ 2018-05-09 14:04   ` Gaëtan Rivet
  2018-05-09 22:46     ` Ferruh Yigit
  0 siblings, 1 reply; 6+ messages in thread
From: Gaëtan Rivet @ 2018-05-09 14:04 UTC (permalink / raw)
  To: Ophir Munk; +Cc: dev, Thomas Monjalon, Olga Shern, Shahaf Shuler

thanks Ophir,

On Wed, May 09, 2018 at 01:46:41PM +0000, Ophir Munk wrote:
> Advertise failsafe supported RSS functions as part of dev_infos_get
> callback. Set failsafe default RSS hash functions to be:
> ETH_RSS_IP, ETH_RSS_UDP, and ETH_RSS_TCP.
> The result of failsafe RSS hash functions is the logical AND of the
> RSS hash functions among all failsafe sub_devices and failsafe own
> defaults.
> 
> Previous to this commit RSS support was reported as none. Since the
> introduction of [1] it is required that all RSS configurations be
> verified.
> 
> [1] commit 8863a1fbfc66 ("ethdev: add supported hash function check")
> 
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>

I made a slight mistake in my earlier naming suggestion, but it's not
important.

Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>

-- 
Gaëtan Rivet
6WIND

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

* Re: [dpdk-dev] [PATCH v2] net/failsafe: advertise supported RSS functions
  2018-05-09 14:04   ` Gaëtan Rivet
@ 2018-05-09 22:46     ` Ferruh Yigit
  0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2018-05-09 22:46 UTC (permalink / raw)
  To: Gaëtan Rivet, Ophir Munk
  Cc: dev, Thomas Monjalon, Olga Shern, Shahaf Shuler

On 5/9/2018 3:04 PM, Gaëtan Rivet wrote:
> thanks Ophir,
> 
> On Wed, May 09, 2018 at 01:46:41PM +0000, Ophir Munk wrote:
>> Advertise failsafe supported RSS functions as part of dev_infos_get
>> callback. Set failsafe default RSS hash functions to be:
>> ETH_RSS_IP, ETH_RSS_UDP, and ETH_RSS_TCP.
>> The result of failsafe RSS hash functions is the logical AND of the
>> RSS hash functions among all failsafe sub_devices and failsafe own
>> defaults.
>>
>> Previous to this commit RSS support was reported as none. Since the
>> introduction of [1] it is required that all RSS configurations be
>> verified.
>>
>> [1] commit 8863a1fbfc66 ("ethdev: add supported hash function check")
>>
>> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
> 
> I made a slight mistake in my earlier naming suggestion, but it's not
> important.
> 
> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>

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

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

end of thread, other threads:[~2018-05-09 22:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-08 18:02 [dpdk-dev] [PATCH v1] net/failsafe: report on supported RSS functions Ophir Munk
2018-05-09 12:00 ` Gaëtan Rivet
2018-05-09 13:53   ` Ophir Munk
2018-05-09 13:46 ` [dpdk-dev] [PATCH v2] net/failsafe: advertise " Ophir Munk
2018-05-09 14:04   ` Gaëtan Rivet
2018-05-09 22:46     ` 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).