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 4BCE6A04A4; Wed, 19 Jan 2022 10:02:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13339410F5; Wed, 19 Jan 2022 10:02:23 +0100 (CET) Received: from cmccmta3.chinamobile.com (cmccmta3.chinamobile.com [221.176.66.81]) by mails.dpdk.org (Postfix) with ESMTP id 8FB244068E; Tue, 18 Jan 2022 10:19:20 +0100 (CET) Received: from spf.mail.chinamobile.com (unknown[172.16.121.81]) by rmmx-syy-dmz-app10-12010 (RichMail) with SMTP id 2eea61e686139f5-00229; Tue, 18 Jan 2022 17:19:16 +0800 (CST) X-RM-TRANSID: 2eea61e686139f5-00229 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain.localdomain (unknown[223.112.105.130]) by rmsmtp-syy-appsvrnew01-12030 (RichMail) with SMTP id 2efe61e685edf69-df8a5; Tue, 18 Jan 2022 17:18:46 +0800 (CST) X-RM-TRANSID: 2efe61e685edf69-df8a5 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 v2] net/bonding: fix RSS not work for bonding Date: Tue, 18 Jan 2022 17:18:52 +0800 Message-Id: <1642497532-16596-1-git-send-email-yuwenjun@cmss.chinamobile.com> X-Mailer: git-send-email 1.8.3.1 X-Mailman-Approved-At: Wed, 19 Jan 2022 10:02:22 +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. 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 --- 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