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 3CF45A034C; Mon, 17 Jan 2022 11:24:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 28CED41190; Mon, 17 Jan 2022 11:24:06 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id A5E834067B; Mon, 17 Jan 2022 11:24:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642415045; x=1673951045; h=message-id:date:subject:from:to:cc:references: in-reply-to:content-transfer-encoding:mime-version; bh=CfmUgEn61b2Sv9FOj0sIIG9q8T/ZVYKl4dcj5fEvzyU=; b=OeeNQVYHgy0nF4ZONu2GhZDY8Su/j7Fo7RJ+sSrXYor3RhWU9pPpdkTH e6rg0R88dL20TeicgjjnMqoOE8tUDYHJoiGAYYar7QVJlp7UC8ybCyy5w B+OFvNVGvH7U/Q0qq5d/FRU/8USGNIEjAOAZsrL623Rw4wO0nNxP0341U OatkRw06HPusrUlTqBcmcfA+NQSeJnGvLmKbi/R4cUKR1rZQioO7OvPWa HSrL1mOdVkHTDmssAQg3EWa3AMx/bMtMeTXM0DEnElqitAfY9GPjjfAtP AfZZtZ3rx4rxcAumUb+74/rqXCB02vQ1bUuzdkksocvUX4+3DsjhPsR1j Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10229"; a="231955517" X-IronPort-AV: E=Sophos;i="5.88,295,1635231600"; d="scan'208";a="231955517" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2022 02:24:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,295,1635231600"; d="scan'208";a="693026498" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga005.jf.intel.com with ESMTP; 17 Jan 2022 02:24:03 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 17 Jan 2022 02:24:03 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 17 Jan 2022 02:24:03 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 17 Jan 2022 02:24:03 -0800 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (104.47.73.175) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 17 Jan 2022 02:24:02 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=duZf2eCiiOrHjqh8FRsuzQTPHMX4X2CBesg0as8YUzbxcwykmWIg4+xC8RwFWVvUICDZMPYp9wP9REOj06QZevUmomuny1Z3pGnn2gW9kPn3oZsG44IdKytkzIqwRfP8A2H5PXT65FCx+5sdE8jdJumnO4DIhkvYZ5LfNe7gewwVc+IPwG4coMj77aG5sfRZpAWllhi4A181Us40cxX1zYCQ8z6q3O4Nmv2iYYDXnFslS/tf6nd/VmRDd/MMinJoBiOBkRkgv8mO4sH2uCixL6GuA50qmOGLdj5vffpBPlDq9aJ94lzltPwQWDmTbOm5IMGqNqn2foT12FKjhv/R5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qo8e3nUj2hDGVuuVRsX4Ns4/OvtOGSq/ZSBdxzf92nA=; b=PxNhILNpVmqci+3dKM5zl+09Gq/IxQTYB+pr7JjC3Na9PVlPvdIys9rwFtKuKjmarG4/mCvRcfNep42Ae/q8Vayp64+q3m7fnkFTo2HR2anMPc67ylJMZcX6RlRsJA0chRSDYB62C9YPw0VHpUCdZN/JkBjxX3cHCLl3lHZu1vOGyHK8GTk/yxluDvq6J+vO7ArGKqOathPPd8YwivkNlG0spPzLF5dVC20JyCp3lvNyS5+sDw0fbOvwwjvWHNqaH38qQkEqYyYwlLyMAdaz8bVvXVPWCrjCgCNn39HmVvAMup8H6rgANTDDk6putzlMVRn1kl9N+hq2yrfj4/cyEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by BY5PR11MB4209.namprd11.prod.outlook.com (2603:10b6:a03:1cc::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.10; Mon, 17 Jan 2022 10:24:01 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4888.014; Mon, 17 Jan 2022 10:24:01 +0000 Message-ID: Date: Mon, 17 Jan 2022 10:23:55 +0000 Subject: Re: [PATCH] net/bonding: fix RSS not work for bonding in DPDK21.11 Content-Language: en-US From: Ferruh Yigit To: "Min Hu (Connor)" , =?UTF-8?B?5L+e5paH5L+KX3lld3U=?= , tangchengchang CC: dev , stable References: <2afa61de7b9e301-0000a.Richmail.00009021307638582857@cmss.chinamobile.com> <2b7a133a-3111-e814-d92c-d2252f9bd5e3@huawei.com> <2afc61e1200b486-00003.Richmail.00008071009648883857@cmss.chinamobile.com> <75052e5e-c6c4-0f6f-330d-48edb645131a@huawei.com> <2afc61e15071ff5-0000a.Richmail.00004081101678086847@cmss.chinamobile.com> <266630d7-6801-3ed6-fee0-ada4ba574d5b@huawei.com> <40c261f4-c942-0c29-5863-2a2379cdcc37@intel.com> X-User: ferruhy In-Reply-To: <40c261f4-c942-0c29-5863-2a2379cdcc37@intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0303.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:196::20) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 41ce0806-9d44-4d20-ded5-08d9d9a37a84 X-MS-TrafficTypeDiagnostic: BY5PR11MB4209:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C/xE9Q/xtN6/vIYOR5AoEURC0QLhINCxWk52Ghp69Rg5SpTqyjN5TArjABVM3ap5RiF2d8GP3XuPwgByAln+dtPQT11kWfufakhWDic8qJKOoOlIeCuqjgH+zlyygp255HIkkoXcAf2NmS61JVZDs+pmHhVWOgOiotO8jWlER2uZvgzVVcdGYYVk9hiZEUlHtVHLcuUwXVaSCukrWJjPO+waGhdpAplq6Okl4FZuk84FAjedy3rVIov1H8+zPp+77YQw9Wu1cLODvw7xmmGft7ZRhBsvslQn1f00AHGtOHYftK1ixLPPnsCNASZBkxdZkLWm2kVF+n/mw3FSQ4IYPynUzbrSATuZXNt1ltc9MGGNUr5fieQWNpbhzlfh+IQugeAioSoyAMooC2p6o4ta5/N0y7eNirzCcvteutEc2T/JpRd6AZr88EYpL1dXLcHYA1qEjCuwgsTiLf4yxIfBpu40HhRoKjJVaigYNsFaU5Z/LjBT9NZXlDS4GoXL0Dybdgth2ZYf42JDcqhZrszbEIVKwGdyRUW1Kn6yW3GFxGq5g09cZz/0zQgov/Z8Okk1foJNflqHTdFbFgZjqwjA+NWVkN3JagwUiZZ7HZxe+CQHKoKXiZ3HFpd08I6qQSfGadwpmK4Cg66h89N5hH91vDB12PMLJsxP9POJsj8DPq2TT0rSXWbry1y/UfpyX1u5OZoTapDBIXSjdEQqeIKBiy2wWH/C9SQdsuaXr1Q3EF4K+ZSk5nhjJu0DU++bVYOWbZaI6O4zvgkJEdwR6WQUF/GePhBMbJLTkW45NJIK1xo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(508600001)(36756003)(44832011)(2616005)(110136005)(6512007)(6666004)(54906003)(4326008)(26005)(66946007)(6506007)(31696002)(66476007)(8936002)(66556008)(5660300002)(82960400001)(31686004)(2906002)(316002)(53546011)(8676002)(6486002)(86362001)(966005)(38100700002)(83380400001)(186003)(30864003)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dFNIOXVHcnBybHhBQTgyaGpEMzZWTnhMRXRENklaTEptU1padHcyemwvZEpl?= =?utf-8?B?ekpZU2pRSExQZjMzTGRidUF4RFdXOVdOMnNTSGZ0dXM4KzJZM1d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0aFMydHJCNEtGdHk4enIrRjRLNHdQSVp0aEthQjlqcE9mUU1UYlNV?= =?utf-8?B?eUUxZmloVm1tUHR5Ulk0RjVmdXg4ZklIV3crb1EzQ1JNam9mRnFOa3VJUExk?= =?utf-8?B?UmMraE9GRlZTMmVjcU44VHdVNFpmRU0zaGZyK3k1VmpkMmViY043RFRrcUx2?= =?utf-8?B?M3JTOWkyYkt5TU5ocUVOS2pvZjk0OVJ3VVJDQVJRMmVTWms2dGRWK2NoYzF6?= =?utf-8?B?L3QvTkFRTk5FVWs0RVhRajc2UzdxMG5YQWdhUTh6anhpUmlBKzg1enRkZFZJ?= =?utf-8?Q?BIzra7cBblQkLbFosjorVM8=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 41ce0806-9d44-4d20-ded5-08d9d9a37a84 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2022 10:24:01.0560 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2lT3XlfZR7oy71N5BU8CwevmrQiDS16yPWFnukzIIc/Wzvz3mf4vSUskmD9EbRt9LgiWhy9WrrhMNDc0I3Y3lA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4209 X-OriginatorOrg: intel.com 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 On 1/17/2022 10:15 AM, Ferruh Yigit wrote: > On 1/15/2022 1:06 AM, Min Hu (Connor) wrote: >> Hi, >>      I got your meaning. >>      The key is the API call sequence about bond_ethdev_configure and >> rte_eth_bond_slave_add. testpmd ensure that rte_eth_bond_slave_add is >> first called before bond_ethdev_configure, so this is no bug. >>      Of course I also agree with this patch. >>      Thanks. >> > > Hi Yu Wenjun, > > The patch is not shown in the patchwork, I assume because of its format, > can you please send a new version as text only? > Using 'git send-email' is the easiet way for it, please check: > https://doc.dpdk.org/guides/contributing/patches.html > > Also Connor clarifies the issue above, can you please add this detail > about the issue in the next version? > Btw, please feel free to keep Connor's ack in next version. > Thanks, > ferruh > > >> >> 在 2022/1/14 19:14, 俞文俊_yewu 写道: >>> >>> Hi, I tested Mellanox CX5 and Intel E810. >>> >>> >>> The key is the call chain: >>> >>> 1.rte_eth_bond_create() >>> >>> 2.rte_eth_dev_configure(): bond_ethdev_configure() *//internals->rss_key_len = 0, internals->rss_key can not be set properly* >>> >>> 3.rte_eth_bond_slave_add(): __eth_bond_slave_add_lock_free()->eth_bond_slave_inherit_dev_info_rx_first() *// internals->rss_key_len will be set, but internals->rss_key is bad* >>> >>> 4.rte_eth_dev_start() >>> >>> >>> examples/bond/main.c(bond_port_init()) use this call chain,too many apps refer to this example. >>> >>> >>> thanks >>> >>> ----邮件原文---- >>> From:"Min Hu (Connor)"  >>> To:"俞文俊 _yewu" ,tangchengchang  ,"ferruh.yigit"  >>> Cc: dev  ,stable   >>> Date:2022-01-14 16:50:54 >>> Subject:Re: [PATCH] net/bonding: fix RSS not work for bonding in DPDK21.11 >>> >>> Hi, >>> >>> 在 2022/1/14 15:11, 俞文俊_yewu 写道: >>>  > Sorry,mq_mode is RTE_ETH_MQ_RX_RSS in rte_eth_conf. >>>  > >>>  > >>>  > call chain: >>>  > >>>  > rte_eth_bond_create()->rte_eth_dev_configure()->rte_eth_bond_slave_add()->rte_eth_dev_start() >>>  > >>>  > >>>  > Consider this call chain, internals->rss_key_len is 0 in >>>  > bond_ethdev_configure() when we call rte_eth_dev_configure(). >>>  > >>>  > If internals->rss_key_len is 0, internals->rss_key can not be set properly. >>> Have you done any test? Is it true that it doesn't work for RSS? which >>> NIC you choose ? >>> >>> As I know, internals->rss_key_len will inherit dev info from slave, just >>> see "eth_bond_slave_inherit_dev_info_rx_first". If slave port report >>> hash_key_size, internals->rss_key_len could not be zero. >>> >>>  > >>>  > Because memcpy in bond_ethdev_configure() use internals->rss_key_len(it >>>  > is 0) as copy size, and internals->rss_key will not be set in other >>>  > functions. >>>  > >>>  > >>>  > --- >>>  > >>>  > e.g.: >>>  > >>>  > bond_ethdev_configure(struct rte_eth_dev *dev) >>>  > >>>  > { >>>  > >>>  > const char *name = dev->device->name; >>>  > >>>  > struct bond_dev_private *internals = dev->data->dev_private; >>>  > >>>  > ... >>>  > >>>  > >>>  > /* >>>  > >>>  > * If RSS is enabled, fill table with default values and >>>  > >>>  > * set key to the value specified in port RSS configuration. >>>  > >>>  > * Fall back to default RSS key if the key is not specified >>>  > >>>  > */ >>>  > >>>  > 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 (rss_conf->rss_key != NULL) { >>>  > >>>  > if (internals->rss_key_len > rss_conf->rss_key_len) { >>>  > >>>  > RTE_BOND_LOG(ERR, "Invalid rss key length(%u)", >>>  > >>>  > rss_conf->rss_key_len); >>>  > >>>  > return -EINVAL; >>>  > >>>  > } >>>  > >>>  > >>>  > memcpy(internals->rss_key, rss_conf->rss_key, >>>  > >>>  >         internals->rss_key_len); >>>  > >>>  > } else { >>>  > >>>  > if (internals->rss_key_len > sizeof(default_rss_key)) { >>>  > >>>  > RTE_BOND_LOG(ERR, >>>  > >>>  >         "There is no suitable default hash key"); >>>  > >>>  > return -EINVAL; >>>  > >>>  > } >>>  > >>>  > >>>  > memcpy(internals->rss_key, default_rss_key, >>>  > >>>  >         internals->rss_key_len); >>>  > >>>  > } >>>  > >>>  > >>>  > >>>  > ----Origin---- >>>  > From:"Min Hu (Connor)"  >>>  > To:"yuwenjun_yewu" ,tangchengchang  ,"ferruh.yigit"  >>>  > Cc: dev  ,stable   >>>  > Date:2022-01-14 08:59:21 >>>  > Subject:Re: [PATCH] net/bonding: fix RSS not work for bonding in DPDK21.11 >>>  > >>>  > Hi, >>>  > >>>  > 在 2022/1/12 15:29, 俞文俊_yewu 写道: >>>  >  >  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 upgrade to DPDK21.11. >>>  > Cannot get your meaning, Why RSS don't work? >>>  > As mq_mode is not RTE_ETH_MQ_RX_RSS in rte_eth_conf, RSS is off. >>>  > Please make it clearer, thanks. >>>  > >>>  > >>>  >  > >>>  >  > >>>  >  > 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 >>>  >  > >>>  >  > >>>  > >>>  > Subject:Re: [PATCH] net/bonding: fix RSS not work for bonding in DPDK21.11 >>>  > >>>  > Hi, >>>  > >>>  > 在 2022/1/12 15:29, 俞文俊_yewu 写道: >>>  >  >  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 upgrade to DPDK21.11. >>>  > Cannot get your meaning, Why RSS don't work? >>>  > As mq_mode is not RTE_ETH_MQ_RX_RSS in rte_eth_conf, RSS is off. >>>  > Please make it clearer, thanks. >>>  > >>>  > >>>  >  > >>>  >  > >>>  >  > 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 >>>  >  > >>>  >  > >>>  > >>> >>> Subject:Re: [PATCH] net/bonding: fix RSS not work for bonding in DPDK21.11 >>> >>> Hi, >>> >>> 在 2022/1/14 15:11, 俞文俊_yewu 写道: >>>  > Sorry,mq_mode is RTE_ETH_MQ_RX_RSS in rte_eth_conf. >>>  > >>>  > >>>  > call chain: >>>  > >>>  > rte_eth_bond_create()->rte_eth_dev_configure()->rte_eth_bond_slave_add()->rte_eth_dev_start() >>>  > >>>  > >>>  > Consider this call chain, internals->rss_key_len is 0 in >>>  > bond_ethdev_configure() when we call rte_eth_dev_configure(). >>>  > >>>  > If internals->rss_key_len is 0, internals->rss_key can not be set properly. >>> Have you done any test? Is it true that it doesn't work for RSS? which >>> NIC you choose ? >>> >>> As I know, internals->rss_key_len will inherit dev info from slave, just >>> see "eth_bond_slave_inherit_dev_info_rx_first". If slave port report >>> hash_key_size, internals->rss_key_len could not be zero. >>> >>>  > >>>  > Because memcpy in bond_ethdev_configure() use internals->rss_key_len(it >>>  > is 0) as copy size, and internals->rss_key will not be set in other >>>  > functions. >>>  > >>>  > >>>  > --- >>>  > >>>  > e.g.: >>>  > >>>  > bond_ethdev_configure(struct rte_eth_dev *dev) >>>  > >>>  > { >>>  > >>>  > const char *name = dev->device->name; >>>  > >>>  > struct bond_dev_private *internals = dev->data->dev_private; >>>  > >>>  > ... >>>  > >>>  > >>>  > /* >>>  > >>>  > * If RSS is enabled, fill table with default values and >>>  > >>>  > * set key to the value specified in port RSS configuration. >>>  > >>>  > * Fall back to default RSS key if the key is not specified >>>  > >>>  > */ >>>  > >>>  > 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 (rss_conf->rss_key != NULL) { >>>  > >>>  > if (internals->rss_key_len > rss_conf->rss_key_len) { >>>  > >>>  > RTE_BOND_LOG(ERR, "Invalid rss key length(%u)", >>>  > >>>  > rss_conf->rss_key_len); >>>  > >>>  > return -EINVAL; >>>  > >>>  > } >>>  > >>>  > >>>  > memcpy(internals->rss_key, rss_conf->rss_key, >>>  > >>>  >         internals->rss_key_len); >>>  > >>>  > } else { >>>  > >>>  > if (internals->rss_key_len > sizeof(default_rss_key)) { >>>  > >>>  > RTE_BOND_LOG(ERR, >>>  > >>>  >         "There is no suitable default hash key"); >>>  > >>>  > return -EINVAL; >>>  > >>>  > } >>>  > >>>  > >>>  > memcpy(internals->rss_key, default_rss_key, >>>  > >>>  >         internals->rss_key_len); >>>  > >>>  > } >>>  > >>>  > >>>  > >>>  > ----Origin---- >>>  > From:"Min Hu (Connor)"  >>>  > To:"yuwenjun_yewu" ,tangchengchang  ,"ferruh.yigit"  >>>  > Cc: dev  ,stable   >>>  > Date:2022-01-14 08:59:21 >>>  > Subject:Re: [PATCH] net/bonding: fix RSS not work for bonding in DPDK21.11 >>>  > >>>  > Hi, >>>  > >>>  > 在 2022/1/12 15:29, 俞文俊_yewu 写道: >>>  >  >  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 upgrade to DPDK21.11. >>>  > Cannot get your meaning, Why RSS don't work? >>>  > As mq_mode is not RTE_ETH_MQ_RX_RSS in rte_eth_conf, RSS is off. >>>  > Please make it clearer, thanks. >>>  > >>>  > >>>  >  > >>>  >  > >>>  >  > 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 >>>  >  > >>>  >  > >>>  > >>>  > Subject:Re: [PATCH] net/bonding: fix RSS not work for bonding in DPDK21.11 >>>  > >>>  > Hi, >>>  > >>>  > 在 2022/1/12 15:29, 俞文俊_yewu 写道: >>>  >  >  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 upgrade to DPDK21.11. >>>  > Cannot get your meaning, Why RSS don't work? >>>  > As mq_mode is not RTE_ETH_MQ_RX_RSS in rte_eth_conf, RSS is off. >>>  > Please make it clearer, thanks. >>>  > >>>  > >>>  >  > >>>  >  > >>>  >  > 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 >>>  >  > >>>  >  > >>>  > >>> >