DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bonding: don't ignore RSS key on device configuration
@ 2018-08-29  7:51 Andrew Rybchenko
  2018-09-04 13:27 ` Chas Williams
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Rybchenko @ 2018-08-29  7:51 UTC (permalink / raw)
  To: Declan Doherty, Chas Williams; +Cc: dev, Igor Romanov, stable

From: Igor Romanov <igor.romanov@oktetlabs.ru>

Bonding driver ignores the value of RSS key (that is set in the port RSS
configuration) in bond_ethdev_configure(). So the only way to set
non-default RSS key is by using rss_hash_update(). This is not an
expected behaviour.

Make the bond_ethdev_configure() set default RSS key only if
requested key is set to NULL.

Fixes: 734ce47f71e0 ("bonding: support RSS dynamic configuration")
Cc: stable@dpdk.org

Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 27 ++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index b84f32263..ad670cc20 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1778,12 +1778,11 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 
 	/* If RSS is enabled for bonding, try to enable it for slaves  */
 	if (bonded_eth_dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) {
-		if (bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len
-				!= 0) {
+		if (internals->rss_key_len != 0) {
 			slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len =
-					bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len;
+					internals->rss_key_len;
 			slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key =
-					bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key;
+					internals->rss_key;
 		} else {
 			slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
 		}
@@ -3284,11 +3283,23 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
 
 	unsigned i, j;
 
-	/* If RSS is enabled, fill table and key with default values */
+	/*
+	 * If RSS is enabled, fill table with default values and
+	 * set key to the the value specified in port RSS configuration.
+	 * Fall back to default RSS key if the key is not specified
+	 */
 	if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS) {
-		dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = internals->rss_key;
-		dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = 0;
-		memcpy(internals->rss_key, default_rss_key, 40);
+		if (dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key != NULL) {
+			internals->rss_key_len =
+				dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len;
+			memcpy(internals->rss_key,
+			       dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key,
+			       internals->rss_key_len);
+		} else {
+			internals->rss_key_len = sizeof(default_rss_key);
+			memcpy(internals->rss_key, default_rss_key,
+			       internals->rss_key_len);
+		}
 
 		for (i = 0; i < RTE_DIM(internals->reta_conf); i++) {
 			internals->reta_conf[i].mask = ~0LL;
-- 
2.17.1

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

* Re: [dpdk-dev] [PATCH] net/bonding: don't ignore RSS key on device configuration
  2018-08-29  7:51 [dpdk-dev] [PATCH] net/bonding: don't ignore RSS key on device configuration Andrew Rybchenko
@ 2018-09-04 13:27 ` Chas Williams
  2018-09-13 15:23   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Chas Williams @ 2018-09-04 13:27 UTC (permalink / raw)
  To: arybchenko; +Cc: Declan Doherty, Chas Williams, dev, igor.romanov, stable

On Wed, Aug 29, 2018 at 3:51 AM Andrew Rybchenko <arybchenko@solarflare.com>
wrote:

> From: Igor Romanov <igor.romanov@oktetlabs.ru>
>
> Bonding driver ignores the value of RSS key (that is set in the port RSS
> configuration) in bond_ethdev_configure(). So the only way to set
> non-default RSS key is by using rss_hash_update(). This is not an
> expected behaviour.
>
> Make the bond_ethdev_configure() set default RSS key only if
> requested key is set to NULL.
>
> Fixes: 734ce47f71e0 ("bonding: support RSS dynamic configuration")
> Cc: stable@dpdk.org
>
> Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>

Acked-by: Chas Williams <chas@att.com>



> ---
>  drivers/net/bonding/rte_eth_bond_pmd.c | 27 ++++++++++++++++++--------
>  1 file changed, 19 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c
> b/drivers/net/bonding/rte_eth_bond_pmd.c
> index b84f32263..ad670cc20 100644
> --- a/drivers/net/bonding/rte_eth_bond_pmd.c
> +++ b/drivers/net/bonding/rte_eth_bond_pmd.c
> @@ -1778,12 +1778,11 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
>
>         /* If RSS is enabled for bonding, try to enable it for slaves  */
>         if (bonded_eth_dev->data->dev_conf.rxmode.mq_mode &
> ETH_MQ_RX_RSS_FLAG) {
> -               if
> (bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len
> -                               != 0) {
> +               if (internals->rss_key_len != 0) {
>
> slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len =
> -
>  bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len;
> +                                       internals->rss_key_len;
>
> slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key =
> -
>  bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key;
> +                                       internals->rss_key;
>                 } else {
>
> slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
>                 }
> @@ -3284,11 +3283,23 @@ bond_ethdev_configure(struct rte_eth_dev *dev)
>
>         unsigned i, j;
>
> -       /* If RSS is enabled, fill table and key with default values */
> +       /*
> +        * If RSS is enabled, fill table with default values and
> +        * set key to the the value specified in port RSS configuration.
> +        * Fall back to default RSS key if the key is not specified
> +        */
>         if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS) {
> -               dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key =
> internals->rss_key;
> -               dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = 0;
> -               memcpy(internals->rss_key, default_rss_key, 40);
> +               if (dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key !=
> NULL) {
> +                       internals->rss_key_len =
> +
>  dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len;
> +                       memcpy(internals->rss_key,
> +
> dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key,
> +                              internals->rss_key_len);
> +               } else {
> +                       internals->rss_key_len = sizeof(default_rss_key);
> +                       memcpy(internals->rss_key, default_rss_key,
> +                              internals->rss_key_len);
> +               }
>
>                 for (i = 0; i < RTE_DIM(internals->reta_conf); i++) {
>                         internals->reta_conf[i].mask = ~0LL;
> --
> 2.17.1
>
>

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/bonding: don't ignore RSS key on device configuration
  2018-09-04 13:27 ` Chas Williams
@ 2018-09-13 15:23   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-09-13 15:23 UTC (permalink / raw)
  To: Chas Williams, arybchenko
  Cc: Declan Doherty, Chas Williams, dev, igor.romanov, stable

On 9/4/2018 2:27 PM, Chas Williams wrote:
> On Wed, Aug 29, 2018 at 3:51 AM Andrew Rybchenko <arybchenko@solarflare.com>
> wrote:
> 
>> From: Igor Romanov <igor.romanov@oktetlabs.ru>
>>
>> Bonding driver ignores the value of RSS key (that is set in the port RSS
>> configuration) in bond_ethdev_configure(). So the only way to set
>> non-default RSS key is by using rss_hash_update(). This is not an
>> expected behaviour.
>>
>> Make the bond_ethdev_configure() set default RSS key only if
>> requested key is set to NULL.
>>
>> Fixes: 734ce47f71e0 ("bonding: support RSS dynamic configuration")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Igor Romanov <igor.romanov@oktetlabs.ru>
>> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
>>
> 
> Acked-by: Chas Williams <chas@att.com>

Replaced with:
Acked-by: Chas Williams <chas3@att.com>

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

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

end of thread, other threads:[~2018-09-13 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-29  7:51 [dpdk-dev] [PATCH] net/bonding: don't ignore RSS key on device configuration Andrew Rybchenko
2018-09-04 13:27 ` Chas Williams
2018-09-13 15:23   ` [dpdk-dev] [dpdk-stable] " 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).