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 C14654414D; Wed, 5 Jun 2024 07:55:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D103740687; Wed, 5 Jun 2024 07:55:46 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2092.outbound.protection.outlook.com [40.107.237.92]) by mails.dpdk.org (Postfix) with ESMTP id 3D5F2402CE for ; Wed, 5 Jun 2024 07:55:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IqqhC6ycTLkQ6rK+TiKmKX5uDhiTVrChYjbQuNn12R0+kDjEcWlKIv1vAsuQ+eY2kay3Iu6IH4hzioUPkEfxTRst3l+7CxhkRTYwQS9AB3WqCTbePcBBE5Cc0FpUW1DCnLMzhQjbRu9PxOLQPusjpDTCX1wFdgeRrQX4MKEPpNd8sfQmQEK/xrF/lXMJ92jI4DqHcqWjVLbyyikje39rpvfnKNpf3NdeSBEGFQJL+rF++ze+4Nmccn8yX1gCStCE5hHJKUe7Ie4+tJRV5LPy7zpKA32mXb3bSiyAKfKpqHDO2YC/7b0GgmlrKn8dRdl7q/fN65F90NDJupf9ykvsmA== 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=J3lu1r+Pqtc8CV0H+ND0eLFPqL2gko/0BSzTfisPO8obe+PI+de45CVgHmj4M+WR1S4DFozJjq95fGwVa4+/IbTBqNCFRXsMG36hz8/H72qIJ645Nh62JWqZrp/f6tF1cckP3tTZpzVklcOzrVexbwGuKh01jv6diDUaR8jH3VHxIHT7D6tThZG8DAsWq7J+vRLHGqWL863Pstxn6Kb2k1oeWOcxywC+3wRn+ToPlknul7F2eLU//YAbVsaaYQHiyvsZfsYBUhIrzgmY9RiMyqnYX149axUDDCnpke5dQXi52HxZnqvtkSGBD1Fsz23NiULY0e5xgrJilcAJThrvNg== 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=P6JPqAhS8tqrBkqz60yuYHgPV+McDnFIMtzRYUrv8dSXCWvimDzFalqSoRAaWQx5OXoKQWNgEctAxU0olXCacY3ex6mbGZycezg8uWvpQJ9P63S9Ph0l8oar7NdnoSY8CwgjVEdTUEbAxDUtBqF2FDZ3E84r/cl6ODY9Fitj0rQ= 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:42 +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:42 +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: Wed, 5 Jun 2024 13:55:19 +0800 Message-Id: <20240605055520.2587034-2-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: 07451113-42ca-47b2-e0ca-08dc85242220 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?rJGSjNxhdA62bHa9wHezqdJdxDsjjqDGwE/9HYLCRnYQdpbtnF95I/MSCXrc?= =?us-ascii?Q?3k9SEgqi4hx3bP6I5JmAt0MW98DunrtR2pjyzlrZT3c9mV6C4J39ClikamuI?= =?us-ascii?Q?PCMnlVtaTcRlnflaTp41T/C6m2C4vGbNhqLe0bkgAZrtGnPnPzoQxKU8z1Wi?= =?us-ascii?Q?xayxXqN7VVB55GuaMpxy0xURnNvnhP1ZKPcSELm98yW5UXJkBVLEf84d36Qr?= =?us-ascii?Q?Vj1fm4nzkaMxYAMpPkaoR1cx490MqTK8nF03MorJ6RKXkEuiEqprqJNQhG4A?= =?us-ascii?Q?xGUYlYrgFsLpcuyHuoNVcOAi5fHR63c/lhn22Zb3nJWQE+F95ITs33zVvG6o?= =?us-ascii?Q?RNgeBer0ZN3S2ZOIaQH+Yh3VGd0wGuAbCTGwibMh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NuTha2I6QXI4UDGF9ZoyHt8Fy156m69f34i8DBPKFAuXGu55Mup8Jf?= =?us-ascii?Q?uGznUZJlOW8yqQk+xCzDKwcwygYcPK04989OlTzW7WVCfD2otEjDaHV6YQPT?= =?us-ascii?Q?LsapENw=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?U8a50HBXpiyLwjr6GTvmcAttnaCgUb7qQMSBAlZ8qtyIEwg9kndcJ8zHCnFI?= =?us-ascii?Q?g9PmJtxxWVonqK/1QArHqwxaEwezF9I3aC12ns4/VBSqoKn8fMEbkCtUIosT?= =?us-ascii?Q?iKr7ccacLV64CEgTziRQH0ZSbkzGqE3D86DgkvxH/dgP3P+JdLxZYcijWxK1?= =?us-ascii?Q?WpyGlACvZukn1R3eTIt9dJZKcgcp0AL+a3c8mmmlxWfGT5pNCNmR/LaCmiRH?= =?us-ascii?Q?k7pjLSEX6Sz99bdv8HLz7yW2Urke2glNURJwz26ChXBqo2w3GRpTg55O0Mlo?= =?us-ascii?Q?HGkHKpuB2tZIR3G5M4HQ3ljVnOmy4Dx+u+r1g/awP+DjJ/prn+C8szax3kRM?= =?us-ascii?Q?AC0uskp142Xmjwas8VIeyF3V7fSZZgfV5TeaEcYUFPxi8so3Lm/tsPRz0x9S?= =?us-ascii?Q?iiF/8Z41MD0AxcBNMWGcLNCJIHLpHWXERPqMLeo9J5JLV2BLSVTjSr4/XdmO?= =?us-ascii?Q?sTvtVSfx0QtvxSDcQINFkDDmvuH51zqPX4F3ga1miWCDiBJ70e0360dx1vn7?= =?us-ascii?Q?7xEx4jb+bHdfmil330+F/qASS2wXlP1Ech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q?6hAYWPIiF+5BuzK2p/lUMydRNL/KiK9uyBuEM+j/gAicI4YZxxC+ERk6ARaY?= =?us-ascii?Q?ds0+ikzdytgt7iFlu+7vxkNeYCxQo4IpheXrqFTeP5WBy/oeoRzBPJva4mL2?= =?us-ascii?Q?YKpqN/Kdr+yoHeaMl2W3dWXw6ByKYLIRG8fKY3CYrKJMnoWNN4ezOhqVLpBm?= =?us-ascii?Q?iQ=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07451113-42ca-47b2-e0ca-08dc85242220 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:42.0498 (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: +y0joDRNtnatz0jx1KZ192MYzF7BPDcSjl1B32+LLtof2ZZIO5mLSFPUKTeum3zivwwvLee1NBi/nQ3iNjDmcR7Yx4jNrQD9lyydk4fzWoI= 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 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)); } -- 2.39.1