From patchwork Mon Jun 24 02:03:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 141509 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B59B4454CB; Mon, 24 Jun 2024 04:04:22 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A371E40A7A; Mon, 24 Jun 2024 04:04:22 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2096.outbound.protection.outlook.com [40.107.95.96]) by mails.dpdk.org (Postfix) with ESMTP id 9B00840685 for ; Mon, 24 Jun 2024 04:04:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e9eWAtGiCSJWjYlEMspTLmVCF8qWZ0ecpkXllUNtw5xcK2txlDcThbn9lMSLBUm+SdvUpZN8tYKpWQoPJFMMiG3AKAr5WEsOGJKNG3BRas9oRu0IQ1JSWdCc7shIr6ttPTHGicN/xfAQh0uojsAA+Bd1CySGfHasxvNCscUiKMrUAhC0bBYavJGeZTI1G7HVGTb1YE0Gw4BYUvMhScK/YzWocmBwtoHOQrxrwliHh23IseYo5cfbib/Cuy6NgeFUP+LPw4aE40zG+oxA6O8835jPyoeGn/p9YZY+McxgEmhMWS+8KhGzdRhN2Ql3MU/nWzTIpzw2WijCbFsAvaaylA== 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=iYWuGbJydYdqUVJ7fNuAWY3CfDOfzGUAOQUDmyRkEQc=; b=Dd3SrnmZkME13EoXQET68gEHM2f7FvS9+tzjBHUYAVr0GWR7yh10C4YaqI3RUZMfY7yttMk/aQOu3BCg+43MdFU83KYozjyogYUvXFwfgujda8a10NuGqENsx5YUncKjzG20qTMhasyr9bfG/0a4UnyxOhAyGgomrVEpwYk0r1LssionAHHWw3MgeqtQ5raxL7qDCsyBJhQdMyqjHNR5NuTfN7lsiK5HQ4jwMhR9BiBx4Lhb+yu4L/engAdvSnHm4ur8Ix2U3Hf7Kvc0ytFiBL9EpfvZ3fQhW7aPEtJTllTdLqx/3mFIz+DMY1rBD6b9Qab92jUdNrDr6y+L/4ErvA== 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=iYWuGbJydYdqUVJ7fNuAWY3CfDOfzGUAOQUDmyRkEQc=; b=YbwuOPt0AY7KEcW9Oy2NMMPY9uPlm15J0Di2x+5nEKOYixXFc6O0ju0jFO289j2ANy8ACJ90Bc5sox9MTWzE0wKQBLbMoAlwttEtrJw+KbKoEyWoTcgcCd8O05kaZM0T79ElVu1OPJvSoUlj5uR5jOsHcjERQkgUqAAPw1+I3VY= 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 PH7PR13MB5867.namprd13.prod.outlook.com (2603:10b6:510:159::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.19; Mon, 24 Jun 2024 02:04:14 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7698.024; Mon, 24 Jun 2024 02:04:14 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Peng Zhang , Chaoyong He Subject: [PATCH 1/2] net/bonding: standard the log message Date: Mon, 24 Jun 2024 10:03:54 +0800 Message-Id: <20240624020355.3712965-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240624020355.3712965-1-chaoyong.he@corigine.com> References: <20240624020355.3712965-1-chaoyong.he@corigine.com> X-ClientProxiedBy: SJ0PR03CA0385.namprd03.prod.outlook.com (2603:10b6:a03:3a1::30) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB5867:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ea2582b-ce9e-4ba5-2899-08dc93f1f280 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|52116011|366013|1800799021|376011|38350700011; X-Microsoft-Antispam-Message-Info: sIKJ3ldbh7Oa8juSmONAfm9QW6SMW/BK0xAy2RKMkBWjhZO2fBpI/qARrAoeAlmvxju9e8QR8/y3NG4WD+rHqvTkq8xNqJ6HwNmIRNd0/5sUfE1WJSzm16r7SI47NTXU99cTqO5rnk04WjrRaKccB0ZmdjRDo0695UH+AaKHu0aMdUOmQh7BJU31+gfq0QtmP/IQdvDAtUTrRkHod0aGAzyScO07ALT33ZtI8uro8bj1YkMfUaaP0lKFAzDirrmBNvH9j9QrzbnLVXcSrFcxjADdSP8bUD7Gd6mPna4/D/7sL4Wk0LxVG2bjoKwnAfBAzZyZucMwgRIkm7jCSVwNVjat8cMiuUNJf9Dk1HA+9W+qfwHzoIgQZpTDwSsrarepSro7jAfQ8E7JpcBTOuYsuz0SefGRkAjRKmjtXv8HhEP5eHhmo188qxlt0ZdKSJEsF4UCvmLPWWwGPd//8MI1F/rmSQmCFa7mlh6x0rKoB2kwugKKiC4tcZSnVuo4llBb+1sNYhbW/JtwFFsyRrAIl/tGWlsjVlqZozY1JScpK0vxtShPDX1pbVAyeDuM7a4BJ3OvLsEPrn4ksaYDPmd80I3HKkcZPRbYCPAWFJZntr6FCiXyByjvig6FEYX0F0t2fv7DIjgpGoxZCxMzXO2QKUugo+xHY1VLUzCrmic8bz+/2ZW89RtpD3+SStU6Y3aH91S2lDcMyV3SHrvjZCBaBvSzAmAaUi4Wl+patj45fgAAJKKX+ZCilYQjhcXcqIPxZuOwRO5XnZgHVqQoOsZyjC5v/tyZm75Y3fh99P9qB8QROZIKoNOGtXXG6PXXrQXANRu7PYEC22pPILVClSajhrRRzyRwDFYYABEJxCpuCOQuKFMmk7fsc+rs9eoIcTPlHvmTFlBu89bVJjjG3Ja727me/8h/kbzVoda4u0wEoV5BCREDenYEUHB7CPB7A5KTE/RY5i/PZjU+tI64vXQPGfBO822Hc7J08elYd5gJKF0bfrNroMv1lbaatzEF08VsCSRb9FlZ9erAGqt7bqJrHzkAokkmGchf1ZLTMtsmz9iBsBHdPDjeqa4eUdG7mGiCz+sei29i02x//DseNdrSf/T4xXlJ12F4tgBfMcltwTk/evR1BFodlQUTTUiUAMwf6JUMHlcIAww7Lknu53gkXJtaRkcz4oXGzt6Z4j0Rdcot9i2V/LcNl5rz4GCS8cYn+eyHBIEKo+g/xzxpsWqVAYojhRTjMEXsYM0NQvqqgwv6WmR/33iv1YkIOvJcTvh/QH2cPf2bvzlkehksvY/ixV0l01pJRMmOTPtNiLeUigzaqVZ3X8Rw8rI4+uyY7YDACNnflfLQ87KfuShYM9IpuIZiylK4rC5Rr8U4HZ+1bKY= 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:(13230037)(52116011)(366013)(1800799021)(376011)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: viVNp8Rj7usvYjuHd9K9tf4AaG01p3Gw1R5oVnAyWfmVnsAjwrF0EcIJF4r6lk68QtBnG8zS+snWWcpXUjNCakpn0MHlefnHE+9lIIpmQNukRLkIrCP8l5zUChmbDKweVlOCTLnzvOiTmD+307JvpC/diMLUyr1cfdKAFxHfeNRq8KEiMvB1PF9hHJKi6AGPv0lQVKfcD+m0QAVOl26DdsY3Y2a+TeIYfRJgRuXgm74TwAKbmN7Wz2sJm1D8mwzazyOMsXQ69ROkKQ5FVCtAZpFkGgAkw86TOMY7/2PTIeirWaSjCoPPeTGdCWBE4q2R+jC4EAtqBX0/8M0I5rZS9CzFJ2oKlZ5/3YA6vmmNisJvUG9+tmuNkSBbiSwdHc1gkjR1EGOpUshN0yXk2EHHntWqvvL313+3bEkirXyhLxfeBwBrh1FvIp7y9Qb63cSuaA4T2yYGturqu4RmuDk7uatuthWqYyzlQJ+z998ap4dgAJAdIHDwBH1Oi8nIRXgbBwyLpyD/Unga/2dSZJBMvahAN0w1GrKsAYwEMJlQN70wxc9tZRsbiYdoM3ohrTOPEnOkLyzpdA25xhfNyIw8yvQAJvNx6H8uPlO9pMOH4LYsYMmaXpXQLg9jKhUtM9lX1Fn1ZPa8PYcHWqlGVfVpARNKp3Tbo9Tq70b4gEr8D6U/Pq6vVWThmdybSrNUsQJevGIWqurlePN/Ye60PMC1H30+zqu63Q9k35xtOROjVfiMAnXRZijyDXcYWOeDfRKZ9Zss007hX3GJjorH1l88DjHZtdjkmSt9Om3OXOWqYCsNMmHBVtNK9si2eG/iv1DakGVnkQqyIc91QWk2GoX0jfMKf17Rd/3qeUkqkaMs75sD8d02kujHUWifDpGaKRBB+IjHHiBkSFN5mI3a0Xf7JudWr3rkx48r9noyEKu754c3yEHygMEVgXzME1P2TM1bdCadosCCQhGBgM4GEWyezPFMwXIBuZpdoHX81FFwEj2Ss/8qL29JeoUbOjAwE/4G25/l0bqjr6G8AlEajOdiz2rDn1ZT2pjSPJnEG0ShLBmXP5nzzIKXUIj39odqMeDICOEPMyOKlFPAUgM9JlGBCwSjHgpU0lcPqwhW0ttr6VQs1KubdADihwsHbbYtJn6YYh3qKNS1lnS8KXaD72EpcKtTmRZwRNyr6k2RYItAgRzTnRbvaloSOuEP6Oc3/JeFPXAagp/7Wt2wVT2tdrDGXe6ILiz2Jeis/BEYx9Tf8Gln7dkwzK1SCmvFREMNQbhZonqC/+KLH/vooKvfocQZYngGDjFgkQLTGvWHFG6Bznpc9CnxqiYU+Fy7jvw6DFVXcvKhZdAqmL4cZgkzsWlXr46Y4/1JGdxCmp5FJohBHHbiaRkLewLsgQqZ569DKgKsXQqMD5O6I98I/3WSIA6FPRODfCgjft9E6769ldilyRT8ZywJbctwxuIBzGzwFMrqRv5fvOBbNtoJgiftdL4JMC7U8ZaKOPLoTZ3dFyqSGxDWt1Ll3GQGVabyZMfgp3RwyL2x+IqK2fAO7ucNbE9lhTkxydoMxXl5BGHohKDpR6IZvFcSJv7NbFfgAw5UKqWPtq5C6yQTNL95zcPOqr2sYg== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ea2582b-ce9e-4ba5-2899-08dc93f1f280 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2024 02:04:14.7445 (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: Dcj1s9c+viAU9lE3vo7MW2RyJCScNtqwTfpf+G0n4ezRFn8OYxzseG/osY3hQYJeOfbOi99F0sQXb95O2k5vidO0lHm5rQ2vwMNqVr0jsuo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5867 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 According to the check rules in the patch check script, drivers and libraries must use the logging framework. So standard the log message of bonding driver by using the logging framework. Signed-off-by: Long Wu Reviewed-by: Peng Zhang Reviewed-by: Chaoyong He --- drivers/net/bonding/bonding_testpmd.c | 42 ++++++++++++--------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/drivers/net/bonding/bonding_testpmd.c b/drivers/net/bonding/bonding_testpmd.c index 8fcd6cadd0..45b636fea7 100644 --- a/drivers/net/bonding/bonding_testpmd.c +++ b/drivers/net/bonding/bonding_testpmd.c @@ -34,15 +34,14 @@ static void cmd_set_bonding_mode_parsed(void *parsed_result, * of device changed. */ if (port->port_status != RTE_PORT_STOPPED) { - fprintf(stderr, - "\t Error: Can't set bonding mode when port %d is not stopped\n", + TESTPMD_LOG(ERR, "\t Error: Can't set bonding mode when port %d is not stopped\n", port_id); return; } /* Set the bonding mode for the relevant port. */ if (rte_eth_bond_mode_set(port_id, res->value) != 0) - fprintf(stderr, "\t Failed to set bonding mode for port = %d.\n", + TESTPMD_LOG(ERR, "\t Failed to set bonding mode for port = %d.\n", port_id); } @@ -98,23 +97,23 @@ static void cmd_set_bonding_lacp_dedicated_queues_parsed(void *parsed_result, /** Check if the port is not started **/ if (port->port_status != RTE_PORT_STOPPED) { - fprintf(stderr, "Please stop port %d first\n", port_id); + TESTPMD_LOG(ERR, "Please stop port %d first\n", port_id); return; } if (!strcmp(res->mode, "enable")) { if (rte_eth_bond_8023ad_dedicated_queues_enable(port_id) == 0) - printf("Dedicate queues for LACP control packets" + TESTPMD_LOG(INFO, "Dedicate queues for LACP control packets" " enabled\n"); else - printf("Enabling dedicate queues for LACP control " + TESTPMD_LOG(ERR, "Enabling dedicate queues for LACP control " "packets on port %d failed\n", port_id); } else if (!strcmp(res->mode, "disable")) { if (rte_eth_bond_8023ad_dedicated_queues_disable(port_id) == 0) - printf("Dedicated queues for LACP control packets " + TESTPMD_LOG(INFO, "Dedicated queues for LACP control packets " "disabled\n"); else - printf("Disabling dedicated queues for LACP control " + TESTPMD_LOG(ERR, "Disabling dedicated queues for LACP control " "traffic on port %d failed\n", port_id); } } @@ -178,14 +177,13 @@ static void cmd_set_bonding_balance_xmit_policy_parsed(void *parsed_result, } else if (!strcmp(res->policy, "l34")) { policy = BALANCE_XMIT_POLICY_LAYER34; } else { - fprintf(stderr, "\t Invalid xmit policy selection"); + TESTPMD_LOG(ERR, "\t Invalid xmit policy selection"); return; } /* Set the bonding mode for the relevant port. */ if (rte_eth_bond_xmit_policy_set(port_id, policy) != 0) { - fprintf(stderr, - "\t Failed to set bonding balance xmit policy for port = %d.\n", + TESTPMD_LOG(ERR, "\t Failed to set bonding balance xmit policy for port = %d.\n", port_id); } } @@ -239,7 +237,7 @@ static void cmd_show_bonding_config_parsed(void *parsed_result, bonding_mode = rte_eth_bond_mode_get(port_id); if (bonding_mode < 0) { - fprintf(stderr, "\tFailed to get bonding mode for port = %d\n", + TESTPMD_LOG(ERR, "\tFailed to get bonding mode for port = %d\n", port_id); return; } @@ -292,7 +290,7 @@ static void cmd_set_bonding_primary_parsed(void *parsed_result, /* Set the primary member for a bonding device. */ if (rte_eth_bond_primary_set(main_port_id, member_port_id) != 0) { - fprintf(stderr, "\t Failed to set primary member for port = %d.\n", + TESTPMD_LOG(ERR, "\t Failed to set primary member for port = %d.\n", main_port_id); return; } @@ -348,8 +346,7 @@ static void cmd_add_bonding_member_parsed(void *parsed_result, /* add the member for a bonding device. */ if (rte_eth_bond_member_add(main_port_id, member_port_id) != 0) { - fprintf(stderr, - "\t Failed to add member %d to main port = %d.\n", + TESTPMD_LOG(ERR, "\t Failed to add member %d to main port = %d.\n", member_port_id, main_port_id); return; } @@ -407,8 +404,7 @@ static void cmd_remove_bonding_member_parsed(void *parsed_result, /* remove the member from a bonding device. */ if (rte_eth_bond_member_remove(main_port_id, member_port_id) != 0) { - fprintf(stderr, - "\t Failed to remove member %d from main port = %d.\n", + TESTPMD_LOG(ERR, "\t Failed to remove member %d from main port = %d.\n", member_port_id, main_port_id); return; } @@ -467,7 +463,7 @@ static void cmd_create_bonding_device_parsed(void *parsed_result, int ret; if (test_done == 0) { - fprintf(stderr, "Please stop forwarding first\n"); + TESTPMD_LOG(ERR, "Please stop forwarding first\n"); return; } @@ -477,10 +473,10 @@ static void cmd_create_bonding_device_parsed(void *parsed_result, /* Create a new bonding device. */ port_id = rte_eth_bond_create(ethdev_name, res->mode, res->socket); if (port_id < 0) { - fprintf(stderr, "\t Failed to create bonding device.\n"); + TESTPMD_LOG(ERR, "\t Failed to create bonding device.\n"); return; } - printf("Created new bonding device %s on (port %d).\n", ethdev_name, + TESTPMD_LOG(INFO, "Created new bonding device %s on (port %d).\n", ethdev_name, port_id); /* Update number of ports */ @@ -488,7 +484,7 @@ static void cmd_create_bonding_device_parsed(void *parsed_result, reconfig(port_id, res->socket); ret = rte_eth_promiscuous_enable(port_id); if (ret != 0) - fprintf(stderr, "Failed to enable promiscuous mode for port %u: %s - ignore\n", + TESTPMD_LOG(ERR, "Failed to enable promiscuous mode for port %u: %s - ignore\n", port_id, rte_strerror(-ret)); ports[port_id].update_conf = 1; @@ -550,7 +546,7 @@ static void cmd_set_bond_mac_addr_parsed(void *parsed_result, /* check the return value and print it if is < 0 */ if (ret < 0) - fprintf(stderr, "set_bond_mac_addr error: (%s)\n", + TESTPMD_LOG(ERR, "set_bond_mac_addr error: (%s)\n", strerror(-ret)); } @@ -603,7 +599,7 @@ static void cmd_set_bond_mon_period_parsed(void *parsed_result, /* check the return value and print it if is < 0 */ if (ret < 0) - fprintf(stderr, "set_bond_mac_addr error: (%s)\n", + TESTPMD_LOG(ERR, "set_bond_mac_addr error: (%s)\n", strerror(-ret)); } From patchwork Mon Jun 24 02:03:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaoyong He X-Patchwork-Id: 141510 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF623454CB; Mon, 24 Jun 2024 04:04:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2A9240DD0; Mon, 24 Jun 2024 04:04:23 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2133.outbound.protection.outlook.com [40.107.95.133]) by mails.dpdk.org (Postfix) with ESMTP id 20AA340A6C for ; Mon, 24 Jun 2024 04:04:18 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fH54PfLD+rJzYMiC4iOn/e/4pRCrIHFSldb/ODzUaKdwLr4dOB48rK5r53rA5b9mvrhaafO8GMDXhSWfJ9fLoWIQNPJzb1GUB9b7YihrB0SaKUOtfgWDY/HsID0+YAe0ut68P8TDOcEdxDexZcpVInxuQI0WL4G0Oq9b+XKnDW643jv03WQ7VQ765UPvSev8EiW1Shzgm3pFtAWL02Hdvi5TEj9Bzq3CJpe7lHErK/AEqSYJj00IBK7LV7wfHaWo1TRijw6n0CPRFWNErcBMLcEj/2RnjqS+7+cUMrHFekNTlBuWPTLjn5wFvXrlkihLu/2nW0Meqp+UaPGy5N0pww== 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=fPLnyEQo+mTEBq5WV422ESaX54kRJHneo3z2l1PRT/Xe9bnZEJi5kuBKjn3yOcjtYoVQxJVt2qPYndvUt6doPInvHq1OduGYVBoliLWZix2dwT3nDqgJ2emcgms3bU+ZFjtMjHzd2eRM3eX0peeRIDArpg2G4IH7YK0LgnsZ5AIBdaRxZoDcwnwAhGHboab2de/aySCrGIG1gi5ThKcuLxbidwZ5oIT/iwMswdqsnU2IHKNC3kYXdl1MOVyahCQySxulVFfujuevAk3T/YaUvKpO8sJaNX5b81qbWRYb7McphZ2/LmdoOAJp9dSz5zOC6PlgVELlSxX7IbIkpHq5nQ== 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=aaU8pQaEbYKE4lKU6EiK3k/Pk0gtq7aihe/0jbru8fuUxZsiqR/wxShykzoBCTbsFyRssqT93aEs2dv4yHPqWKSWpmIdPsxiU3SUwXz0O4FzA9wtRdN/F5mLKatg6l2Ogj+NgVIeSYtZaazP8yDFYixwsf9p3iW2dI3NhETqoEE= 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 PH7PR13MB5867.namprd13.prod.outlook.com (2603:10b6:510:159::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.19; Mon, 24 Jun 2024 02:04:16 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b900:5f05:766f:833%4]) with mapi id 15.20.7698.024; Mon, 24 Jun 2024 02:04:16 +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: Mon, 24 Jun 2024 10:03:55 +0800 Message-Id: <20240624020355.3712965-3-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20240624020355.3712965-1-chaoyong.he@corigine.com> References: <20240624020355.3712965-1-chaoyong.he@corigine.com> X-ClientProxiedBy: SJ0PR03CA0385.namprd03.prod.outlook.com (2603:10b6:a03:3a1::30) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB5867:EE_ X-MS-Office365-Filtering-Correlation-Id: 3aaae36c-5f08-402a-4616-08dc93f1f39c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230037|52116011|366013|1800799021|376011|38350700011; X-Microsoft-Antispam-Message-Info: nqb8NZFhGRMvPxAbSskEBmchbn7+tUFjkIZayFcbjO8KBkuvcPvfuTwdOd8RjX1v/tem8s/TrzOE8JqQoo/I97xTJ912FPlgQo6YpKm1fN0kONr/2umKOH+Ha9IdvAOmPxH/v5U3ahvtadGLYA3SN45bXwp8L6eaPipHbUlMKJTthlLst2FxHvtRTBergW69fnFIMMGhd5L77FPfBPLgXOSdAUltjga+QKGZGRdHnfM63erOh/K6t6n74f7dvxTSAaRT04pXYa7IZZjnWSwKatkVJDm7I0hMxrjYlaU4IIaXgUKdkEmmRe0Pv/Aw32JUr+FdXZkQ2smPEQybqizkewserHZtEQqrPgW5l1Yjk5XqAD6DBc5wEK1E5X0RZZPyuoSqG1mfaRIzGPu1+P2riSISM8AnMSFSx67DFC+a9xC8E9DQ/M42khIaX7HoBhuxxtQt2OXa99f2FMAt+ZtPOR5SQSUz1/o4mqsnjiH2Q3n7mtJ3Imrre9Hyuqk0C2IHA/wCmbJHCHHxhzDADcNP3roQGQegOvGB72f+Ypa3PglMvC2O/PFjiuSCQC25eYEP5zd8/vyYxgYtiIcB7JQGc2TMdTLz4JcUrVjXyNYrosRCLRqus/Z5fLUgj5MLDX5/C+aw9ahKmiPSG2gmckEAdTgslynxe+qf1t/BFWJEQ5plYVvdxIYa59eaPPkTH0lwL8Br+7UqDnkDQS8DdhseG7OeUxh63t7lGMVeUTp/ctEo2VuFyzeZMxuSh/WX3p+EpVP4rkbQbuA9QmlENp6TnvsxA4SKcMgWi8b6V3r8hTenjbwXUSM2rlfVaRgMgVlOw4gH+d7Qgvw7TyzKYrXhErhtAVYNNYcQM0k9gkUKNRIFloUB9nJQ12X/JsC3EbTl/rLcLmLmb9z6cf0nAbHDLLf4z5bLlPUsrGVqnXBPzYiRJ9Usb5pFHY69BOXbEewVyddLRSNvpNBaBAHNUgMIbuk7XWkjGFgwyFleDLKPkTg0ZGgqNlqwK9ciR1u6cL981YDKd+eZXHD7AXRVWpvwLnSIqFj6TSJ/u84diUqng3MZXPMgvO/NlaVRi3Ci5vs++jVp/RaJ76ARYSOVRuYIbb6Bvbqu3o6MoToPltLBOkVsBhOG2BQGF3wm1RIeGSX5bl7xxHg3OCQl6u8E9olgULepKZnYxThov293tsSmJQ4WyZocqA7TtjkcisZ/7+BqHLUaG3CZ/cvZw0lboLQCTM+Rm8tikcCYbjLtUURggYoLEMOdD5Kna27AjQ58OQIRS5r+BlCBF/YdTKilxisMsxkzF6arb/20PvZQEsstbsIPI6AEpHbNikuwpyUReVWqH39p2d5SEkCEC6tlnDrQkvvs1QBUxWwVMCS9vKmI6TU= 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:(13230037)(52116011)(366013)(1800799021)(376011)(38350700011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wJIt0gBayQJO1J7gLcl5zIjqMcGg0vRoUyshc0ysL3bikZXXuYNJ2v/DAKH3T6d+ZMiF1+BEACcMfs/oAIszK92qYgRwn01QEDlqPLl/5BrqJWXjawNrg9BgDmbLNbWIxcxqep6dfhXW2XKlZw2ZWP6AS2Tkkumg2nt4Kr+j8C49iD3HEPjjqEtEkNH1y0gulAeSsresV6gy4dcLjtT/MXL1h6k89sS/sjBbaa3fJlITatGAvhSX8tk52LLE7Exu3abYtZrgvNJPp3CKP9+2ouZHf35bgL3G4zC0wIxuK3lX4koBuLc7TFsNf0iu+LqpP24duom4jqv8TUcb7+M+BxbQYR64bQ12EzTeVnT5W4pdNY1P3YgeqF9EYy6LE8lBK9B4EQBoRfLLsQWmsDNwyXLC8CkvbqaCoiRSqyaxoPamXF2ilX61uKVWNFjpfycAyoY5TPX2sDLZC9Kbldg8QbeVzh/ZTg5mUv/n3Hd+o+zpGm8UN5k6zhgyMjh4aq/y7QJU4/F4TqQV9tjK140aTCqjvPMIFN+EPsuez6+ad2uV/DfbfsI7j9JYBvw0fMh30jIr8j2DfEtK7VS7CAHV92v5cH9zvPW1/F/YKvLIE5hoUlbMmBwO2YqhT1oL8w5Shgq/8nlbpNpNrTRo5dHKjntDvBWKPkp8jbLL+0zrD5twoD54+BBU/IgEJZKc3tFIdx8NFxKsKtFAvuXjsGI030gvC0Jo+Fu3v/NENuqfogOSsPlTNRNmTjZ57WSqfAls/FDjLhbzfh2loUTu6UtpO99JLG3t/Px1+U/C7G4VGMjKFxRLthmTMfzdcNWTFbcALeDEU3FzFKQWYVBEGfLWGvyLmrqe467rVoTi2xqSFMUga7zzGQg1ZeBvVCr7IGi/EM7aNvFUqEVZbwhcVJ+K2i7IN+r8m4/6DR2vO0IET4Zhav+wYbNkisi/WZKu5qwoDXiAqx3zCaUE99MSyQ+2bDT62gvIgz+/UVuKJbxjs49py/LgezQQhxkGl3k8x1EuPwvaB2dysZAwhYzfsWpwZ+kbSKIf4ZlPytenb9TalDBRFyI9UJsx1vp6Y+ujwkuj3y7SCW63ASbqrJIsWJJ3Uo4gXl7WeGs/hyHfHLm9Ic8VMjwBmxgcmRud42wZ9TIkQkQhGtSYU3bTMcVWYH1VJZISxK54qoCEb8psUB+lyNh1reomt8JH01eTPmBN5GgdXqTWcrkfwsuHjivs1DGRe5knT225IQeyZCpJ+yw/7tguZkGXFrAU5dj/GT4Dd0qPsVzPl123/808UUnqHdmpQLS209iWo43ehN013iHEhrAzhKjNNlyLUkP7reS9VE2jkF9RHJET/kPR+ux3m+52N4ylpVLL2X6vAtl8jOXrSE0fzD2N2epRTbcdMog6GSA8NYcDd9+pUEPQMGxY7TKc6FsZ4MKCXqLciG2TS5COOi0L9xLa5uOXig3blwOTD7QViZW2TzV+OH8UmGp0ym76GQTPgY2Kpqg+ZL2/0Niaff6DSHiaxTqf6qamB2yDivYZnP7E75wN9bNcSsanB6BcXWmB04hrY4EB9Z7B0jABcMpK4pY5qop3rHOXVhXijdVRiVL7HghKHy/BKI98Zde5VQ== X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3aaae36c-5f08-402a-4616-08dc93f1f39c X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jun 2024 02:04:16.5822 (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: fdBQttou0CqYnyKkGdZxBbRDrDWCfkSAseRNjmrRhCkgSRQpsSXNj7nRwiboa/8cEEluV9SFasRrrx7yDRfOMhSOFUdU92Sav2cRjRWnC1I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5867 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;