DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yu Wenjun <yuwenjun@cmss.chinamobile.com>
To: ferruh.yigit@intel.com, humin29@huawei.com, tangchengchang@huawei.com
Cc: dev@dpdk.org, stable@dpdk.org, Yu Wenjun <yuwenjun@cmss.chinamobile.com>
Subject: [PATCH v2] net/bonding: fix RSS not work for bonding
Date: Tue, 18 Jan 2022 17:18:52 +0800	[thread overview]
Message-ID: <1642497532-16596-1-git-send-email-yuwenjun@cmss.chinamobile.com> (raw)

RSS don't work when bond_ethdev_configure called before
rte_eth_bond_slave_add.

e.g.:
dont't work(examples/bond/main.c):
rte_eth_bond_create()
rte_eth_dev_configure()
rte_eth_bond_slave_add()
rte_eth_dev_start()

work(testpmd):
rte_eth_bond_create()
rte_eth_bond_slave_add()
rte_eth_dev_configure()
rte_eth_dev_start()

Fixes: 6b1a001ec546 ("net/bonding: fix RSS key length")
Cc: stable@dpdk.org

Signed-off-by: Yu Wenjun <yuwenjun@cmss.chinamobile.com>
---
v2:
- Fixed patch format.

 drivers/net/bonding/rte_eth_bond_pmd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 84f4900..31bcee1 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3504,6 +3504,11 @@ struct bwg_slave {
 	if (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS) {
 		struct rte_eth_rss_conf *rss_conf =
 			&dev->data->dev_conf.rx_adv_conf.rss_conf;
+
+		if (internals->rss_key_len == 0) {
+			internals->rss_key_len = sizeof(default_rss_key);
+		}
+
 		if (rss_conf->rss_key != NULL) {
 			if (internals->rss_key_len > rss_conf->rss_key_len) {
 				RTE_BOND_LOG(ERR, "Invalid rss key length(%u)",
-- 
1.8.3.1




             reply	other threads:[~2022-01-19  9:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-18  9:18 Yu Wenjun [this message]
2022-01-18  9:27 ` Min Hu (Connor)
2022-01-26 15:50   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1642497532-16596-1-git-send-email-yuwenjun@cmss.chinamobile.com \
    --to=yuwenjun@cmss.chinamobile.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=humin29@huawei.com \
    --cc=stable@dpdk.org \
    --cc=tangchengchang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).