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 5E023A034C; Mon, 17 Jan 2022 11:16:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C40B14118A; Mon, 17 Jan 2022 11:16:02 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id A30AC4067B; Mon, 17 Jan 2022 11:15:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642414560; x=1673950560; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=VbdFzK9GZS+kwi1rtBrQxjG2/CtdCgJRieKHMIzaZb8=; b=kB7HZ8V1YjQQXTwbLuDoGXJe3GzKNROgovOdDcfcqanaODVk2db1dtLf l0IBC2pejEhJ8erWGvvSKwZZKGaSPW/uFyoOi2EmKVmFpSSpE1YLUKmX4 mqEF9gYFfw3vKTiW0Gkn0uSnyxJQoOyiwUNEyuCdcE0S5L33KoW5si6mE j0A6hpDbPUEyK+4C9LOHb8K2aBENKXndl/GoMDpgsU6vCf0zOR3y4ptAO aOY03Fgzedu/IGk6L6WFVaFl0cPG/9UK26Y7vW4f+EE6ouuVPjCO7AZkA ez6K/EIDnwfqThAf2HmrWGGvj0KUYmq1Huey/Su78OGGb5eH7oN8fzUPa w==; X-IronPort-AV: E=McAfee;i="6200,9189,10229"; a="244395780" X-IronPort-AV: E=Sophos;i="5.88,295,1635231600"; d="scan'208";a="244395780" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2022 02:15:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,295,1635231600"; d="scan'208";a="621767663" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga002.fm.intel.com with ESMTP; 17 Jan 2022 02:15:52 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) 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:15:51 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX611.amr.corp.intel.com (10.22.229.24) 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:15:51 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) 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:15:51 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.173) by edgegateway.intel.com (134.134.137.102) 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:15:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aC7yTHJUN8Wf/DWQ+kuecBKvGWP66BawaOfsDyJVJOpHfr+AQ29j4W9m4nkc10tJxpzoWgYeCOItD9FRj+uEvrSgSa5xLRMkxdkkFYHabbo8ttM1Gtq+HQ1qmSi46JADl0kVIAoe6lEF6uWGb3rV0RqeSsljMno64zTni8LoKoiTi7VJUMzUo70sx+7UjCnXBYZ9/9DwX+zRYZnRVjQLLPPzkESLqzaUrSPmGBcYJDoez/r0EnF+37LUr24/37z6GufKaYfUIDZJM7RCzdSHV4EBDdViOfloWHx9ql11WW2Su+jc6e8obTqUDjW0ZKu5Ae55bKINvrMH/XGGart4kw== 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=u4la/VABEtXKiVNCEEtC6hpy7oW/mUJ2mDujhet48Qg=; b=KA1WLce0dE1LL1cVPLztjPOGgoePCv/8dc9UFeXwtCwMJsrk7bCPUHJgJKHRO0hn5pInFJwyatLmgMVkYpEcBI2Sb0zYn405l6YNawhkEWsOkDUxfy535AzRkpvSoDKnC/n2LZbVEF4IavNRPPDQO2GN98zTdwKHaGpaXty+W5KbVV3J4i+Ws0uWy8iZ6wGX21/+kTjhLVSkTL6psDoWMEt9+b/qOeakZOo8m4QsGezvcqa8mEPJBl3ShWvAZmdpNnHA2KYsPpYj2C/PZ0kR/As1YWK3ln+lp/7h9gI+yxPMcYIeAaIqnwfq2lF8oD2N12Z6EHtHUZszwZMhTE2Pdw== 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 PH7PR11MB5943.namprd11.prod.outlook.com (2603:10b6:510:13f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Mon, 17 Jan 2022 10:15:49 +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:15:48 +0000 Message-ID: <40c261f4-c942-0c29-5863-2a2379cdcc37@intel.com> Date: Mon, 17 Jan 2022 10:15:39 +0000 Content-Language: en-US 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> From: Ferruh Yigit Subject: Re: [PATCH] net/bonding: fix RSS not work for bonding in DPDK21.11 X-User: ferruhy In-Reply-To: <266630d7-6801-3ed6-fee0-ada4ba574d5b@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO2P265CA0460.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a2::16) 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: 96412121-cd7f-4b64-16ad-08d9d9a2534b X-MS-TrafficTypeDiagnostic: PH7PR11MB5943: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: LNwlMxLBmyjtDnYQ3fnDQkle9xhn6Ub0KmgCMjbIEXRCMupf9GO/RzZUjeRqMV6jU18NjrokrDqyoHpRwdkwSJyRPPf1UKjsl1WKTP+kY+ZqNYSvOX41f+5tA/ifo18+PxFQ0x1QJuQrBKHFOZlcFanmvqxrtjRUDn29b0RM24duSAgVRsH64FiNW8ONf1yO0cZH6ABJvtBvXCs6QbyaO+gImewcs25BNSIkykZetbK0RHb/2aH4O47XfSqc0AOz/Y/4ofegsHkmDUkUzVAQkTgrhN1L75kR+5a0xzlX2eveU/zSYQE1uD+8Y0wtDaIDMx4ShjY6nJ71HS1XEWcBQPeYEc9PFBOw8cy8CuAuxC/0XLshNB9xxUvkLAJGT63UyVLo1uDtqwfIwHwCOpkEMJBKcljJE3YGxATRgZODy14XEOWvPsqy8fA4lds824dai2kRoKL6yxOXVHEq0/kOySzCInxzKB8vCzNI9/sXX8KejH3Ja0MQCHd2fenESQFEjhb7HKds+POCdDZUsD4yKOFYNCAyVVhPjniDKPqsqwW1N7A58rNKc7dw0CNMzhqFJj+paB0/qn05urdNY5iO7WQFyRPFOYuZQPH6bp8d5Z1wMXcWU75otyGkYbkQc9rgGOMpoL9QxiXRlE6EMl8gFiLtfVQ4O0zGUizeZGfzOM7Kspcu/rCRuh7rgk0l0epXW/sTgKSP/7w65TnNsl/IHJVyVe/kEvQ2bvDh/wHhujPeINoXMu0j4m9Yry9ReiljQw/UwIFwGOe9XztM3xABGcnfBqPVwGxjvekROhv8TLE= 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)(316002)(6666004)(110136005)(5660300002)(6486002)(54906003)(2616005)(6512007)(8676002)(44832011)(66476007)(66556008)(66946007)(53546011)(26005)(86362001)(82960400001)(31686004)(4326008)(6506007)(8936002)(186003)(83380400001)(36756003)(30864003)(508600001)(38100700002)(31696002)(966005)(2906002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NkI2UndMNHFoNE9LRTVrYkNNWVpXUUVvR3A0UkxlY2czdEZURGtZN0UxQkZS?= =?utf-8?B?dmdYWXhjcW1CSUVWVThURDkrQktEd3VoU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EhxQ0Zy?= =?utf-8?B?OFlJWUd1ZjEzV3B3Rm9MMUtxL2dqSlRNbjVqRENHOHJCUHBBTjVHekE3SEZj?= =?utf-8?B?dUVhbnNGb0tqVkpIdGRUOEE1eVhTNlRvUnFOcGt2Y3RTY2tCWUdxbllPNzJG?= =?utf-8?B?N0srVnVCc2grU2xmTUZsOGdodHdNTGFvMytNZ1A0MlQ5T3ZLWXFNc3NULzF2?= =?utf-8?B?djQwZG9YVDBQMGJPS3JjRFFYZStVUFhNLzF2cE4xSmp1N0FSdGxHeHlrc0dH?= =?utf-8?B?L1RZMm41VFE1YU1JTzZJc0kxZVh3TFBKT0N3dnVkbGtTOWRaRjhHeVNVVTY1?= =?utf-8?Q?BPndzxDBOgBI6nYr6yYjxk4=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 96412121-cd7f-4b64-16ad-08d9d9a2534b 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:15:45.9213 (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: LJqXaUvWt3bYnZOz/oKceppuwKLoh1pzkWU2cVW01CADyAq3+oszrCJGYeqEuSAZ/p/smdhjSxm98F3cRSqaIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB5943 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/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? 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 >>  >  > >>  >  > >>  > >>