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 EA6FFA034F; Wed, 10 Nov 2021 13:57:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 034AC410F2; Wed, 10 Nov 2021 13:57:50 +0100 (CET) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2073.outbound.protection.outlook.com [40.107.102.73]) by mails.dpdk.org (Postfix) with ESMTP id 6B30B40E28 for ; Wed, 10 Nov 2021 13:57:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fOWI/JvmP5nSB7Dg2febr9ELhkS0KGKNYfr4kP6O65gpTTW5O9+lj7b9xtLIu4GznjLpodpKxpvo2fcybFk61zK7K8Nx00xJMuv6ay2mfuHf1ZJVSuBnLX9SQH0LozAMKpEDpTmeVmMyo82q0URHhOn6xpb1Gcukg6KgmDEQo73OqgCrL6d+4MmTlsqRmyem/cOGMo6WOaQlKu3YlfmAdzsItYuSA4yskidLHhDZK16eKHTfz3Jhwwu6ta2KZXzaX5yrS1arBNb0u7+nqZXBdOwt5eX0BAXjo5h13xz2u0lPFMH0DywKCArLoGlf6Gnd5pK3C6SGVf8MVi7BjG8iAA== 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=mpBzNJtfO1eTVU6hPAwswRCDFWMIslXoM7zKSgCu2tc=; b=Vjkw8LNAHjWPPNMJpVnVTj/U5ypoC6qBMhD72H6+eJoqsA49y459b86LaMnnHFstSlNLEX2vWGZ0pJ6DxbuvHdUf7fWVlxXPgQ7EKwRuALMQKmIoKvH73YtTqrYfscEmqEguyCa6i05h8odrZzQW+m7esfuqKVAGXnrGiOTZG+lzaaTBS7kup6xSONICpW+1jVYHzuD1vObKOWaZzs0WwA3kU1HPSRFYJrk2QM6E3ckrSn8wmgbM1gluXsaZvzI2vqvHnTtHm8+yOoPGHAcdph2Qdo9QMXpP591ycvYrATgqLQC3v92rJXwQdTKA9PnrO61SkuaRohUkDP16jl6t5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org 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=mpBzNJtfO1eTVU6hPAwswRCDFWMIslXoM7zKSgCu2tc=; b=cRvq7GZtI7PUvehMwfNkYJebZDNiQ7xz/KQS0+1rDePNoanO3/lQYFFd52IhQplXnzKHqgYrVN9eRCG1VdTbZhPJEqBWVz18Dj8QnHp+W5X2L2AwYsS7LfRhTLZ5BJY/Ml1JIeB37yex4g6CQT1L2TdE9UJ6TVkae481dWJlFsx5+u+ETsVirtzizEAmywpZiNxefohZhZtZYoK7mXLtInKcD70y3KmwDz9Fc8CKV3LDfKvyKszNclTXJssup41C4AIk/dMWrICTKpmy5GSKdP6rwB2w8dEUYmNJI9wpdwBtbcCqnhi+t2AUJ7xGoUxEtGMagKtOJF3wXXrNZpqwng== Received: from CO2PR04CA0199.namprd04.prod.outlook.com (2603:10b6:104:5::29) by MN2PR12MB2878.namprd12.prod.outlook.com (2603:10b6:208:aa::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.15; Wed, 10 Nov 2021 12:57:46 +0000 Received: from CO1NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:104:5:cafe::af) by CO2PR04CA0199.outlook.office365.com (2603:10b6:104:5::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16 via Frontend Transport; Wed, 10 Nov 2021 12:57:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 CO1NAM11FT008.mail.protection.outlook.com (10.13.175.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 12:57:46 +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 12:57:43 +0000 From: Rongwei Liu To: , , , , Wisam Jaddo CC: , Date: Wed, 10 Nov 2021 14:57:24 +0200 Message-ID: <20211110125725.2076706-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211110125725.2076706-1-rongweil@nvidia.com> References: <6177033.fEpqbVaury@thomas> <20211110125725.2076706-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 811f6c5c-0ca4-49fd-41a9-08d9a449b124 X-MS-TrafficTypeDiagnostic: MN2PR12MB2878: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e4N14ce8alWr4gzIBdpmJPzXzIKIygiy1iUriVArmpeRTpIbbPWUTidJlfo7od8I5b+wiEjkiRag81n9KqmtkcCStLled0fIlH8kHO9fBznLTkhBKI5mXiKZQTh+L3m4eYmFwplLxYxH9O7/EYJRrPYC0qStHfw0Ku3rltA8QRdtCI826sjTFaVzHdgqki0yM1ZTF1QlY0szR7iD7q/sbIUF+TqqnvoPSjvVidtjEL9pO0UvJqZUUlK8EgP/FpiKFJozEoVS33lbqlo8B9jf/Mg543F+0XCv+7CNWHsTdY+uGHBTvyF5MeB0apV4vvWdCjgLOq86pJ61jX9xjKzedKnJ949tn1/C/iAtjJlb9DeOPZIoNgJs8af5UQJvhzdHUxtNpM/0p0c3VGBUD9lUgfAoo41EBOfCNc0k00sPqAJAY35LbV/w1RzIxZ8/2YZ/QrUsFJZbtPSIh6yibHQ9wKRW7ldyzzRAth+QaTfnMPXgUVlvS5eAgED6/plEKcRHfkJ9JtYsJJRzA2OJUNPDoXeCkCTwYhY9cKrFn0PacF1gzBbU/u9iqh9JPtquYBl/L2GUYwac7Rj4geCsxe/dfZWIWMmjfJCIm0dmN7pkX4kzoWG09Wc30IHvTSF41vZeW5+5dqFxH1Yih/Vl6BaQreikLNaffInxe2VA2vcbTxl0yVJHFzTltSiFMV+AYwfuVJGZW12aUNx6Qm/8ZUeWZw== 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)(6286002)(7636003)(110136005)(107886003)(356005)(47076005)(5660300002)(2906002)(70206006)(2616005)(36860700001)(70586007)(1076003)(83380400001)(6666004)(55016002)(316002)(36756003)(8936002)(82310400003)(508600001)(7696005)(4326008)(54906003)(336012)(86362001)(426003)(16526019)(186003)(6636002)(26005)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 12:57:46.0027 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 811f6c5c-0ca4-49fd-41a9-08d9a449b124 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: CO1NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB2878 Subject: [dpdk-dev] [PATCH v8 2/3] app/flow-perf: support dynamic values for meter profile 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 Sender: "dev" Change meter-cir option to meter-profile to cover user input for CIR, CBS & EBS values. The usage is as below: --meter-profile=N1,N2,N3 default value is 1250000 156250 0. Signed-off-by: Rongwei Liu Acked-by: Wisam Monther --- app/test-flow-perf/main.c | 24 +++++++++++++++++++++--- doc/guides/tools/flow-perf.rst | 3 +++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 89596eb3f6..01bfa20db7 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -85,6 +85,7 @@ static uint32_t hairpin_queues_num; /* total hairpin q number - default: 0 */ static uint32_t nb_lcores; static uint8_t max_priority; static uint32_t rand_seed; +static uint64_t meter_profile_values[3]; /* CIR CBS EBS values. */ #define MAX_PKT_BURST 32 #define LCORE_MODE_PKT 1 @@ -484,6 +485,9 @@ usage(char *progname) "and S as seed for pseudo-random number generator\n"); printf(" --unique-data: flag to set using unique data for all" " actions that support data, such as header modify and encap actions\n"); + printf(" --meter-profile=cir,cbs,ebs: set CIR CBS EBS parameters in meter" + " profile, default values are %d,%d,%d\n", METER_CIR, + METER_CIR / 8, 0); printf("To set flow attributes:\n"); printf(" --ingress: set ingress attribute in flows\n"); @@ -707,6 +711,7 @@ args_parse(int argc, char **argv) { "vxlan-encap", 0, 0, 0 }, { "vxlan-decap", 0, 0, 0 }, { "policy-mtr", 1, 0, 0 }, + { "meter-profile", 1, 0, 0 }, }; RTE_ETH_FOREACH_DEV(i) @@ -926,6 +931,17 @@ args_parse(int argc, char **argv) } if (strcmp(lgopts[opt_idx].name, "policy-mtr") == 0) read_meter_policy(argv[0], optarg); + if (strcmp(lgopts[opt_idx].name, + "meter-profile") == 0) { + i = 0; + token = strsep(&optarg, ",\0"); + while (token != NULL && i < sizeof( + meter_profile_values) / + sizeof(uint64_t)) { + meter_profile_values[i++] = atol(token); + token = strsep(&optarg, ",\0"); + } + } break; default: usage(argv[0]); @@ -1251,9 +1267,11 @@ create_meter_profile(void) if (!((ports_mask >> port_id) & 0x1)) continue; mp.alg = RTE_MTR_SRTCM_RFC2697; - mp.srtcm_rfc2697.cir = METER_CIR; - mp.srtcm_rfc2697.cbs = METER_CIR / 8; - mp.srtcm_rfc2697.ebs = 0; + mp.srtcm_rfc2697.cir = meter_profile_values[0] ? + meter_profile_values[0] : METER_CIR; + mp.srtcm_rfc2697.cbs = meter_profile_values[1] ? + meter_profile_values[1] : METER_CIR / 8; + mp.srtcm_rfc2697.ebs = meter_profile_values[2]; ret = rte_mtr_meter_profile_add (port_id, DEFAULT_METER_PROF_ID, &mp, &error); if (ret != 0) { diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst index ec6994e412..3f1e5986e3 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -134,6 +134,9 @@ The command line options are: * ``--total-mbuf-count=N`` Set the count of total mbuf number, default count is 32000. +* ``--meter-profile=N1,N2,N3`` + Set the CIR, CBS and EBS parameters, default values are 1250000, 156250 and 0. + Attributes: * ``--ingress`` -- 2.27.0