[1/2] net/bonding: fix RSS inconsistent between bonded and slaves

Message ID 20220608114548.25837-2-liudongdong3@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Andrew Rybchenko
Headers
Series app/test: fix bonding RSS test when disable RSS |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Dongdong Liu June 8, 2022, 11:45 a.m. UTC
  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(+)
  

Comments

Andrew Rybchenko June 9, 2022, 8:52 a.m. UTC | #1
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>
  

Patch

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 =