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 BAA5BA034D; Wed, 12 Jan 2022 10:10:36 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26C2441C2E; Wed, 12 Jan 2022 10:10:36 +0100 (CET) Received: from cmccmta3.chinamobile.com (cmccmta3.chinamobile.com [221.176.66.81]) by mails.dpdk.org (Postfix) with ESMTP id 70F2340141; Wed, 12 Jan 2022 08:29:22 +0100 (CET) Received: from spf.mail.chinamobile.com (unknown[172.16.121.3]) by rmmx-syy-dmz-app09-12009 (RichMail) with SMTP id 2ee961de834e6db-ab179; Wed, 12 Jan 2022 15:29:20 +0800 (CST) X-RM-TRANSID: 2ee961de834e6db-ab179 X-RM-SPAM-FLAG: 00000000 Received: from yuwenjun_yewu@cmss.chinamobile.com ( [10.42.68.13] ) by ajax-webmail-syy-appsvr02-11002 (Richmail) with HTTP; Wed, 12 Jan 2022 15:29:19 +0800 (CST) Date: Wed, 12 Jan 2022 15:29:19 +0800 (CST) From: =?utf-8?Q?=E4=BF=9E=E6=96=87=E4=BF=8A=5Fyewu?= To: tangchengchang , humin29 , "ferruh.yigit" Cc: dev , stable Message-ID: <2afa61de7b9e301-0000a.Richmail.00009021307638582857@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_127043_1555449423.1641972559880" X-Priority: 3 X-RM-TRANSID: 2afa61de7b9e301-0000a 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.24) X-Mailman-Approved-At: Wed, 12 Jan 2022 10:10:35 +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 ------=_Part_127043_1555449423.1641972559880 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 don39t work when upgrade to DPDK21.11. e.g.: examples/bond/main.c: conf: static struct rte_eth_conf port_conf = { .rxmode = { .mq_mode = RTE_ETH_MQ_RX_NONE, .split_hdr_size = 0, }, .rx_adv_conf = { .rss_conf = { .rss_key = NULL, .rss_hf = RTE_ETH_RSS_IP, }, }, .txmode = { .mq_mode = RTE_ETH_MQ_TX_NONE, }, } call chain: rte_eth_bond_create()->rte_eth_dev_configure()->rte_eth_bond_slave_add()->rte_eth_dev_start() Signed-off-by: Yu Wenjun --- 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_127043_1555449423.1641972559880 Content-Type: text/html;charset=UTF-8 Content-Transfer-Encoding: quoted-printable

From 85c4ffffe32996fc262dd6f69d0ce272ae8e8350 Mon Sep 17 00:00:00 2001

From: Yu Wenjun <yuwenjun_yewu@cmss.chinamobile.com>

Date:= Wed, 12 Jan 2022 15:01:10 +0800

Subject: [PATCH] net/bonding: fix RS= S not work for bonding


RSS don't work when upgrade to= DPDK21.11.


e.g.:

examples/bond/main.c:

conf:=

static struct rte_eth_conf port_conf =3D {

=09.rxmode =3D {

= =09=09.mq_mode =3D RTE_ETH_MQ_RX_NONE,

=09=09.split_hdr_size =3D 0,

=09},

=09.rx_ad= v_conf =3D {

=09=09.rss_conf = =3D {

=09=09=09.rss_key =3D NU= LL,

=09=09=09.rss_hf =3D RTE_E= TH_RSS_IP,

=09=09},

=09},

=09.txmode =3D {

=09=09.mq_mode =3D RTE_ETH_MQ_TX_NONE,

= =09},

};


call chain:

rte_eth_bond_crea= te()->rte_eth_dev_configure()->rte_eth_bond_slave_add()->rte_eth_d= ev_start()


Signed-off-by: Yu Wenjun <yuwenjun_yewu@cms= s.chinamobile.com>

---

 drivers/net/bonding/rte_eth_bon= d_pmd.c | 5 +++++

 1 file changed, 5 insertions(+)


diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bond= ing/rte_eth_bond_pmd.c

index 84f4900ee5..31bcee15cf 100644

--- = a/drivers/net/bonding/rte_eth_bond_pmd.c

+++ b/drivers/net/bonding/rt= e_eth_bond_pmd.c

@@ -3504,6 +3504,11 @@ bond_ethdev_configure(struct = rte_eth_dev *dev)

 =09if = (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS) {

=  =09=09struct rte_eth_rss_conf = *rss_conf =3D

 =09=09=09&= amp;dev->data->dev_conf.rx_adv_conf.rss_conf;

+

+=09=09if (internals->rss_key_len =3D=3D 0= ) {

+=09=09=09internals->rs= s_key_len =3D sizeof(default_rss_key);

+=09=09}

+

 =09= =09if (rss_conf->rss_key !=3D NULL) {

 =09=09=09if (internals->rss_key_len > rss_con= f->rss_key_len) {

 =09=09=09= =09RTE_BOND_LOG(ERR, "Invalid rss key length(%u)",

-= - 

2.32.0.windows.1


------=_Part_127043_1555449423.1641972559880--