patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH 0/2] app/test: fix bonding RSS test when disable RSS
@ 2022-06-08 11:45 Dongdong Liu
  2022-06-08 11:45 ` [PATCH 1/2] net/bonding: fix RSS inconsistent between bonded and slaves Dongdong Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dongdong Liu @ 2022-06-08 11:45 UTC (permalink / raw)
  To: dev
  Cc: yux.jiang, zhiminx.huang, qingx.sun, ferruh.yigit, songx.jiale,
	stable, Dongdong Liu

This patch is to fix bonding RSS test when disable RSS.
The below link show the detail infomaintion of the failed testcase.
https://bugs.dpdk.org/show_bug.cgi?id=1013

Huisong Li (2):
  net/bonding: fix RSS inconsistent between bonded and slaves
  app/test: fix bonding RSS test when disable RSS

 app/test/test_link_bonding_rssconf.c   | 78 ++++++++++++++++++++++++--
 drivers/net/bonding/rte_eth_bond_pmd.c |  6 ++
 2 files changed, 79 insertions(+), 5 deletions(-)

-- 
2.33.0


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

* [PATCH 1/2] net/bonding: fix RSS inconsistent between bonded and slaves
  2022-06-08 11:45 [PATCH 0/2] app/test: fix bonding RSS test when disable RSS Dongdong Liu
@ 2022-06-08 11:45 ` Dongdong Liu
  2022-06-09  8:52   ` Andrew Rybchenko
  2022-06-08 11:45 ` [PATCH 2/2] app/test: fix bonding RSS test when disable RSS Dongdong Liu
  2022-06-09  8:53 ` [PATCH 0/2] " Andrew Rybchenko
  2 siblings, 1 reply; 5+ messages in thread
From: Dongdong Liu @ 2022-06-08 11:45 UTC (permalink / raw)
  To: dev
  Cc: yux.jiang, zhiminx.huang, qingx.sun, ferruh.yigit, songx.jiale,
	stable, Huisong Li, Dongdong Liu, Chas Williams, Min Hu (Connor),
	Declan Doherty, Tomasz Kulasek

From: Huisong Li <lihuisong@huawei.com>

Currently, RSS configuration of slave is set only when RSS is enabled for
bonded port. If RSS is enabled for the slaves port before adding to the
bonded port with disabling RSS, it will run into that the RSS enabled state
of bonded and slaves port is inconsistent after starting bonded port.
So the RSS configuration of slave should also be set when RSS is disabled
for bonded port.

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

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index ace8f8b45e..73e6972035 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1707,6 +1707,12 @@ slave_configure(struct rte_eth_dev *bonded_eth_dev,
 				bonded_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;
 		slave_eth_dev->data->dev_conf.rxmode.mq_mode =
 				bonded_eth_dev->data->dev_conf.rxmode.mq_mode;
+	} else {
+		slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key_len = 0;
+		slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key = NULL;
+		slave_eth_dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = 0;
+		slave_eth_dev->data->dev_conf.rxmode.mq_mode =
+				bonded_eth_dev->data->dev_conf.rxmode.mq_mode;
 	}
 
 	slave_eth_dev->data->dev_conf.rxmode.mtu =
-- 
2.33.0


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

* [PATCH 2/2] app/test: fix bonding RSS test when disable RSS
  2022-06-08 11:45 [PATCH 0/2] app/test: fix bonding RSS test when disable RSS Dongdong Liu
  2022-06-08 11:45 ` [PATCH 1/2] net/bonding: fix RSS inconsistent between bonded and slaves Dongdong Liu
@ 2022-06-08 11:45 ` Dongdong Liu
  2022-06-09  8:53 ` [PATCH 0/2] " Andrew Rybchenko
  2 siblings, 0 replies; 5+ messages in thread
From: Dongdong Liu @ 2022-06-08 11:45 UTC (permalink / raw)
  To: dev
  Cc: yux.jiang, zhiminx.huang, qingx.sun, ferruh.yigit, songx.jiale,
	stable, Huisong Li, Dongdong Liu, Chas Williams, Min Hu (Connor),
	Declan Doherty, Tomasz Kulasek

From: Huisong Li <lihuisong@huawei.com>

