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 C3716A0C4D; Mon, 8 Nov 2021 12:11:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B13D44113F; Mon, 8 Nov 2021 12:11:18 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2052.outbound.protection.outlook.com [40.107.95.52]) by mails.dpdk.org (Postfix) with ESMTP id 4770841120 for ; Mon, 8 Nov 2021 12:11:16 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cIknevaqhmKIBc71knhHef7EsrDgQXB46nE+MIQXy5uuoncMMugseNBR0/Tj086lZuvkHMaXuKwi9HX+ZIafQ3pbki2MGhT1Gj2mtSWqD0WrIfeQaNbrFtMDquBZOwpwb5lyCSJsnJfhP/0QVKh0FkYmtFHkTZxvZ6HbFoCEGAZP304vHfZiqoNX/5YpjdDnqbGitIZRorG3VZoU25RZ55EuT/N+xV2ZmqdDVCIXT/cNMbqAYVP6wtU2nS9Z1kSpgK/jU8ULbnL2eaegG4vT8SqMahlfKt50bVGbl8e3ecGLfFTotH1NsesiBo1SSNntpsCmp9aw4AAF6gqQ+6EQlQ== 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=/UsWaLpGnwi5zrzH+OlzwoS7U5nSuzTiQGf6qPFVNQE=; b=HM3o8YjMH4/+scbmLsMvsl0o5S6i31gbGcLMSxuz+bBWOiZKB62vu8n4tWblu6jwaGFPH4rtV+3oXmlLNA5fSbcWIM9mjR5XYe3mk0nBjq9OhX4ErG7OHCAfoMpMJWaNVZC2/ZhkdawaiTYpiGLVguEP+CbzaEO3JGBmb4zYyazg/m6ZUS6srqeT/0bkc94XqzDoB61xseakbdNEbasGU3WBhN6Ayqxfa37ni6sL+bBoYwsd7e97LFqCBV1k7SQuutN9BhucrVaYYNhpiET5I2eYWhLhTUZhC+dOu7kUU1C8R2/a+4pDQyxHRgx774serwKm0aHH1+f/oZvM04xUuQ== 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=/UsWaLpGnwi5zrzH+OlzwoS7U5nSuzTiQGf6qPFVNQE=; b=mgklN+Q+oTTyEVGZsOHSKatH3hlLj8w7AIHXI+FQ129qdzHM4cxFDZ0bQIAitWUVpi5dP/1XC5upxSVLM/5qBk7Qv3P5e0CjY8Z9cgR++hG6tFgfuudWU/LJe70Z5+BIDfmnbh75a9iS/HxpWvD3i6ugkQffrvbu+MRdXUJ9/e25N2BcmLRgTjEQssCLM0TvptHCggFyVIGndIoTCGyRI39DamRFQG3Pwoh4qqh3bvEV5iSAu0EzWwdXGqPqNPyJQgQcYRdzs78JdOn+dfWFz8B68JQ/pgUuyUjh96ps+nzarfgUL2+PjrB4No8exCN2EabJUThc23IaeIaieCA87w== Received: from MW4P223CA0017.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::22) by CH0PR12MB5043.namprd12.prod.outlook.com (2603:10b6:610:e2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16; Mon, 8 Nov 2021 11:11:14 +0000 Received: from CO1NAM11FT065.eop-nam11.prod.protection.outlook.com (2603:10b6:303:80:cafe::97) by MW4P223CA0017.outlook.office365.com (2603:10b6:303:80::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Mon, 8 Nov 2021 11:11:14 +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 CO1NAM11FT065.mail.protection.outlook.com (10.13.174.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Mon, 8 Nov 2021 11:11:13 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 8 Nov 2021 11:11:09 +0000 From: Rongwei Liu To: , , , , Wisam Jaddo CC: , Date: Mon, 8 Nov 2021 13:10:50 +0200 Message-ID: <20211108111051.1841401-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211108111051.1841401-1-rongweil@nvidia.com> References: <6177033.fEpqbVaury@thomas> <20211108111051.1841401-1-rongweil@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 87f05102-5376-49bb-db8e-08d9a2a87a43 X-MS-TrafficTypeDiagnostic: CH0PR12MB5043: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qpo6KN5mswuj4Qzb6FmA/iJaMf/sgWu3Ku0iRtUCgsQAmTtHF03o+jznx9Ekv7pnbKxsLZxMUTxo22hdqub0gBqfsmOdUomVACqDqq/BkSGJO4qjQmsEVCNYyNDK8OsXcfy5+MpVgRmZdNhMelx8tNs/aTS1uu/RW82G0md6zuxEJWe2NtR0BR1d8xsGwvWnq5uM0Bqdd6LlE5HDFaARdGdp48oBCiPw71+4sSAb9CasOUxawh1/lEch/wrlTJURjAVjqanRY4Ch7NVmzw0twismZh8AjM85znvcOPdj2vG97wV0BGMK6DHVW+8CN1EERtwpvQ4KGwkVJuPE4/iK8Lj86g98RNu1BG48Z+QHVtkprH4HciByEcyxekyX88pgoXmvi/xQxUheBbPIVe4gx0OTaW6aZ4sxFikXI/JdhN81x5klkqp1VMlQapLa8jb0shxOIrdmMqzIsBZgyc6X7z9VY3EIeu9on3+3joGZYxmu8a96INGHh8bJE6G+aueLS7rmiglHSvvhxxD6liorCzeUhLFMLRJtvTetMzTOx/R/0murHLqHsURHJ3Q8/zo5eQk6LmBsJmOjcCYIqAKRp05Vx1KBGo3UpeMt6E3JMNcI5g8n//UdSTetGImskdcgEVeWbJGtQ+7Ft4Q/YsNqTjuZi2kqy9OsmtYZ4lylsr+n+rReMTc6NELNwhmfbFBljl+exRrpuot2Hluarde1rQ== 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)(46966006)(36840700001)(55016002)(47076005)(4326008)(8936002)(6636002)(8676002)(70586007)(110136005)(54906003)(82310400003)(86362001)(70206006)(508600001)(36860700001)(316002)(107886003)(36906005)(7696005)(6286002)(6666004)(426003)(186003)(83380400001)(1076003)(26005)(2906002)(36756003)(7636003)(16526019)(336012)(356005)(5660300002)(2616005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2021 11:11:13.7989 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87f05102-5376-49bb-db8e-08d9a2a87a43 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: CO1NAM11FT065.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5043 Subject: [dpdk-dev] [PATCH v7 2/3] app/flow-perf: add meter-profile to support cir cbs and ebs 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 CIR/CBS/EBS all. 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 | 27 +++++++++++++++++++++++---- doc/guides/tools/flow-perf.rst | 3 +++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 4d5d2d7a8f..63675bfcb4 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 @@ -493,6 +494,8 @@ usage(char *progname) printf(" --mbuf-size=N: to set the size of mbuf\n"); printf(" --mbuf-cache-size=N: to set the size of mbuf cache\n"); printf(" --total-mbuf-count=N: to set the count of total mbuf count\n"); + printf(" --meter-profile=cir,cbs,ebs: set CIR CBS EBS parameters in meter" + " profile, default is %d,%d,%d\n", METER_CIR, METER_CIR / 8, 0); printf("To set flow attributes:\n"); printf(" --ingress: set ingress attribute in flows\n"); @@ -624,9 +627,10 @@ args_parse(int argc, char **argv) uint32_t prio; char *token; char *end; + char *arg; int n, opt; int opt_idx; - size_t i; + size_t i, j; static const struct option lgopts[] = { /* Control */ @@ -705,6 +709,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) @@ -922,6 +927,18 @@ args_parse(int argc, char **argv) RTE_MAX_LCORE); } } + if (strcmp(lgopts[opt_idx].name, + "meter-profile") == 0) { + arg = optarg; + j = 0; + token = strsep(&arg, ",\0"); + while (token != NULL && j < sizeof( + meter_profile_values) / + sizeof(uint64_t)) { + meter_profile_values[j++] = atol(token); + token = strsep(&arg, ",\0"); + } + } if (strcmp(lgopts[opt_idx].name, "policy-mtr") == 0) handle_meter_policy(argv[0], optarg); break; @@ -1251,9 +1268,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 9b131bad8c..4074b0a94d 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 parameter, default value is 1250000, 156250 and 0. + Attributes: * ``--ingress`` -- 2.27.0