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 86182A00C5 for ; Wed, 20 Jul 2022 10:22:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 46AFB41101; Wed, 20 Jul 2022 10:22:13 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2055.outbound.protection.outlook.com [40.107.102.55]) by mails.dpdk.org (Postfix) with ESMTP id 5120A4003C for ; Wed, 20 Jul 2022 10:22:12 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SCEaoKkqR+bDSzDuWAPkYecO4etRC4zLxsTVglSd6LQ5QUkQjIucXnBdCiDroY5YlvQCNOutHHTEkGNdBy6VT9V6dGptB66pkRRIQMGmYAKAlYRNviCcG2mYS0xmfF8weSS6xG3Zbxq/bgcpI/eqTpj4UYHt5YLMUERxB+01Zo7y3IWifKEcvkaOPiDqWoEugN3RlwbQU/ptSRQFPmVxdxNOlQAc7BHMhJHIvD2881Xh77Z4I3pUe5GD+24F+cJs99bV+pBf8xBSIgM+GxSkpYVx4Vl98zfOR1lCAU6Ahauj7T+1GWk7KeiI4kSeWB2nX7YLlAO4LwTS2BUIq3oNyA== 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=bkr142Cgc/OHnh4jIwKG1M2TN88WQdQgGxhkbPFLpzU=; b=U6hvE6nK8l2C99kpmjCQ5EXRRhGvI+z7qBKNfDY/wv2gIb5rbxqf/2Ih7Tuilx9cCnQMljoJBWAAhcOvOEji4B4ryXwvAEjjxNG/C3wV48yk2XpunmtAhCZA8bAlc84tK5ATtleYR93wzrWQGYN7kVf9ck7MmjER1BC7Zco03pB0Zc4KSkHNeOzbcF6M1bqNIRWRbzZY6v80TETpHWydD+x2Uo8U0jnurQV77TFi7SjE9sH3YaUgxtryCva4Vhhx47bvr5zA8wdHu9sVkzsKI8G68LiFZWVKafG4fZ2wNsysyfGfNm4MVtwp4YLuiqiIkbPZNlkhRY4tgD09LeQ4hg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) smtp.rcpttodomain=networkplumber.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bkr142Cgc/OHnh4jIwKG1M2TN88WQdQgGxhkbPFLpzU=; b=gskHpRzba0WMM6CtFVgwHtqrFVVNYiKiocTOxesDqFYjVBo8yAw9uf0IuPxY2lFo57trRp8X/xviV8pLED/dmfgK1Qs4aB+Lc4J8xfNSodMDWdgbGB3qbJSggt1PzIQNVgNiwaOIiAJogbmCmvtbllb/dTgXN1rm82U3EfPFVWZtcIBcWZRtKujDWk3Zr5vXuZBRyg+hoa5zFk0ggupXhqNm0DUMXNmcALYDLpiCUUlzSym9zTmmy5XmhJbtftKc1ktHl+rpmv99kiPHxyMMg3ysfIvW66JWq+nCJ7Zp1BuRIXUY8co1zXtj71IlArEC1hJN3ooUzR05uWK5pVTPXg== Received: from BN8PR04CA0006.namprd04.prod.outlook.com (2603:10b6:408:70::19) by MN2PR12MB4048.namprd12.prod.outlook.com (2603:10b6:208:1d5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.19; Wed, 20 Jul 2022 08:22:10 +0000 Received: from BN8NAM11FT009.eop-nam11.prod.protection.outlook.com (2603:10b6:408:70:cafe::f9) by BN8PR04CA0006.outlook.office365.com (2603:10b6:408:70::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.23 via Frontend Transport; Wed, 20 Jul 2022 08:22:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.238) by BN8NAM11FT009.mail.protection.outlook.com (10.13.176.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5458.17 via Frontend Transport; Wed, 20 Jul 2022 08:22:10 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 20 Jul 2022 08:22:09 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 20 Jul 2022 01:22:07 -0700 From: Xueming Li To: David Marchand CC: , Bruce Richardson , Stephen Hemminger , dpdk stable Subject: patch 'app/flow-perf: fix build with GCC 12' has been queued to stable release 20.11.6 Date: Wed, 20 Jul 2022 11:20:31 +0300 Message-ID: <20220720082132.3954126-2-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220720082132.3954126-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> <20220720082132.3954126-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 687626a2-2881-4027-ad70-08da6a28f150 X-MS-TrafficTypeDiagnostic: MN2PR12MB4048:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?utf-8?B?WldhVEtjZ1BBVW40SWdNRXhjd2p5OGo2S0MrS2FCYW1TM1J4bzFkTDQ0Vzh0?= =?utf-8?B?ZlZiNkpiVXpHbU5CekZoeFVlQjZMTnp3SC94VXUxQVg3MFRGNjY0VFhMNEh4?= =?utf-8?B?YlZNZ2tzT1ZoL3IxSWMxTDdNbW9nVFFyaEY4a1h2dTJnd1B3ZFBJZ0pqWDlT?= =?utf-8?B?UkpXbndGaDROeXFJNTViUFZYditMWDJmUERZWm9nYlB0WFlEd01OeFhqeFdK?= =?utf-8?B?bm8vVTlWUGg3cXlsYkk1T2pCbVFqQUM4WlRZS1ByKzg0K3cxekRBenNTM1Rx?= =?utf-8?B?OHByeEdwR25nTEc4dEUrOURteXJUQUJkMndvTWEyMmJCdXd5Z0VWMFZhVWpo?= =?utf-8?B?WStTY0FSbFp5MFdJbEl1NlBBTllPMEhQUHBSN0tSdFFJeE9sbGM4NVRIcmFO?= =?utf-8?B?d2NwMXZQK2Yvcy9tc091ZHFneDZtVmtWS21aYTg0bmtkSjNaZDRnRm1KNzVB?= =?utf-8?B?cllEMEtFQ01mNDYzNjE5KzRGZzhXWmozcTROMWRuTy9jR09YMVcvc2RFaFpw?= =?utf-8?B?S2dvdFlXS1NsclFrODgzMEU1UkxsMEZ5eWtCcjNscnNLazNDZ3hGZEZkRmN5?= =?utf-8?B?cUpwRktpRjBmTmthYjEwclo2UlgxTTVEaEtPaURiUkw3SG51T1ovOWIvK2lG?= =?utf-8?B?TDBQUVhSdkNYbm5TR2VWaUt4WEZBNnR4QmdvNy9HWllqU2NPRThEOHZnNTlO?= =?utf-8?B?NE1LeDRRejVFTG5temYzM1g5WUttT2J4SHNadGswdzBvaW9lTWQzbGxubFZ6?= =?utf-8?B?V0ZsT1ByQkdscEpxVCtOSkRBeDZ3bUtZS1YyMmRXMEI0dC8zTWdaMDZ3R3pB?= =?utf-8?B?Mys1VnlIUnlTQTdxbkY2dzJ5eW9aZHZtTGR5QThFTS9JUGhFcUUxQ2krVURN?= =?utf-8?B?Y3ZzbXlZSlJ5NU5mMW5Ea3hsNFpxUUllR05JdHdmY3ZldEhQYW1KVUdjUmY5?= =?utf-8?B?L0FxaUxUcWNXNFJZRksxeXZaWmUvU0w0M1NhSDFiUkVUUkZ4SC95aGk5U3d3?= =?utf-8?B?QklVYnR6SUFWYzBXVmRETUM0VWpmS281bUoxOWIxZ21OcGdUNXF6dmlvUUsz?= =?utf-8?B?YkVJeVB5YUJoWUl6alBJS0o3RlFuMk50QjJ4QTF6TXorb2NxbFplZEg3U1Yz?= =?utf-8?B?R2w1QUg2V3ZoNXk1eHRDcWQyTDZESHk5amhNNzhzL2t0SEdhUVR3OFl2eWxE?= =?utf-8?B?eFhTN1pBclZ1N2w3MFlBV2hwRzNSVGlBUnBHWkt5VngwMFdPeTJpbW1XTXdO?= =?utf-8?B?Rk54YlQrWncvWXhuL3FZMldCc1BxNnJaeUVQcGpvNzRRT1lndz09?= X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(376002)(396003)(346002)(39860400002)(136003)(40470700004)(46966006)(36840700001)(356005)(40480700001)(53546011)(81166007)(47076005)(55016003)(8676002)(4326008)(86362001)(70206006)(186003)(1076003)(16526019)(5660300002)(70586007)(82740400003)(8936002)(336012)(426003)(2616005)(478600001)(41300700001)(83380400001)(54906003)(6916009)(966005)(6666004)(316002)(7696005)(36860700001)(36756003)(6286002)(40140700001)(2906002)(26005)(40460700003)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2022 08:22:10.4304 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 687626a2-2881-4027-ad70-08da6a28f150 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT009.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4048 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/22/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/3582b40156df314c5d129fc89d39634c17edc98d Thanks. Xueming Li --- >From 3582b40156df314c5d129fc89d39634c17edc98d Mon Sep 17 00:00:00 2001 From: David Marchand Date: Wed, 18 May 2022 12:16:56 +0200 Subject: [PATCH] app/flow-perf: fix build with GCC 12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Xueming Li [ upstream commit 5fc2eece8d4530988e5681fdc8a35e14d69b2a6f ] GCC 12 raises the following warning: ../app/test-flow-perf/main.c: In function ‘start_forwarding’: ../app/test-flow-perf/main.c:1737:28: error: ‘sprintf’ may write a terminating nul past the end of the destination [-Werror=format-overflow=] 1737 | sprintf(p[i++], "%d", (int)n); | ^ In function ‘pretty_number’, inlined from ‘packet_per_second_stats’ at ../app/test-flow-perf/main.c:1792:4, inlined from ‘start_forwarding’ at ../app/test-flow-perf/main.c:1831:3: [...] We can simplify this code and rely on libc integer formatting via this system locales. Bugzilla ID: 856 Signed-off-by: David Marchand Acked-by: Bruce Richardson Acked-by: Stephen Hemminger --- app/test-flow-perf/main.c | 48 ++++++++------------------------------- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 3b3ecdc75e..899f6c93b6 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -16,6 +16,7 @@ * gives packet per second measurement. */ +#include #include #include #include @@ -1044,36 +1045,6 @@ do_tx(struct lcore_info *li, uint16_t cnt, uint16_t tx_port, rte_pktmbuf_free(li->pkts[i]); } -/* - * Method to convert numbers into pretty numbers that easy - * to read. The design here is to add comma after each three - * digits and set all of this inside buffer. - * - * For example if n = 1799321, the output will be - * 1,799,321 after this method which is easier to read. - */ -static char * -pretty_number(uint64_t n, char *buf) -{ - char p[6][4]; - int i = 0; - int off = 0; - - while (n > 1000) { - sprintf(p[i], "%03d", (int)(n % 1000)); - n /= 1000; - i += 1; - } - - sprintf(p[i++], "%d", (int)n); - - while (i--) - off += sprintf(buf + off, "%s,", p[i]); - buf[strlen(buf) - 1] = '\0'; - - return buf; -} - static void packet_per_second_stats(void) { @@ -1095,7 +1066,6 @@ packet_per_second_stats(void) uint64_t total_rx_pkts = 0; uint64_t total_tx_drops = 0; uint64_t tx_delta, rx_delta, drops_delta; - char buf[3][32]; int nr_valid_core = 0; sleep(1); @@ -1120,10 +1090,8 @@ packet_per_second_stats(void) tx_delta = li->tx_pkts - oli->tx_pkts; rx_delta = li->rx_pkts - oli->rx_pkts; drops_delta = li->tx_drops - oli->tx_drops; - printf("%6d %16s %16s %16s\n", i, - pretty_number(tx_delta, buf[0]), - pretty_number(drops_delta, buf[1]), - pretty_number(rx_delta, buf[2])); + printf("%6d %'16"PRId64" %'16"PRId64" %'16"PRId64"\n", + i, tx_delta, drops_delta, rx_delta); total_tx_pkts += tx_delta; total_rx_pkts += rx_delta; @@ -1134,10 +1102,9 @@ packet_per_second_stats(void) } if (nr_valid_core > 1) { - printf("%6s %16s %16s %16s\n", "total", - pretty_number(total_tx_pkts, buf[0]), - pretty_number(total_tx_drops, buf[1]), - pretty_number(total_rx_pkts, buf[2])); + printf("%6s %'16"PRId64" %'16"PRId64" %'16"PRId64"\n", + "total", total_tx_pkts, total_tx_drops, + total_rx_pkts); nr_lines += 1; } @@ -1441,6 +1408,9 @@ main(int argc, char **argv) if (argc > 1) args_parse(argc, argv); + /* For more fancy, localised integer formatting. */ + setlocale(LC_NUMERIC, ""); + init_port(); nb_lcores = rte_lcore_count(); -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-20 15:00:58.921991922 +0800 +++ 0002-app-flow-perf-fix-build-with-GCC-12.patch 2022-07-20 15:00:58.641000610 +0800 @@ -1 +1 @@ -From 5fc2eece8d4530988e5681fdc8a35e14d69b2a6f Mon Sep 17 00:00:00 2001 +From 3582b40156df314c5d129fc89d39634c17edc98d Mon Sep 17 00:00:00 2001 @@ -7,0 +8,3 @@ +Cc: Xueming Li + +[ upstream commit 5fc2eece8d4530988e5681fdc8a35e14d69b2a6f ] @@ -28 +30,0 @@ -Cc: stable@dpdk.org @@ -38 +40 @@ -index 56d43734e3..f375097028 100644 +index 3b3ecdc75e..899f6c93b6 100644 @@ -49 +51 @@ -@@ -1713,36 +1714,6 @@ do_tx(struct lcore_info *li, uint16_t cnt, uint16_t tx_port, +@@ -1044,36 +1045,6 @@ do_tx(struct lcore_info *li, uint16_t cnt, uint16_t tx_port, @@ -86 +88 @@ -@@ -1764,7 +1735,6 @@ packet_per_second_stats(void) +@@ -1095,7 +1066,6 @@ packet_per_second_stats(void) @@ -94 +96 @@ -@@ -1789,10 +1759,8 @@ packet_per_second_stats(void) +@@ -1120,10 +1090,8 @@ packet_per_second_stats(void) @@ -107 +109 @@ -@@ -1803,10 +1771,9 @@ packet_per_second_stats(void) +@@ -1134,10 +1102,9 @@ packet_per_second_stats(void) @@ -121 +123 @@ -@@ -2139,6 +2106,9 @@ main(int argc, char **argv) +@@ -1441,6 +1408,9 @@ main(int argc, char **argv)