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 9D6C745F43; Thu, 26 Dec 2024 02:26:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F716402A8; Thu, 26 Dec 2024 02:26:46 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2093.outbound.protection.outlook.com [40.107.212.93]) by mails.dpdk.org (Postfix) with ESMTP id C26FE402A5; Thu, 26 Dec 2024 02:26:44 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gDxHrtaQf5uOZs1Lahi19fgcpjoGnB1zegxUm5dS+jM0s7Nw1uh1ZNB4lTmXhnS88hbQixfamIZTsjwreuYTcUMZmelOIpebC+6DMrglS8sVX3Mf+CeGZN5X0rHxbdjf5NrsFIDRrSyQUiyvn9iaM4XQaxreEgDoo0jv2GYCxLTF7gs63ciUVdMVgqhMKBit2Pa098iOFkCoKdt4YfG/vd2Lm6v16DDxuOGfhGqRCjCnzCwJ4stbTx6oxy5V25HfTMgLOCAyAY1nc6ORjL4zbThEwbUC2lMlhRF7e3hbT2xn5oKTg8hh4KIX6soqI7LXupc7oFeJlX+3vP4/kfq+ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=tT5Kckz5ajlDmHhr/dg+F10HcvpHfWOuM6uFPOcAtkQ=; b=GCadLN7CcXjGkMmiYQnlve05z6ydfFCiyxIXMVwNdzjbtjKMMRufkPjdXRElIRf45/kFfsnwvozRziBKMRWrYZIG6tAzZh39uBWdK7rngPVQPiIQ8JVcIl6jVbSsg8JQuxbgr7Y8hwabD0tqEAVVAA2dOpvsZelSjIayP7salmjzBsQbsc3g4eR3nIFvv0FD4o0aIE1/0+7JNYVP8gQ0Bou7IRmr/kXt7xf8U9OAntw5P+rKAoyZxJCFOJBeYhZ9cE075SvLMD4c1sbzGOMg1hOn7IoVmwCEGAT4KqxMpP+IUrFKhYM/MQvSxUs3Mgf0xYE9wpRP/7EIZT2yPuBGqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tT5Kckz5ajlDmHhr/dg+F10HcvpHfWOuM6uFPOcAtkQ=; b=GZOaz//EHgiv66hPJv4/3OJgX4h2OswnWlL7wLQeDV4oJJH/2zLxFp5Qz1dgVQyehE/eXbX2FoggiwB7qjTRQoZ0KP3hvGHXA8+jNDx/309ShWRLoEV1XwZktGPPh+eM+2N5Jk35aWT7lvdrjCE1cDjZ+0KAQtRGyyWG1wXKQs4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by BL0PR13MB4452.namprd13.prod.outlook.com (2603:10b6:208:1c3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8293.14; Thu, 26 Dec 2024 01:26:38 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%6]) with mapi id 15.20.8293.000; Thu, 26 Dec 2024 01:26:37 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , tomaszx.kulasek@intel.com, stable@dpdk.org, Chaoyong He Subject: [PATCH v3] net/bonding: fix dedicated queue setup failed Date: Thu, 26 Dec 2024 09:26:18 +0800 Message-ID: <20241226012618.13535-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20241011032412.3672788-3-chaoyong.he@corigine.com> References: <20241011032412.3672788-3-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR01CA0069.prod.exchangelabs.com (2603:10b6:a03:94::46) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BL0PR13MB4452:EE_ X-MS-Office365-Filtering-Correlation-Id: 43a1d502-8745-4aaa-51cb-08dd254c5749 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?yXaFm3upazz9PDj/Gi29WTlEtISN+mDT8TthQv5Xvwmm89nBqg+BmfxrszVN?= =?us-ascii?Q?A3cGAiPpYfSNAjXxviRIjZhP+fL9kdv3GrHcuU3sgmWdIOmOaqqCgHzVan96?= =?us-ascii?Q?VovSc1uwY/y+pqjjElAgc2G8iTFnpRl7P6aDTTGKYYmp5j+OPCFn9WRvzb4Z?= =?us-ascii?Q?32YSNe5EimjxFYUSkWunx18IkYRV9SqmVyV+H9XThKFT+15RS+rlQGvWvJ7R?= =?us-ascii?Q?z57LX0FJTlKJU8nTo8q5/CQxIBgD6kftckbHkmZ5JKV/tvQGP8VG1asqMqQm?= =?us-ascii?Q?A+yCHYC5A+wn8/8ISJ9zVZWhMQeE0Z/mg7gG/gERgZ1lGoRn2qDOxKdydsjt?= =?us-ascii?Q?geU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qSlFNJHQ6B8SP1G0+4JHLywjok?= =?us-ascii?Q?W5bJChVBmJ1nE70hstSH7omV/oed7UznXxmHMd+3Y195o7AFWFvlfudEIsfG?= =?us-ascii?Q?gEanBjWU5+gypzviYNklnXWMHGpxEUbcCZOoWI+gocaon25kEeLqrCPMnH7C?= =?us-ascii?Q?a2iiBO0n6uVabh1lE1l9oQ31unn39PdmBO+nSzo/sn5H/UmCeHciCSS5OUpY?= =?us-ascii?Q?Cbd7DBI5ivmo4niL18tm2ZXiJ6N5WT0u?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?a0ElnUDGRluKNYS8MjAzag4YiamMeZ1+mxvQcUjhtLLMs3FNlssaIuoVRA36?= =?us-ascii?Q?BSlIumr0cxRj50cvHXv/85jG+O0llfzwhPop8lqJ6ftSNkADaVj1jyliXJ3Z?= =?us-ascii?Q?KQA5Pgcy4nr+1miFKeXy/LlryFoZ5da+iCY9zZZF78iRdKyT6OBL87cW0yRv?= =?us-ascii?Q?/hdZwCyyaLQC1EIEnUryDgQCVpGLj2fkr2O0IoTbOfNzl+2EPb+TsTrxExnT?= =?us-ascii?Q?sgRUm4EuaqSOv/S1vgiNcjGLjcsqsGL/RW0FGMvV5j0bLuG0DklT8Jf+Jcj2?= =?us-ascii?Q?2hNwmbpxnSqNU18lTpv+4i5QOKl3/J2UUlsyF4PAPcrQV6swxoMM35/i7hrG?= =?us-ascii?Q?vAnG8QskRMYmxe4nKpmZR/Pkf/t26si5qIppL1dTbfPHmXBqXRSolzuYgNr8?= =?us-ascii?Q?2sEvCEpO/OtvzsxDCVo3su8HZZNTU6QOibJh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pcguf3ukajiB+bk4FSRZK2KkLsH+bkV9gH/TfFLJ?= =?us-ascii?Q?b++hBxwU1Ur3wMi353Ptoa/aKjIcCIaOq53VS1sSBZHfrdSYv27bTSvbHibt?= =?us-ascii?Q?D4NZHytJ8cA5zlXjnuMaHfLIXmFJ8mYCC2F9yHrNwoE1fcePGOmp5y7GfC6X?= =?us-ascii?Q?+NC0YJY/L8DKkO2o4GWhadKiQX3cgeESBNUGX86iXVJLHXpEop4nlhSV8JPx?= =?us-ascii?Q?sdhfkN587RbSpsMe9/HKCAEDI8Tzy44ka7qmgs5AcElnueSU3/9f+XX1nYPb?= =?us-ascii?Q?tA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43a1d502-8745-4aaa-51cb-08dd254c5749 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2024 01:26:37.1553 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: o8XN/2D8+VxzzXLL12jmJ4SKfc/uGjfF3WZJUS7tRoe/4vUWtmA/L59jdc7cye4ATuXXKl49OCIXn8b4nyDtc/wDQIppALh3jwryALm7R/c= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR13MB4452 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 From: Long Wu The bonding PMD hardcoded the value of dedicated hardware Rx/Tx queue size as (128/512). This will cause the bonding port start fail if some NIC requires more Rx/Tx descriptors than the hardcoded number. Therefore, use the minimum hardware queue size of the member port to initialize dedicated hardware Rx/Tx queue. If obtaining the minimum queue size failed, use the default queue size. Fixes: 112891cd27e5 ("net/bonding: add dedicated HW queues for LACP control") Cc: tomaszx.kulasek@intel.com Cc: stable@dpdk.org Signed-off-by: Long Wu Reviewed-by: Chaoyong He --- v3: * Get the minimal supported queue size from PMD, rather than add an new API. v2: * Adjust some logs following the request of reviewer. --- drivers/net/bonding/rte_eth_bond_8023ad.h | 3 +++ drivers/net/bonding/rte_eth_bond_pmd.c | 25 ++++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index 5432eafcfe..f827229671 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -35,6 +35,9 @@ extern "C" { #define MARKER_TLV_TYPE_INFO 0x01 #define MARKER_TLV_TYPE_RESP 0x02 +#define SLOW_TX_QUEUE_HW_DEFAULT_SIZE 512 +#define SLOW_RX_QUEUE_HW_DEFAULT_SIZE 512 + typedef void (*rte_eth_bond_8023ad_ext_slowrx_fn)(uint16_t member_id, struct rte_mbuf *lacp_pkt); diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 91bf2c2345..9d72140b82 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1684,10 +1684,26 @@ member_configure_slow_queue(struct rte_eth_dev *bonding_eth_dev, } if (internals->mode4.dedicated_queues.enabled == 1) { - /* Configure slow Rx queue */ + struct rte_eth_dev_info member_info = {}; + uint16_t nb_rx_desc = SLOW_RX_QUEUE_HW_DEFAULT_SIZE; + uint16_t nb_tx_desc = SLOW_TX_QUEUE_HW_DEFAULT_SIZE; + + errval = rte_eth_dev_info_get(member_eth_dev->data->port_id, + &member_info); + if (errval != 0) { + RTE_BOND_LOG(ERR, + "rte_eth_dev_info_get: port=%d, err (%d)", + member_eth_dev->data->port_id, + errval); + return errval; + } + if (member_info.rx_desc_lim.nb_min != 0) + nb_rx_desc = member_info.rx_desc_lim.nb_min; + + /* Configure slow Rx queue */ errval = rte_eth_rx_queue_setup(member_eth_dev->data->port_id, - internals->mode4.dedicated_queues.rx_qid, 128, + internals->mode4.dedicated_queues.rx_qid, nb_rx_desc, rte_eth_dev_socket_id(member_eth_dev->data->port_id), NULL, port->slow_pool); if (errval != 0) { @@ -1699,8 +1715,11 @@ member_configure_slow_queue(struct rte_eth_dev *bonding_eth_dev, return errval; } + if (member_info.tx_desc_lim.nb_min != 0) + nb_tx_desc = member_info.tx_desc_lim.nb_min; + errval = rte_eth_tx_queue_setup(member_eth_dev->data->port_id, - internals->mode4.dedicated_queues.tx_qid, 512, + internals->mode4.dedicated_queues.tx_qid, nb_tx_desc, rte_eth_dev_socket_id(member_eth_dev->data->port_id), NULL); if (errval != 0) { -- 2.43.5