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 B175F4414D; Wed, 5 Jun 2024 07:55:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B5AEB409FA; Wed, 5 Jun 2024 07:55:48 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2118.outbound.protection.outlook.com [40.107.237.118]) by mails.dpdk.org (Postfix) with ESMTP id 9636A402CE for ; Wed, 5 Jun 2024 07:55:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CmU810VzwXQUjs3jlpEDvKzB6WazO3EDYjwKq+c8cxjYppkxH7pr1JFQtd6DcyZCgUov+0opHR73JMv9hUUUO9GhQzdkMnPQ418nsiikofphpEjXjwp9lg3sjJ7Uw3GHQuvBqE0WWUwGYgk0dfGS6RtY0kt/NowVSMLGLD9HT6OPkdM0jjy+8R3UX0YZ2CJ+buxPAzx5kj+WW8TlSorM3/fb08XMg9Lwci9W0hGP92nbJxWyvSouoNUirpe6uWmCjnzY5Jyq/LBOQGkR+NLu4kpXVNzNHjXHAkUn8VIh7OLZtvmWrBHiDBJy2575/+NkTvNRtIbXK4J08guZp1potw== 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=jdRlQgVz6PeNaE8/liXc71HesK+ZCDhMTi2gurIg36o=; b=X3r+YgdNqXb3/Es3VXvY2518TSGgn1145HReH13Y4fqUBREneSXXSA3BFev2/NloUKLhVwoWQIMiIzwi5VsOlzCPAxUjtvjPvIKSKOKcdFUj5K5P6A0uiLcs+5nr/MW7OkSDJdjc60/03HNgCKw1UXZtpSSTmELBvRM+W6bY7UZghaVJR+BwliiTzl/wGiR4QzH5KGH7i6AyEW06PxtShlxANky5PQS2NFPWPFdqcR74cscmc/pj3hzupu5M5S2jDV0jTDwpPgjEiKjo6Gp90bocj3cvTuP0adyGYENXnK0XK5pTgnrurEY8TQdUGA0iUPYoyeK+rcdtCwLL6OM2aQ== 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=jdRlQgVz6PeNaE8/liXc71HesK+ZCDhMTi2gurIg36o=; b=XmoX2Gh4WHFHb3EcONnLiLUskg6XetmTx1HoJ4BmfiyzeV8DhJgbkY43igx/IdaqcIOgsU710w1aMzFEt1V8UvrW0JAdyAqRJY7xGbjnj+G4KsJ6T4DEa6XdtelQYAM2bLrN72N99jLatADsewt/rCy5LdkTHYK2c7VQ6FzKD9E= 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 DM6PR13MB4050.namprd13.prod.outlook.com (2603:10b6:5:2ae::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.16; Wed, 5 Jun 2024 05:55:44 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%7]) with mapi id 15.20.7633.001; Wed, 5 Jun 2024 05:55:44 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Peng Zhang , Chaoyong He Subject: [PATCH 2/2] net/bonding: add command to set dedicated queue size Date: Wed, 5 Jun 2024 13:55:20 +0800 Message-Id: <20240605055520.2587034-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240605055520.2587034-1-chaoyong.he@corigine.com> References: <20240605055520.2587034-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ2PR07CA0003.namprd07.prod.outlook.com (2603:10b6:a03:505::26) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|DM6PR13MB4050:EE_ X-MS-Office365-Filtering-Correlation-Id: c932168b-1d61-4eb9-1109-08dc8524233c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|52116005|376005|1800799015|366007|38350700005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?sUGv5heQVVABcNvq5vEoGn0/ZrwwwdG+h9hUfRk1hKzbb7YbKFz4C/y9WxDq?= =?us-ascii?Q?WwKXANsKs2XQM9kxcmTEywAwfEc4nuLBwn1Ln2OBbI5+/L5bDyKXLN3WWa5N?= =?us-ascii?Q?bEypAIWT93yAHeAU2p83VGnDW09fSFh2XB6BIhD2iof878eUKrTpHfJ9I7wW?= =?us-ascii?Q?tfEE2XDWakv+87NWN/8LYHFToMnApw9ongdscZRjyZKI7+US1q+ItHbLSFR6?= =?us-ascii?Q?srMO7TAjDAGN/JNRImFjLtYoJrh6b397E2G1KF/JANYnx0zPCoNnCqwTV92r?= =?us-ascii?Q?KlJu+Ei5zYD8k4HfV7gDdEDF2EDaLBk38+9cknv22vjVlIExpWlMqy6cX/7z?= =?us-ascii?Q?1Wy5XkBNwcQrtQQtGq6FlSYuX0dD4GxoLlmh7ST9h5F4s1aD2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gj2c9tnyjX7JVhF1S5LtIE2EsAF2Cu2cf8uMpUWPO?= =?us-ascii?Q?PKqsh+os18N+Xvu9gwLOUn5lLeaXKb0osqNdBQNAdbdRInYOCKcmJ6Q96OYt?= =?us-ascii?Q?zB7R/gI=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(52116005)(376005)(1800799015)(366007)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?eCkNsKc+FqoA0fFETUJ5Mmjc/prU0N1SH8slnnUuNuvAs45zdsIX5+r53lBY?= =?us-ascii?Q?cfPx/9RovYfc9jSgc9mHi6D2UIflxrgc+1oMg+YJ22L7lSGRawNESodAScUS?= =?us-ascii?Q?GVKskRxwlb7Y5/WGIA4KrSogkQ+CLDUXuqWHupId96+7bo/rfss8a5uGRg5y?= =?us-ascii?Q?CThI3lFf8UDRyOdJkEpzPSYK6SUEcP4lpL3Er6EWr+MyqBx50qYoW45SBSYJ?= =?us-ascii?Q?uCDiSUN4F2/A+LwvqtYRr2jxTE4u2zrRAyW0mvgfEMD2Ad3R8RXCfAZgQ756?= =?us-ascii?Q?DMwmD2IyDu3I9gPNeGSQSynijmrA1SPpwRHmoPA/jYquPjvZZ87hqyNZq2an?= =?us-ascii?Q?mGjalTcRVuxk+Ea9sECYUqYQHXlulIYWuS9nRfGT2eHCaHW7F84SCxJXgVQM?= =?us-ascii?Q?O0CObrQVI1504/rYLRVl/fw/P/mBRTFHmHio8+WXQKKsZvvmLOyiDJp86AG/?= =?us-ascii?Q?KO9O8UTbnscPjb7gFOPz/TtaEWj3iMrQgvqkoh0pQqRsS5nm+wBIc8cISS+8?= =?us-ascii?Q?QWn9UZZTnB6TjbZt6RUSshf02qw54Ns9evrig/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Wp+4NrNxdbjBss89u8VTdFsMV1S+PT8/0z1bIvbxQct4viAwzsyxN3VoWNMC?= =?us-ascii?Q?xX79k2X3sfuLlpIY8e+o0PWirbiEsHhXklj1nqo7OWNZ0qPT3n/ZIYDWhqCJ?= =?us-ascii?Q?g0D3ZaZYLTo7816WHTuRDuo8x3QpG2npVyCL3jlzF72BmvAuIfesGXS5Q9oD?= =?us-ascii?Q?aQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: c932168b-1d61-4eb9-1109-08dc8524233c X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2024 05:55:44.0826 (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: a+fn5u+/RNFdxSYuSvpuhrj6An+7v550oKqrAuqYsEZH4W4W4f7OmObtTgs+16LtPFLVX1Y2y2KB8ATc3HcnKzZNbskuzNuF6j9h6CKTStM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB4050 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_07.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 | 39 +++++++++ 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, 166 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_07.rst b/doc/guides/rel_notes/release_24_07.rst index e68a53d757..a17b5c4302 100644 --- a/doc/guides/rel_notes/release_24_07.rst +++ b/doc/guides/rel_notes/release_24_07.rst @@ -89,6 +89,10 @@ New Features * Added SSE/NEON vector datapath. +* **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 45b636fea7..540f0d64aa 100644 --- a/drivers/net/bonding/bonding_testpmd.c +++ b/drivers/net/bonding/bonding_testpmd.c @@ -154,6 +154,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; @@ -745,6 +824,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 06c21ebe6d..c19645aa4f 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,40 @@ 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, + 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 + 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..0a36fbe3ed 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 128 + 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, + 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 c40d18d128..f53856ff60 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 09ee21c55f..6626691f0e 100644 --- a/drivers/net/bonding/version.map +++ b/drivers/net/bonding/version.map @@ -30,6 +30,7 @@ DPDK_24 { 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