The "test_rss_lazy" test is used for testing bonding RSS functions
when bonded port disable RSS. Currently, this test case can update
RSS functions of bonded and slave port if bonded port turns off RSS.
It is unreasonable and has been adjusted to be non-updateable in
following patch:
"93e1ea6dfa99 ethdev: fix RSS update when RSS is disabled"

So this patch fixes this test code.

Fixes: 43b630244e7e ("app/test: add dynamic bonding RSS configuration")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
---
 app/test/test_link_bonding_rssconf.c | 78 ++++++++++++++++++++++++++--
 1 file changed, 73 insertions(+), 5 deletions(-)

diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c
index 7228965ced..b3d71c6f3a 100644
--- a/app/test/test_link_bonding_rssconf.c
+++ b/app/test/test_link_bonding_rssconf.c
@@ -468,15 +468,85 @@ test_rss(void)
 
 	TEST_ASSERT_SUCCESS(test_propagate(), "Propagation test failed");
 
-	TEST_ASSERT(slave_remove_and_add() == 1, "New slave should be synced");
+	TEST_ASSERT(slave_remove_and_add() == 1, "remove and add slaves success.");
 
 	remove_slaves_and_stop_bonded_device();
 
 	return TEST_SUCCESS;
 }
 
+
+/**
+ * Test RSS configuration over bonded and slaves.
+ */
+static int
+test_rss_config_lazy(void)
+{
+	struct rte_eth_rss_conf bond_rss_conf = {0};
+	struct slave_conf *port;
+	uint8_t rss_key[40];
+	uint64_t rss_hf;
+	int retval;
+	uint16_t i;
+	uint8_t n;
+
+	retval = rte_eth_dev_info_get(test_params.bond_port_id,
+				      &test_params.bond_dev_info);
+	TEST_ASSERT((retval == 0), "Error during getting device (port %u) info: %s\n",
+		    test_params.bond_port_id, strerror(-retval));
+
+	rss_hf = test_params.bond_dev_info.flow_type_rss_offloads;
+	if (rss_hf != 0) {
+		bond_rss_conf.rss_key = NULL;
+		bond_rss_conf.rss_hf = rss_hf;
+		retval = rte_eth_dev_rss_hash_update(test_params.bond_port_id,
+						     &bond_rss_conf);
+		TEST_ASSERT(retval != 0, "Succeeded in setting bonded port hash function");
+	}
+
+	/* Set all keys to zero for all slaves */
+	FOR_EACH_PORT(n, port) {
+		port = &test_params.slave_ports[n];
+		retval = rte_eth_dev_rss_hash_conf_get(port->port_id,
+						       &port->rss_conf);
+		TEST_ASSERT_SUCCESS(retval, "Cannot get slaves RSS configuration");
+		memset(port->rss_key, 0, sizeof(port->rss_key));
+		port->rss_conf.rss_key = port->rss_key;
+		port->rss_conf.rss_key_len = sizeof(port->rss_key);
+		retval = rte_eth_dev_rss_hash_update(port->port_id,
+						     &port->rss_conf);
+		TEST_ASSERT(retval != 0, "Succeeded in setting slaves RSS keys");
+	}
+
+	/* Set RSS keys for bonded port */
+	memset(rss_key, 1, sizeof(rss_key));
+	bond_rss_conf.rss_hf = rss_hf;
+	bond_rss_conf.rss_key = rss_key;
+	bond_rss_conf.rss_key_len = sizeof(rss_key);
+
+	retval = rte_eth_dev_rss_hash_update(test_params.bond_port_id,
+					     &bond_rss_conf);
+	TEST_ASSERT(retval != 0, "Succeeded in setting bonded port RSS keys");
+
+	/*  Test RETA propagation */
+	for (i = 0; i < RXTX_QUEUE_COUNT; i++) {
+		FOR_EACH_PORT(n, port) {
+			port = &test_params.slave_ports[n];
+			retval = reta_set(port->port_id, (i + 1) % RXTX_QUEUE_COUNT,
+					  port->dev_info.reta_size);
+			TEST_ASSERT(retval != 0, "Succeeded in setting slaves RETA");
+		}
+
+		retval = reta_set(test_params.bond_port_id, i % RXTX_QUEUE_COUNT,
+				  test_params.bond_dev_info.reta_size);
+		TEST_ASSERT(retval != 0, "Succeeded in setting bonded port RETA");
+	}
+
+	return TEST_SUCCESS;
+}
+
 /**
- * Test propagation logic, when RX_RSS mq_mode is turned off for bonding port
+ * Test RSS function logic, when RX_RSS mq_mode is turned off for bonding port
  */
 static int
 test_rss_lazy(void)
