From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8B2BDA00C3; Tue, 18 Jan 2022 09:48:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 191684270F; Tue, 18 Jan 2022 09:48:41 +0100 (CET) Received: from cmccmta1.chinamobile.com (cmccmta1.chinamobile.com [221.176.66.79]) by mails.dpdk.org (Postfix) with ESMTP id 37F3840140; Tue, 18 Jan 2022 02:00:52 +0100 (CET) Received: from spf.mail.chinamobile.com (unknown[172.16.121.89]) by rmmx-syy-dmz-app03-12003 (RichMail) with SMTP id 2ee361e61142a40-f814c; Tue, 18 Jan 2022 09:00:50 +0800 (CST) X-RM-TRANSID: 2ee361e61142a40-f814c X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.112.105.130]) by rmsmtp-syy-appsvrnew05-12026 (RichMail) with SMTP id 2efa61e6113119e-c4a7b; Tue, 18 Jan 2022 09:00:50 +0800 (CST) X-RM-TRANSID: 2efa61e6113119e-c4a7b From: Yu Wenjun To: ferruh.yigit@intel.com, humin29@huawei.com, tangchengchang@huawei.com Cc: dev@dpdk.org, stable@dpdk.org, Yu Wenjun Subject: [PATCH] net/bonding: fix RSS not work for bonding Date: Tue, 18 Jan 2022 09:00:22 +0800 Message-Id: <20220118010022.274-1-yuwenjun@cmss.chinamobile.com> X-Mailer: git-send-email 2.32.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 18 Jan 2022 09:48:37 +0100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org RSS don't work when bond_ethdev_configure called before rte_eth_bond_slave_add in DPDK21.11. 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() Signed-off-by: Yu Wenjun Acked-by: Min Hu (Connor) --- 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 84f4900ee5..31bcee15cf 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -3504,6 +3504,11 @@ bond_ethdev_configure(struct rte_eth_dev *dev) 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)", -- 2.32.0.windows.1