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 B52C0A00C3 for ; Tue, 18 Jan 2022 09:49:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9FA66426ED; Tue, 18 Jan 2022 09:49:07 +0100 (CET) Received: from cmccmta2.chinamobile.com (cmccmta2.chinamobile.com [221.176.66.80]) by mails.dpdk.org (Postfix) with ESMTP id 3BD0840141; Mon, 17 Jan 2022 14:27:49 +0100 (CET) Received: from spf.mail.chinamobile.com (unknown[172.16.121.11]) by rmmx-syy-dmz-app05-12005 (RichMail) with SMTP id 2ee561e56ecd072-f38f0; Mon, 17 Jan 2022 21:27:44 +0800 (CST) X-RM-TRANSID: 2ee561e56ecd072-f38f0 X-RM-SPAM-FLAG: 00000000 Received: from yuwenjun_yewu@cmss.chinamobile.com ( [10.42.68.13] ) by ajax-webmail-syy-appsvr06-11006 (Richmail) with HTTP; Mon, 17 Jan 2022 21:27:44 +0800 (CST) Date: Mon, 17 Jan 2022 21:27:44 +0800 (CST) From: =?utf-8?Q?=E4=BF=9E=E6=96=87=E4=BF=8A=5Fyewu?= To: "ferruh.yigit" , humin29 , tangchengchang Cc: dev , stable Message-ID: <2afe61e566ebad1-00019.Richmail.00005001707698381847@cmss.chinamobile.com> Subject: [PATCH] net/bonding: fix RSS not work for bonding in DPDK21.11 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_37149_816465832.1642426064005" X-Priority: 3 X-RM-TRANSID: 2afe61e566ebad1-00019 X-RM-OA-ENC-TYPE: 0 X-RM-FontColor: 0 X-CLIENT-INFO: X-TIMING=0&X-MASSSENT=0&X-SENSITIVE=0 X-Mailer: Richmail_Webapp(V2.3.25) X-Mailman-Approved-At: Tue, 18 Jan 2022 09:49:06 +0100 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org ------=_Part_37149_816465832.1642426064005 Content-Type: text/plain;charset=UTF-8 Content-Transfer-Encoding: 7bit >From 85c4ffffe32996fc262dd6f69d0ce272ae8e8350 Mon Sep 17 00:00:00 2001 From: Yu Wenjun Date: Wed, 12 Jan 2022 15:01:10 +0800 Subject: [PATCH] net/bonding: fix RSS not work for bonding 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 ------=_Part_37149_816465832.1642426064005 Content-Type: text/html;charset=UTF-8 Content-Transfer-Encoding: 7bit >From 85c4ffffe32996fc262dd6f69d0ce272ae8e8350 Mon Sep 17 00:00:00 2001 From: Yu Wenjun Date: Wed, 12 Jan 2022 15:01:10 +0800 Subject: [PATCH] net/bonding: fix RSS not work for bonding 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 ------=_Part_37149_816465832.1642426064005--