@@ -497,9 +567,7 @@ test_rss_lazy(void)
 	TEST_ASSERT_SUCCESS(rte_eth_dev_start(test_params.bond_port_id),
 			"Failed to start bonding port (%d).", test_params.bond_port_id);
 
-	TEST_ASSERT_SUCCESS(test_propagate(), "Propagation test failed");
-
-	TEST_ASSERT(slave_remove_and_add() == 0, "New slave shouldn't be synced");
+	TEST_ASSERT_SUCCESS(test_rss_config_lazy(), "Succeeded in setting RSS hash when RX_RSS mq_mode is turned off");
 
 	remove_slaves_and_stop_bonded_device();
 
-- 
2.33.0


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

* Re: [PATCH 1/2] net/bonding: fix RSS inconsistent between bonded and slaves
  2022-06-08 11:45 ` [PATCH 1/2] net/bonding: fix RSS inconsistent between bonded and slaves Dongdong Liu
@ 2022-06-09  8:52   ` Andrew Rybchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2022-06-09  8:52 UTC (permalink / raw)
  To: Dongdong Liu, dev
  Cc: yux.jiang, zhiminx.huang, qingx.sun, ferruh.yigit, songx.jiale,
	stable, Huisong Li, Chas Williams, Min Hu (Connor),
	Declan Doherty, Tomasz Kulasek

On 6/8/22 14:45, Dongdong Liu wrote:
> From: Huisong Li <lihuisong@huawei.com>
> 
> Currently, RSS configuration of slave is set only when RSS is enabled for
> bonded port. If RSS is enabled for the slaves port before adding to the
> bonded port with disabling RSS, it will run into that the RSS enabled state
> of bonded and slaves port is inconsistent after starting bonded port.
> So the RSS configuration of slave should also be set when RSS is disabled
> for bonded port.
> 
> Fixes: 734ce47f71e0 ("bonding: support RSS dynamic configuration")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>

Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>


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

* Re: [PATCH 0/2] app/test: fix bonding RSS test when disable RSS
  2022-06-08 11:45 [PATCH 0/2] app/test: fix bonding RSS test when disable RSS Dongdong Liu
  2022-06-08 11:45 ` [PATCH 1/2] net/bonding: fix RSS inconsistent between bonded and slaves Dongdong Liu
  2022-06-08 11:45 ` [PATCH 2/2] app/test: fix bonding RSS test when disable RSS Dongdong Liu
@ 2022-06-09  8:53 ` Andrew Rybchenko
  2 siblings, 0 replies; 5+ messages in thread
From: Andrew Rybchenko @ 2022-06-09  8:53 UTC (permalink / raw)
  To: Dongdong Liu, dev
  Cc: yux.jiang, zhiminx.huang, qingx.sun, ferruh.yigit, songx.jiale, stable

On 6/8/22 14:45, Dongdong Liu wrote:
> This patch is to fix bonding RSS test when disable RSS.
> The below link show the detail infomaintion of the failed testcase.
> https://bugs.dpdk.org/show_bug.cgi?id=1013
> 
> Huisong Li (2):
>    net/bonding: fix RSS inconsistent between bonded and slaves
>    app/test: fix bonding RSS test when disable RSS
> 
>   app/test/test_link_bonding_rssconf.c   | 78 ++++++++++++++++++++++++--
>   drivers/net/bonding/rte_eth_bond_pmd.c |  6 ++
>   2 files changed, 79 insertions(+), 5 deletions(-)
> 

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

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

end of thread, other threads:[~2022-06-09  8:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-08 11:45 [PATCH 0/2] app/test: fix bonding RSS test when disable RSS Dongdong Liu
2022-06-08 11:45 ` [PATCH 1/2] net/bonding: fix RSS inconsistent between bonded and slaves Dongdong Liu
2022-06-09  8:52   ` Andrew Rybchenko
2022-06-08 11:45 ` [PATCH 2/2] app/test: fix bonding RSS test when disable RSS Dongdong Liu
2022-06-09  8:53 ` [PATCH 0/2] " Andrew Rybchenko

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).