From patchwork Thu Oct 28 03:25:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rongwei Liu X-Patchwork-Id: 103086 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8B44AA0C47; Thu, 28 Oct 2021 05:26:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D217041100; Thu, 28 Oct 2021 05:26:25 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2049.outbound.protection.outlook.com [40.107.102.49]) by mails.dpdk.org (Postfix) with ESMTP id E9B5A410FF for ; Thu, 28 Oct 2021 05:26:24 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ThbcbHf64dzVP9rgMe70OogMJWSg2AjsJ/HgWESfkbRt2V0WDdvinfV8P/6WGYcSjmO86hlbURtdWRbQEXQOUNGvDv6q/1QD/GuoJ4z9qV2T+kdYR8NBOKzhjaW5yEvlru0tMg656isxYsgUrtTLu5I3+p8jUfhBYoBMbi4KTFXCMl3JLDOXbNhCc0XKcuCc8O5/XRYVE379epGsUOxePDVZsmAOpJGPB4lzxx4OAfl2yGsKrGRYc/CGHh4m++vETBmeh47yr1YO/dLtPyXABOW0T3F3DrLDHOZwKPMOykl3mF+l7i8lBD/m0jpRTy9gfcXxIKw0qfHxM3oXOw5rQQ== 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=BOL9nv/qG5f7qyEHSY8zhhKubLXGw8sAboidoq5+uCY=; b=ke1QVULn3gSkGZimLyMbpewx7vcFByGMQg7VPsa3KDSq3nj3QhTE2FJUxW/06H+Lg93NOabC3NwVfxa5bJGm3ZPz1fYbL8PrNpX2DpPJNtZVOTNvR37mwrtFMOsjIkJgGjO4rBceErZkh1j2BE/nlocSDElHhFcAEjDXLTnL8NUyeh96hZAMbExX2z6fl53AxDV8eB1ENd7wxS+oCRBIBJH5nd851ADx+XoccKzpOfSPtVbqO/sGImGTM01MYDIwKE/vjkeqIu5OpkV3fHKqO9mfU6tJcmjtzrA7VywoAPBDW9AqCaiClx22zEdiri3KfvUVHM+135+ZGtiqW4w6xw== 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=BOL9nv/qG5f7qyEHSY8zhhKubLXGw8sAboidoq5+uCY=; b=ZKdDT5TB4jWiQY7oMX2oeW0cIFHpwB1JXkoOzTgWEwYi3IEQTSal/WhixLbFR43dAIk3RoOOO+ACnEPFmGmaO4kWaoEL8Bd/bIHyJrS4AIzvVu2aFCy5exKt44D1ZZvVS1KED6/Sx+TSBikWMDc8clvKf76zIpf3Cdt/xL4Q3suMhYQdNVnwG/17w66ozl8ncr8QG3BvSWoIPVrWBuJ7vCWBF1whK/M5OGTaWUVz2CWsoynbhZNF1xyMgwiHjvWIvaTtoy3q6zJul+j5QQMNMkitTvOYNFF7J6AADOHs+HO75J1nhJMD96DLyBYxOaJnsMfmVO2LZ90helQCPlwusQ== Received: from DM6PR03CA0049.namprd03.prod.outlook.com (2603:10b6:5:100::26) by BN8PR12MB3538.namprd12.prod.outlook.com (2603:10b6:408:96::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Thu, 28 Oct 2021 03:26:23 +0000 Received: from DM6NAM11FT060.eop-nam11.prod.protection.outlook.com (2603:10b6:5:100:cafe::e1) by DM6PR03CA0049.outlook.office365.com (2603:10b6:5:100::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15 via Frontend Transport; Thu, 28 Oct 2021 03:26:23 +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 DM6NAM11FT060.mail.protection.outlook.com (10.13.173.63) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4649.14 via Frontend Transport; Thu, 28 Oct 2021 03:26:22 +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; Thu, 28 Oct 2021 03:26:19 +0000 From: Rongwei Liu To: , , , , Wisam Jaddo CC: , Date: Thu, 28 Oct 2021 06:25:59 +0300 Message-ID: <20211028032600.638212-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211028032600.638212-1-rongweil@nvidia.com> References: <20211028032600.638212-1-rongweil@nvidia.com> MIME-Version: 1.0 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: ac691b62-6b73-4621-8ef2-08d999c2b72d X-MS-TrafficTypeDiagnostic: BN8PR12MB3538: 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: M/cHrgApEFHwmykWrEYEIf6kplTB5laZ9+bBmWp8hnvWpECwYfY1Ph8X/p74NDF0J5B0xUbTZiO/fuEwpkgZ98eF4ZD33a9Oh7EaKdkNIltzpCC0jReOjxx20Mao+3vtrfwluGD+4+cUFio8d29uDsUJ9X9T+nPLEjU5hy+cHj8c8vwoRQk+xSRoAu1IOkIGjhuZccMeeejzrpoi24xFPiE1fwFXVUCkv9bY9eH7i0Od4zm+iurJZBlT4MPIYdQsEiZF9S0tGEwxuccTl0r5ieROpQ9W554BbGvGgPhjUgN+qJhGEjBs75FtxsKfmce1HZQhiF+gNz8+k+kgLyxzbO1uC7+SetNy1wBPEg1dRGm8svWLLAUJktu1JSS2QuHc3P/Y69RYGusr9Dc5uoZPmZVRli8Qr+fXRrs87DB3NOzKHcOtvZFL0j/eeAfWjsxhcFE3NPFllaNVsqkhyT2k6A0hhrBY7sFo2QVW/AhkgL9vYE9bR8ggzUVspRUgqJcToCnFj/e5Pqyu6PAPjW2UwCQOeTciBBtMBLYV4fw3v7oCKEPy95zPDn3bg2mVaqzdABMd9kQTk3i7pvL/dZvIQpN3/KonCv5Nd1OqjOYW2GtaRrdgX5O9caMNBAbElenJgiRNo9id7qeLAem5snuAuwoTq1Z5EgEW4wzbZAN3R0gzC72g3+LJD/wJjNS7nCXN1EOPg1m4KxFgg0F+GQoo1g== 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)(83380400001)(82310400003)(36756003)(186003)(7636003)(6666004)(16526019)(1076003)(26005)(36860700001)(7696005)(2906002)(6636002)(2616005)(4326008)(508600001)(110136005)(8676002)(316002)(47076005)(70586007)(70206006)(6286002)(336012)(86362001)(426003)(356005)(8936002)(54906003)(5660300002)(55016002)(107886003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2021 03:26:22.4537 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac691b62-6b73-4621-8ef2-08d999c2b72d 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: DM6NAM11FT060.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3538 Subject: [dpdk-dev] [PATCH v3 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 | 25 ++++++++++++++++++++++--- doc/guides/tools/flow-perf.rst | 3 ++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 40e15d5f9a..8b8fc0fea3 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -82,6 +82,7 @@ static uint32_t rules_count; static uint32_t rules_batch; static uint32_t hairpin_queues_num; /* total hairpin q number - default: 0 */ static uint32_t nb_lcores; +static uint64_t meter_profile_values[3]; /* CIR CBS EBS values. */ #define MAX_PKT_BURST 32 #define LCORE_MODE_PKT 1 @@ -149,6 +150,9 @@ usage(char *progname) " actions that support data, such as header modify and encap actions\n"); printf(" --policy-mtr=\"g1,g2:y1:r1\": To create meter with specified " "color actions\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"); printf(" --egress: set egress attribute in flows\n"); @@ -660,6 +664,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) @@ -862,6 +867,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) { j = 0; k = 0; @@ -1221,9 +1238,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 bf70682379..a38dda2fb7 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -130,7 +130,8 @@ The command line options are: * ``--total-mbuf-count=N`` Set the count of total mbuf number, default count is 32000. -Attributes: +* ``--meter-profile=N1,N2,N3`` + Set the CIR, CBS and EBS parameter, default value is 1250000, 156250 and 0. * ``--ingress`` Set Ingress attribute to all flows attributes.