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 2F8E9A034F for ; Wed, 10 Nov 2021 07:47:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F88640142; Wed, 10 Nov 2021 07:47:16 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2053.outbound.protection.outlook.com [40.107.237.53]) by mails.dpdk.org (Postfix) with ESMTP id 0A7E340E03 for ; Wed, 10 Nov 2021 07:47:14 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d0/Z/R30JQB/IP8kRgZZ77UIPLsISje23z/tbfr8yU6Pj8BrYyYfdEo1RoL6PRTWfod4FcuRsKaNndDUmBWq0sepr7wdN54/SUerTQ5obaGi9a3LHIofsXpZHEJYmN/tqphkugzUTf9obPWYplRv0vr+PuJxzovXE9jFqNL4t4kdjyX/2E7Mmj2nqeUkFPSTpevmNdx2yCzQVvr4JFuG0piSeCgjWKSf6LiD/0t+fXBUsRFH4XjWYmsyw02ZT2rZ2tZSHPeskVqAdC7aY3muPrLPk8wHKhp+wDaw8IarGvUuv7P6VsoKQcYhGAJKcL9daBwjic1nyBtEGt3JuwFfRw== 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=148Pjqr+tybSTsgoxwXSAyhDQshGLgh5cBPPrxq4hh4=; b=BlNa4E1xr3xEt7W+rqhPhYSoB1/2/3jn9Bg8IHCjZ+KFBiZDlJT7DLwmKX0u+Z/USM/hoD/3Cno0Kpg+iv5rAOukS23N1p/dWdP8CoHbIKh0Nmq7IyMIPRuG2WzAqACaZQzPCpKsa6cEoZVNpWQFQcIwsyrBmEAoHs5O14kaQ415EhqOnRuaIr7Tw7HFk+xB08Q00+RB6P6yVvFWVcVEkXVprr8NMWisOeWvUHf6gH+DGMSOMHiE8SvlVHH5eU2y1PyAf8UkvYMzbW8zUkKRi7KtgPuPbsYaEtwUh/1F1spEGBuNuNKprdB9HKZoiFKWHxORxfycE6dkNAv6gAS0cw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=148Pjqr+tybSTsgoxwXSAyhDQshGLgh5cBPPrxq4hh4=; b=VQzaNP/+x9uBbN/A24ncg1iapsUpwgGabB5u0EWLVTsYo6YQQUw+jKF/l6XlEeNd5zHkgg9nNHfcsbogIOaVsPD2EYfzb9MWuBDwzC6bEAHb821dAUBYLn+pAXhJsV7+6E5vyXEiatPG8IjvowWrtpjhMYrCgF0GKlVOKi4zPe7g5i18v5/+hBXYRwIMtNV/WVoWFIBWnIaqH458Oe0JqCvaRUQeFPS1ny82qs4pZLc1Xun6cR4N2wP4RBuvr6LcCDtIcnooxC9StIvn8zhMVWKQY9Vx+Rl8H58l55VEMIk/4wdVDgtYBCGhPYyR34mSKurgT027ioYCetTiMtYVJg== Received: from BN8PR07CA0009.namprd07.prod.outlook.com (2603:10b6:408:ac::22) by DM6PR12MB4266.namprd12.prod.outlook.com (2603:10b6:5:21a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 06:47:12 +0000 Received: from BN8NAM11FT025.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ac:cafe::1c) by BN8PR07CA0009.outlook.office365.com (2603:10b6:408:ac::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 06:47:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT025.mail.protection.outlook.com (10.13.177.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:47:10 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:47:08 +0000 From: Xueming Li To: Alvin Zhang CC: Luca Boccassi , Xiaoyun Li , dpdk stable Date: Wed, 10 Nov 2021 14:30:17 +0800 Message-ID: <20211110063216.2744012-134-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 87d9dd46-2002-46aa-e98c-08d9a415ebf1 X-MS-TrafficTypeDiagnostic: DM6PR12MB4266: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KARk1o/gyfU2f+bHoh8AWYKE5XiAa0AR+/h8OLqCWItNnTGXTc+mi6GjKyRMK3Xh3nvx8Y+jBGgdyzu3uM50IkuzMxA/hJXyoSf9xmUWDyCEjIxntB2wLTmCyPrzpsTRusqCmBTNlb70wgtxLl3nYCRdE/HZ+VbnjdGGenrdivX9XwbYrEenXvgw13wdr2sQNXorURuQJtFSRyhEIYr4K9oXFA8MucoEinNj091BQPBWM/QxQarA8geR3ZyvES74Xt/tlXfSXjOCO6zW8smjT78eivI+uiUm5W6YDzI7uATCmCSqIZtInZRFaUbx39GZxkdpJ2NDwDnMzPSQgFy3r33SaJ30MeHpPWFpQTElsGXPQWlNnO1YWJZ2nXrET4SaifTo8w9RVkY12ClHp9jTwnQB3ruddFpu0C0KVDgNN2XEnaOWvkSaJjF9zm3hsh6+2scOGm1PdN2XKVOeaOkR0/TtGXKu2RWi27DtlpLD7Us0+OBeGE4XZXV2huo+KHOjHxfz9yAWmfboMFb5gaouuMq2JIiGgLfRYiPOWXXO+uVE8Y7JUs0dBUbfaPcbxaHa4Sno3oyfGnL3G2byFlNoPHG/ItdjJiRsE7r5JFFEBqJ79md2i3oLf+wuMrIkXh+BZSBeKZMqgNFikoPjoPc7t0DybVWmBT14AQ1bP+/QvkUEgFLkI2kk/1EjUDgjpFX44SJqXRGtbn/HOIQ7Cch64xMehnB2ntXEH1jfDnVbw2PUHw+w96vFkgAJYVp2TWal7jqmfixePA5AJxuJ9yhihI2UkL61syQxk7HNAkv7mHBvuHO7v9sH650FFNFV1XkaUQAZnuQp+ZUuRgDSBiKn8g== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(316002)(36906005)(508600001)(55016002)(7696005)(36756003)(70586007)(5660300002)(54906003)(426003)(40140700001)(8676002)(82310400003)(4326008)(53546011)(36860700001)(70206006)(83380400001)(356005)(966005)(8936002)(6286002)(26005)(6916009)(86362001)(336012)(16526019)(2906002)(4001150100001)(186003)(2616005)(15650500001)(47076005)(6666004)(7636003)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:47:10.7745 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87d9dd46-2002-46aa-e98c-08d9a415ebf1 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT025.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4266 Subject: [dpdk-stable] patch 'app/testpmd: update forward engine beginning' has been queued to stable release 20.11.4 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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/f8466ee10ff01f35dd4de5ad9b0df1eb59a91f82 Thanks. Xueming Li --- >From f8466ee10ff01f35dd4de5ad9b0df1eb59a91f82 Mon Sep 17 00:00:00 2001 From: Alvin Zhang Date: Thu, 23 Sep 2021 16:01:28 +0800 Subject: [PATCH] app/testpmd: update forward engine beginning Cc: Xueming Li [ upstream commit a78040c990cb7beac2a7daac8f18646c54e2fd07 ] For each forward engine, there may be some special conditions must be met before the forwarding runs. Adding checks for these conditions in configuring is not suitable, because one condition may rely on multiple configurations, and the conditions required by each forward engine is not general. The best solution is each forward engine has a callback to check whether these conditions are met, and then testpmd can call the callback to determine whether the forwarding can be started. There was a void callback 'port_fwd_begin' in forward engine, it did some initialization for forwarding, this patch updates its return value then we can add some checks in it to confirm whether the forwarding can be started. In addition, this patch calls the callback before the forwarding stats is reset and then launches the forwarding engine. Bugzilla ID: 797 Signed-off-by: Alvin Zhang Acked-by: Xiaoyun Li --- app/test-pmd/ieee1588fwd.c | 3 ++- app/test-pmd/noisy_vnf.c | 4 +++- app/test-pmd/testpmd.c | 38 ++++++++++++++++++++++++++------------ app/test-pmd/testpmd.h | 2 +- app/test-pmd/txonly.c | 3 ++- 5 files changed, 34 insertions(+), 16 deletions(-) diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index e3b98e3e0c..a949d24d5c 100644 --- a/app/test-pmd/ieee1588fwd.c +++ b/app/test-pmd/ieee1588fwd.c @@ -198,10 +198,11 @@ ieee1588_packet_fwd(struct fwd_stream *fs) port_ieee1588_tx_timestamp_check(fs->rx_port); } -static void +static int port_ieee1588_fwd_begin(portid_t pi) { rte_eth_timesync_enable(pi); + return 0; } static void diff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c index 382a4c2aae..e4434bea95 100644 --- a/app/test-pmd/noisy_vnf.c +++ b/app/test-pmd/noisy_vnf.c @@ -231,7 +231,7 @@ noisy_fwd_end(portid_t pi) rte_free(noisy_cfg[pi]); } -static void +static int noisy_fwd_begin(portid_t pi) { struct noisy_config *n; @@ -273,6 +273,8 @@ noisy_fwd_begin(portid_t pi) rte_exit(EXIT_FAILURE, "--noisy-lkup-memory-size must be > 0\n"); } + + return 0; } struct fwd_engine noisy_vnf_engine = { diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 5288c04ab6..75714ff648 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2074,16 +2074,10 @@ run_one_txonly_burst_on_core(void *fwd_arg) static void launch_packet_forwarding(lcore_function_t *pkt_fwd_on_lcore) { - port_fwd_begin_t port_fwd_begin; unsigned int i; unsigned int lc_id; int diag; - port_fwd_begin = cur_fwd_config.fwd_eng->port_fwd_begin; - if (port_fwd_begin != NULL) { - for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) - (*port_fwd_begin)(fwd_ports_ids[i]); - } for (i = 0; i < cur_fwd_config.nb_fwd_lcores; i++) { lc_id = fwd_lcores_cpuids[i]; if ((interactive == 0) || (lc_id != rte_lcore_id())) { @@ -2128,10 +2122,35 @@ start_packet_forwarding(int with_tx_first) printf("Packet forwarding already started\n"); return; } - test_done = 0; fwd_config_setup(); + port_fwd_begin = cur_fwd_config.fwd_eng->port_fwd_begin; + if (port_fwd_begin != NULL) { + for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) { + if (port_fwd_begin(fwd_ports_ids[i])) { + fprintf(stderr, + "Packet forwarding is not ready\n"); + return; + } + } + } + + if (with_tx_first) { + port_fwd_begin = tx_only_engine.port_fwd_begin; + if (port_fwd_begin != NULL) { + for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) { + if (port_fwd_begin(fwd_ports_ids[i])) { + fprintf(stderr, + "Packet forwarding is not ready\n"); + return; + } + } + } + } + + test_done = 0; + if(!no_flush_rx) flush_fwd_rx_queues(); @@ -2140,11 +2159,6 @@ start_packet_forwarding(int with_tx_first) fwd_stats_reset(); if (with_tx_first) { - port_fwd_begin = tx_only_engine.port_fwd_begin; - if (port_fwd_begin != NULL) { - for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) - (*port_fwd_begin)(fwd_ports_ids[i]); - } while (with_tx_first--) { launch_packet_forwarding( run_one_txonly_burst_on_core); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 927ca587d3..b54958165a 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -266,7 +266,7 @@ struct fwd_lcore { * Forwards packets unchanged on the same port. * Check that sent IEEE1588 PTP packets are timestamped by the hardware. */ -typedef void (*port_fwd_begin_t)(portid_t pi); +typedef int (*port_fwd_begin_t)(portid_t pi); typedef void (*port_fwd_end_t)(portid_t pi); typedef void (*packet_fwd_t)(struct fwd_stream *fs); diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index d55ee7ca00..93d121fd57 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -423,7 +423,7 @@ pkt_burst_transmit(struct fwd_stream *fs) get_end_cycles(fs, start_tsc); } -static void +static int tx_only_begin(portid_t pi) { uint16_t pkt_data_len; @@ -455,6 +455,7 @@ tx_only_begin(portid_t pi) timestamp_init_req++; /* Make sure all settings are visible on forwarding cores.*/ rte_wmb(); + return 0; } struct fwd_engine tx_only_engine = { -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:07.851812489 +0800 +++ 0133-app-testpmd-update-forward-engine-beginning.patch 2021-11-10 14:17:01.897412539 +0800 @@ -1 +1 @@ -From a78040c990cb7beac2a7daac8f18646c54e2fd07 Mon Sep 17 00:00:00 2001 +From f8466ee10ff01f35dd4de5ad9b0df1eb59a91f82 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit a78040c990cb7beac2a7daac8f18646c54e2fd07 ] @@ -25 +27,0 @@ -Cc: stable@dpdk.org @@ -30 +31,0 @@ - app/test-pmd/flowgen.c | 3 ++- @@ -36 +37 @@ - 6 files changed, 36 insertions(+), 17 deletions(-) + 5 files changed, 34 insertions(+), 16 deletions(-) @@ -38,17 +38,0 @@ -diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c -index a96169e680..7ebed9fed3 100644 ---- a/app/test-pmd/flowgen.c -+++ b/app/test-pmd/flowgen.c -@@ -201,10 +201,11 @@ pkt_burst_flow_gen(struct fwd_stream *fs) - get_end_cycles(fs, start_tsc); - } - --static void -+static int - flowgen_begin(portid_t pi) - { - printf(" number of flows for port %u: %d\n", pi, nb_flows_flowgen); -+ return 0; - } - - struct fwd_engine flow_gen_engine = { @@ -56 +40 @@ -index 9cf10c1c50..b85a4aa87b 100644 +index e3b98e3e0c..a949d24d5c 100644 @@ -95 +79 @@ -index 97ae52e17e..eec4f1b81d 100644 +index 5288c04ab6..75714ff648 100644 @@ -98 +82 @@ -@@ -2172,16 +2172,10 @@ run_one_txonly_burst_on_core(void *fwd_arg) +@@ -2074,16 +2074,10 @@ run_one_txonly_burst_on_core(void *fwd_arg) @@ -115,2 +99,2 @@ -@@ -2227,10 +2221,35 @@ start_packet_forwarding(int with_tx_first) - fprintf(stderr, "Packet forwarding already started\n"); +@@ -2128,10 +2122,35 @@ start_packet_forwarding(int with_tx_first) + printf("Packet forwarding already started\n"); @@ -152 +136 @@ -@@ -2239,11 +2258,6 @@ start_packet_forwarding(int with_tx_first) +@@ -2140,11 +2159,6 @@ start_packet_forwarding(int with_tx_first) @@ -165 +149 @@ -index 5863b2f43f..e9d9db06ce 100644 +index 927ca587d3..b54958165a 100644 @@ -168 +152 @@ -@@ -268,7 +268,7 @@ struct fwd_lcore { +@@ -266,7 +266,7 @@ struct fwd_lcore { @@ -178 +162 @@ -index 40655801cc..6b3651f855 100644 +index d55ee7ca00..93d121fd57 100644 @@ -181 +165 @@ -@@ -435,7 +435,7 @@ pkt_burst_transmit(struct fwd_stream *fs) +@@ -423,7 +423,7 @@ pkt_burst_transmit(struct fwd_stream *fs) @@ -190 +174 @@ -@@ -467,6 +467,7 @@ tx_only_begin(portid_t pi) +@@ -455,6 +455,7 @@ tx_only_begin(portid_t pi)