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 88BE945B0C; Fri, 11 Oct 2024 05:24:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 216A640A6F; Fri, 11 Oct 2024 05:24:39 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2102.outbound.protection.outlook.com [40.107.94.102]) by mails.dpdk.org (Postfix) with ESMTP id 8A9F040678 for ; Fri, 11 Oct 2024 05:24:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NODRcoJoeW/bzzmNOnCR7w/E5tRkkAthxv9N8rONdUzz5lAx+jw4JHnBW9ISkhb9wMOk6ypbHuzdb5bLoruZlpTGkAnsTeRt+u1gyTS1MU0GNgw5UshQCMrzYneieTuFCCB6Od528V/iKKko0TyfcZUT5NgEoc1iHTpSo/vEsVWArFviu2UluUbMeLD0RW4q1wpHqLmPlmxixyl8pifn55gdbWNxSAta3qG3Js6ioyFQPpFLbGgF53o1JCt9seXAmaMrWqmVY1QNeqNubGYLOrDRaB+uffJHzumUvdMPklyDYFZxxRyUziBDlXpUoDtfJN1tV138VcpDppMZWsbAgg== 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=iIyCqvmc+Pv2bKyYxrnHXOnnNfE5gmka04eFUDwhnFw=; b=ItrqZd8ZftwQlny2M5mO5cZnTuBbBBE4QLV+mLz4wlyDLnZV1aiJGTvqApDu+SVaqPFjkjrwQncpMoSpA5MlSnHVT+0n9cP+3RyPOZTmnTpzEfXzm5jUGPiyw4z5RZX6lSfGlseGQHrzuuTdVrulaVENmt2KqhBT0L+6Um7nd/Kd2Xx+2x8rG5ogH8xShoL+Gl7QRV49lnTvHvYrmCQNKaqP0oJsbLzx+o1b11GOfxfUPruBEkdJGzl4CKkGBN4kFfw8Cev7HeLvnciT0ElTPe4THfDISKrRINO0aWxmLCGguoWcZv1wXB0rSyPm7QbZtOw6fh9azw24XHgdDNilSg== 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=iIyCqvmc+Pv2bKyYxrnHXOnnNfE5gmka04eFUDwhnFw=; b=YLXym7q2RidW/Hd+JDfgDigwZuwxYo+lzZ0hBCnc1aG68sEoBunZ4sETcFiIl155cWYEYssx4zQXSs7TXqUnFxDabzJZnyzikfFypOMruu9xYPQpKJSqY+HdxLkEdZB8in6IpBBr4pv9vw+oJGzJ8DM+QFfpRecq3ZeeDHa5qB4= 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 SA1PR13MB6148.namprd13.prod.outlook.com (2603:10b6:806:337::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.18; Fri, 11 Oct 2024 03:24:34 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%5]) with mapi id 15.20.8026.020; Fri, 11 Oct 2024 03:24:34 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Peng Zhang , Chaoyong He Subject: [PATCH v2 2/2] net/bonding: add command to set dedicated queue size Date: Fri, 11 Oct 2024 11:24:12 +0800 Message-Id: <20241011032412.3672788-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20241011032412.3672788-1-chaoyong.he@corigine.com> References: <20240624020355.3712965-1-chaoyong.he@corigine.com> <20241011032412.3672788-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR13CA0237.namprd13.prod.outlook.com (2603:10b6:a03:2c1::32) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SA1PR13MB6148:EE_ X-MS-Office365-Filtering-Correlation-Id: 5264fcac-7e92-4ebd-9714-08dce9a43a09 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|376014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?h3Sr32/qh02vk1AmQgQtu0v4ZSp0p8wo/3z6miC9Pw6EZ4xVEVDAQ2xkXUYB?= =?us-ascii?Q?CYJfFbbNtHzjdTbXKKi/QJuIaT7Ppp1SSHZnKOUjCbzzbPt/4fehA9cqYkQn?= =?us-ascii?Q?Pa4V4+HOHdn6EsbjQ+qXV8OblFM6VmJGNdMEolvw3ItRVzgIwIF25brcY6Hg?= =?us-ascii?Q?rR67XnbuMy02UgvbWnffbEvdKrLGsTzGzhUBIJ2uztxiweAWD/ONe+ZxM+Wy?= =?us-ascii?Q?eOse6rigQ//prCMzWAFsk04FixEdLMmMnIRzRYtgsK1WXbYINPWM8z3UjtEX?= =?us-ascii?Q?hV+xuDXkKg0gF17dCGHh/okMfdd9UwHBK8mhwMMG+Qi0vLlSmaJj750MMZ72?= =?us-asc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7XWs5tKjtHVJ8kzNmfAyok3I20nTidihBz1?= =?us-ascii?Q?qJiOFdMA4aO3TR5/EzPB6LnNiPkXqWHygwFYZz4R8rf6raFyZHED4H7YSMEA?= =?us-ascii?Q?SYI48PUwCgq8l0CVx1VGKqb6ST5+xrD3r2QndpsqWNuHZg=3D=3D?= 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)(52116014)(366016)(376014)(1800799024)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?brvnikgpSGcCTi0Nlg2NMpalbYHHVv7PYZpdoM2ezxvJklQM2/5vZwJM5bsW?= =?us-ascii?Q?6CwEA/c9NhuhDYe5DtrcK6U/B1Fjtqr+/SYhDvHAkfiTFO+ZntEzRU8rsj1o?= =?us-ascii?Q?xqPKwoF8K4vASf5fixWkLTz0DnzbXzf/wcvtGq4Sdzgp8vuHQfw4pLjmc7LI?= =?us-ascii?Q?5pa02QdKeAQHUZolPosuQ/9Nq1gRey1/B7joEripaMnMZn6SD5olQ0w6uYb1?= =?us-ascii?Q?/fivQ5ZqP6Iw5iq6DCL2BemgwtKdkT3Ac98E6IiF5WM7XgXp1eDjePyjPj/D?= =?us-ascii?Q?3K38w5y5d421eV7kcvDwpKJNhhCI90w355uitA+GZrc8t6ZhBhrglyDEkNgR?= =?us-ascii?Q?q+5KjvXS2S7oY4asg2jNMsl3RrfeTrmHgeY6ZagQtZm3K2p8DY0bKh1DJO3d?= =?us-ascii?Q?JUYsTASJHQOe829Bfi9Zd+GijFzxDUyhAuD/oOD53seLl0GDKrn9WV+bMSGr?= =?us-ascii?Q?0lDjZupsxxvxVBnu+FJ8+ACBjX4NDE+CSf694l8XEH6Z+7A5l0d29tbgXPoG?= =?us-ascii?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wzo7qEk4kQSLyKDJmrl?= =?us-ascii?Q?xufzNGXusxGZW0S3DFYAh4DihGZ00y8BYdMNYUirltRRIveVPVcJAWZUlVkb?= =?us-ascii?Q?vA404XHeH5MDmxsgbY05GSZgJp2Yp6q+XL5Yj5Vb0l1TF1nx36fr6CwUB8kJ?= =?us-ascii?Q?8vYsNAn77qp3UqYRgSoj7J5GdKj8zFH96HvcnNYGRun303T8OzSGFeEW/gYk?= =?us-ascii?Q?Lg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5264fcac-7e92-4ebd-9714-08dce9a43a09 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2024 03:24:34.0624 (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: wLe9/21Ry65mzAvX1uR7QQ6P7Zl0l2ebHAXT0XZigqlaWPQroB7VeK3aCvOPjh/hmMpZnBv6GXtu076wqEZd065ZNtcvqmI+e1bNtSAGO+Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR13MB6148 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 testpmd application can not modify the value of dedicated hardware Rx/Tx queue size, and hardcoded them as (128/512). This will cause the bonding port start fail if some NIC requires more Rx/Tx descriptors than the hardcoded number. Therefore, add a command into testpmd application to support the modification of the size of the dedicated hardware Rx/Tx queue. Also export an external interface to also let other applications can change it. Signed-off-by: Long Wu Reviewed-by: Peng Zhang Reviewed-by: Chaoyong He --- .../link_bonding_poll_mode_drv_lib.rst | 8 ++ doc/guides/rel_notes/release_24_11.rst | 4 + drivers/net/bonding/bonding_testpmd.c | 84 +++++++++++++++++++ drivers/net/bonding/eth_bond_8023ad_private.h | 3 + drivers/net/bonding/rte_eth_bond_8023ad.c | 41 +++++++++ drivers/net/bonding/rte_eth_bond_8023ad.h | 23 +++++ drivers/net/bonding/rte_eth_bond_pmd.c | 6 +- drivers/net/bonding/version.map | 1 + 8 files changed, 168 insertions(+), 2 deletions(-) diff --git a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst index 60717a3587..6498cf7d3d 100644 --- a/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst +++ b/doc/guides/prog_guide/link_bonding_poll_mode_drv_lib.rst @@ -637,3 +637,11 @@ in balance mode with a transmission policy of layer 2+3:: Members (3): [1 3 4] Active Members (3): [1 3 4] Primary: [3] + +set bonding lacp dedicated_queue size +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Set hardware dedicated queue size for LACP control traffic in +mode 4 (link-aggregation-802.3ad):: + + testpmd> set bonding lacp dedicated_queues (rxq|txq) queue_size diff --git a/doc/guides/rel_notes/release_24_11.rst b/doc/guides/rel_notes/release_24_11.rst index 9bfc719e02..bec466f58d 100644 --- a/doc/guides/rel_notes/release_24_11.rst +++ b/doc/guides/rel_notes/release_24_11.rst @@ -98,6 +98,10 @@ New Features * Added SR-IOV VF support. * Added recent 1400/14000 and 15000 models to the supported list. +* **Updated bonding driver.** + + * Added new function ``rte_eth_bond_8023ad_dedicated_queue_size_set`` + to set hardware dedicated Rx/Tx queue size in mode-4. Removed Items ------------- diff --git a/drivers/net/bonding/bonding_testpmd.c b/drivers/net/bonding/bonding_testpmd.c index fc0bfd8f74..ce0e47d8ea 100644 --- a/drivers/net/bonding/bonding_testpmd.c +++ b/drivers/net/bonding/bonding_testpmd.c @@ -156,6 +156,85 @@ static cmdline_parse_inst_t cmd_set_lacp_dedicated_queues = { } }; +/* *** SET BONDING SLOW_QUEUE HW QUEUE SIZE *** */ +struct cmd_set_bonding_hw_dedicated_queue_size_result { + cmdline_fixed_string_t set; + cmdline_fixed_string_t bonding; + cmdline_fixed_string_t lacp; + cmdline_fixed_string_t dedicated_queues; + portid_t port_id; + cmdline_fixed_string_t queue_type; + cmdline_fixed_string_t queue_size; + uint16_t size; +}; + +static void cmd_set_bonding_hw_dedicated_queue_size_parsed(void *parsed_result, + __rte_unused struct cmdline *cl, __rte_unused void *data) +{ + int ret; + struct rte_port *port; + struct cmd_set_bonding_hw_dedicated_queue_size_result *res = parsed_result; + + port = &ports[res->port_id]; + + /** Check if the port is not started **/ + if (port->port_status != RTE_PORT_STOPPED) { + TESTPMD_LOG(ERR, "Please stop port %u first\n", res->port_id); + return; + } + + ret = rte_eth_bond_8023ad_dedicated_queue_size_set(res->port_id, + res->size, res->queue_type); + if (ret != 0) + TESTPMD_LOG(ERR, "Failed to set port %u hardware dedicated %s " + "ring size %u\n", + res->port_id, res->queue_type, res->size); +} + +static cmdline_parse_token_string_t cmd_setbonding_hw_dedicated_queue_size_set = + TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_hw_dedicated_queue_size_result, + set, "set"); +static cmdline_parse_token_string_t cmd_setbonding_hw_dedicated_queue_size_bonding = + TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_hw_dedicated_queue_size_result, + bonding, "bonding"); +static cmdline_parse_token_string_t cmd_setbonding_hw_dedicated_queue_size_lacp = + TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_hw_dedicated_queue_size_result, + lacp, "lacp"); +static cmdline_parse_token_string_t cmd_setbonding_hw_dedicated_queue_size_dedicated = + TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_hw_dedicated_queue_size_result, + dedicated_queues, "dedicated_queues"); +static cmdline_parse_token_num_t cmd_setbonding_hw_dedicated_queue_port_id = + TOKEN_NUM_INITIALIZER(struct cmd_set_bonding_hw_dedicated_queue_size_result, + port_id, RTE_UINT16); +static cmdline_parse_token_string_t cmd_setbonding_hw_dedicated_queue_queue_type = + TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_hw_dedicated_queue_size_result, + queue_type, "rxq#txq"); +static cmdline_parse_token_string_t cmd_setbonding_hw_dedicated_queue_queue_size = + TOKEN_STRING_INITIALIZER(struct cmd_set_bonding_hw_dedicated_queue_size_result, + queue_size, "queue_size"); +static cmdline_parse_token_num_t cmd_setbonding_hw_dedicated_queue_size_size = + TOKEN_NUM_INITIALIZER(struct cmd_set_bonding_hw_dedicated_queue_size_result, + size, RTE_UINT16); + +static cmdline_parse_inst_t cmd_set_lacp_dedicated_hw_queue_size = { + .f = cmd_set_bonding_hw_dedicated_queue_size_parsed, + .help_str = "set bonding lacp dedicated_queues (rxq|txq) " + "queue_size : " + "Set hardware dedicated queue size for LACP control traffic", + .data = NULL, + .tokens = { + (void *)&cmd_setbonding_hw_dedicated_queue_size_set, + (void *)&cmd_setbonding_hw_dedicated_queue_size_bonding, + (void *)&cmd_setbonding_hw_dedicated_queue_size_lacp, + (void *)&cmd_setbonding_hw_dedicated_queue_size_dedicated, + (void *)&cmd_setbonding_hw_dedicated_queue_port_id, + (void *)&cmd_setbonding_hw_dedicated_queue_queue_type, + (void *)&cmd_setbonding_hw_dedicated_queue_queue_size, + (void *)&cmd_setbonding_hw_dedicated_queue_size_size, + NULL + } +}; + /* *** SET BALANCE XMIT POLICY *** */ struct cmd_set_bonding_balance_xmit_policy_result { cmdline_fixed_string_t set; @@ -747,6 +826,11 @@ static struct testpmd_driver_commands bonding_cmds = { "set bonding mode IEEE802.3AD aggregator policy (port_id) (agg_name)\n" " Set Aggregation mode for IEEE802.3AD (mode 4)\n", }, + { + &cmd_set_lacp_dedicated_hw_queue_size, + "set bonding lacp dedicated_queues (rxq|txq) queue_size \n" + " Set hardware dedicated queue size for LACP control traffic.\n", + }, { NULL, NULL }, }, }; diff --git a/drivers/net/bonding/eth_bond_8023ad_private.h b/drivers/net/bonding/eth_bond_8023ad_private.h index ab7d15f81a..b0264e2275 100644 --- a/drivers/net/bonding/eth_bond_8023ad_private.h +++ b/drivers/net/bonding/eth_bond_8023ad_private.h @@ -176,6 +176,9 @@ struct mode8023ad_private { uint16_t rx_qid; uint16_t tx_qid; + + uint16_t rx_queue_size; + uint16_t tx_queue_size; } dedicated_queues; enum rte_bond_8023ad_agg_selection agg_selection; }; diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 7f885ab521..37a3f8528d 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -1254,6 +1254,8 @@ bond_mode_8023ad_conf_assign(struct mode8023ad_private *mode4, mode4->dedicated_queues.enabled = 0; mode4->dedicated_queues.rx_qid = UINT16_MAX; mode4->dedicated_queues.tx_qid = UINT16_MAX; + mode4->dedicated_queues.rx_queue_size = SLOW_RX_QUEUE_HW_DEFAULT_SIZE; + mode4->dedicated_queues.tx_queue_size = SLOW_TX_QUEUE_HW_DEFAULT_SIZE; } void @@ -1753,3 +1755,42 @@ rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port) return retval; } + +int +rte_eth_bond_8023ad_dedicated_queue_size_set(uint16_t port, + uint16_t queue_size, + const char *queue_type) +{ + struct rte_eth_dev *dev; + struct bond_dev_private *internals; + + if (valid_bonding_port_id(port) != 0) { + RTE_BOND_LOG(ERR, "The bonding port id is invalid"); + return -EINVAL; + } + + dev = &rte_eth_devices[port]; + + /* Device must be stopped to set up slow queue */ + if (dev->data->dev_started != 0) { + RTE_BOND_LOG(ERR, "Please stop the bonding port"); + return -EINVAL; + } + + internals = dev->data->dev_private; + if (internals->mode4.dedicated_queues.enabled == 0) { + RTE_BOND_LOG(ERR, "Please enable dedicated queue"); + return -EINVAL; + } + + if (strcmp(queue_type, "rxq") == 0) { + internals->mode4.dedicated_queues.rx_queue_size = queue_size; + } else if (strcmp(queue_type, "txq") == 0) { + internals->mode4.dedicated_queues.tx_queue_size = queue_size; + } else { + RTE_BOND_LOG(ERR, "Unknown queue type %s", queue_type); + return -EINVAL; + } + + return 0; +} diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index b2deb26e2e..a8c9dadbd0 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); @@ -309,6 +312,26 @@ rte_eth_bond_8023ad_dedicated_queues_enable(uint16_t port_id); int rte_eth_bond_8023ad_dedicated_queues_disable(uint16_t port_id); + +/** + * Set hardware slow queue ring size + * + * This function set bonding port hardware slow queue ring size. + * Bonding port must be stopped to change this configuration. + * + * @param port_id Bonding device id + * @param queue_size Slow queue ring size + * @param queue_type Slow queue type, "rxq" or "txq" + * + * @return + * 0 on success, negative value otherwise. + * + */ +__rte_experimental +int +rte_eth_bond_8023ad_dedicated_queue_size_set(uint16_t port, + uint16_t queue_size, + const char *queue_type); /* * Get aggregator mode for 8023ad * @param port_id Bonding device id diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 34131f0e35..d995fe62b2 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -1688,7 +1688,8 @@ member_configure_slow_queue(struct rte_eth_dev *bonding_eth_dev, /* 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, + internals->mode4.dedicated_queues.rx_queue_size, rte_eth_dev_socket_id(member_eth_dev->data->port_id), NULL, port->slow_pool); if (errval != 0) { @@ -1701,7 +1702,8 @@ member_configure_slow_queue(struct rte_eth_dev *bonding_eth_dev, } 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, + internals->mode4.dedicated_queues.tx_queue_size, rte_eth_dev_socket_id(member_eth_dev->data->port_id), NULL); if (errval != 0) { diff --git a/drivers/net/bonding/version.map b/drivers/net/bonding/version.map index a309469b1f..f9c935a04f 100644 --- a/drivers/net/bonding/version.map +++ b/drivers/net/bonding/version.map @@ -30,6 +30,7 @@ DPDK_25 { EXPERIMENTAL { # added in 23.11 global: + rte_eth_bond_8023ad_dedicated_queue_size_set; rte_eth_bond_8023ad_member_info; rte_eth_bond_active_members_get; rte_eth_bond_member_add; -- 2.39.1