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 0167CA0C4B; Mon, 8 Nov 2021 09:54:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DD866410FE; Mon, 8 Nov 2021 09:54:14 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2050.outbound.protection.outlook.com [40.107.100.50]) by mails.dpdk.org (Postfix) with ESMTP id C6DBD40DF7 for ; Mon, 8 Nov 2021 09:54:13 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y4iCv1qGIMg9HnbrQhsSoSZ/eqFgvj1i0HZQA1pI/VvcIdN1mRaxzJFCDFABimu9x+CjljjYFbyXMAKFcHYf4OFJmY79+E1sEJ3vTd9gH088Ncc+P0qOH4qey4JmrcxIrmqeDTFUnt9Z1GRpi+PIuC22FqzWmwCaVd3eaikPk0Flfzv/DGUU8GAiEolGTTCed01OXrFU3CfGy/Rxzvrwt//Xx9w5pgRCk3IvhqNqaYSfhOv1xqplaKyg5x3g8BXps7sJJjRPiDc6Z1hZaWVuhWyLumO1ATpfebb/WeVRqVOLSQOYvYMapE5LzWtrscX/GZBtJ25uPFL4F9uzommRLw== 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=oRGxk6D5noBYbIOPLRPFQD19CPKgzSkuJRkNeXvg4pg=; b=Wo2lZ4/uDbe/AGni9mp5vmDEuWdYOm2//nkfhL79h9jtGGwHJRovVFrqe6R/OheuDUD4W0FYQZIN98ZdcuytsMQX8j0HlSy1myeGg1nYqPoO7bZd8xFFZ+E1qrcFn08xYfe/dpSqrY5ZqPE1/gbuf18hsaB/h4iLKTeD4l1RfC8y7VLp98ZGCbhW/RXHSYybUFG6EUFgUZNCCbFtkochs753+Pi4OwPR2FcOE7RDyU1xgQWyl2jLamozhnUPJu5pqDOJpPk68JhWnw+3XherxQvXpIr6+6s52m4Q5ztfBLNDZIADAX7DFo7eLXKkVXzhLanwkBUf2MTKLCnaDWACpg== 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=oRGxk6D5noBYbIOPLRPFQD19CPKgzSkuJRkNeXvg4pg=; b=liIGuzyZklaMI9t0aHFgxBA180W2j2W/X1w5FD6uaR13Wp81d9dG1ZT8elCEqSDLAftb0V8EwzHVZAu3fh3nX06M537WbqHv56Pkt2oAE8Yp/gIjXCZOxPHgIRNmY4vgNQ6td+dgN5mxVwoNsba9jH//Re3Y4Eh1pa8MmXA3m7rheiQta26JDBvDGSXUo5iXkQbPwiaUwrNxfc5coHJCk2jH6qNyENs0hfNkmLUfG3Q7qxOV4DTLEOaLkyaJQkvg4kV1k/MAJ/zy9PqPukMnFyG8JS9IFYEah4osLJ1w1G/rISVDVl/TNUpycVaSZLwRzzBla7qMprzWXuza0UuW4w== Received: from MW2PR16CA0018.namprd16.prod.outlook.com (2603:10b6:907::31) by CH0PR12MB5315.namprd12.prod.outlook.com (2603:10b6:610:d6::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Mon, 8 Nov 2021 08:54:12 +0000 Received: from CO1NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:907:0:cafe::f) by MW2PR16CA0018.outlook.office365.com (2603:10b6:907::31) 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 08:54:12 +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 CO1NAM11FT051.mail.protection.outlook.com (10.13.174.114) 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 08:54:11 +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; Mon, 8 Nov 2021 08:54:09 +0000 From: Rongwei Liu To: , , , , Wisam Jaddo CC: , Date: Mon, 8 Nov 2021 10:53:51 +0200 Message-ID: <20211108085352.1728466-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211108085352.1728466-1-rongweil@nvidia.com> References: <6106963.jHQkdsGB6Q@thomas> <20211108085352.1728466-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: 41625a3c-92a7-479f-c266-08d9a2955589 X-MS-TrafficTypeDiagnostic: CH0PR12MB5315: 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: lVjIXceJ5E6dQPjQ51RHxwKJmBIR/NAFrP5lpkGt/R+iG2AviygJxErJbbKVIDsKcuP5+N177ooNJFJiNeBIyyU70QwD29gFx/ZSTPmHayUajrNTYpznI3YHrgnfuPBeABx933AyR1MpZaZrK2RGxse2taiecSwCYg5vnaIGHeAZnXVBr1GHtTJd8fk8W65Vmfh8iVz61zVEL8dZTDquIkWySd0t1wpWoiYaCxP6WpPsQICG7fMxPiUfgS6p2WMPmUXgMx9JGefhRpiGIGtpPClqd11/FTqzoiyV0Xyo1zID2MzMTnCSlh9NTba6NNcxxFj5ga5OuWSpECywhej2Kgvct4kAk0/poxUxuyJQ7nJ9atKEEWwbWoudtwdZr65C60DbDFuPTJokghWnbZzBs5/sWBw3se6mpSx4FDyBvrl0ZYOcUE/gefx9hhC7e3Z00e5yhYg8eG8E7wzxyz1u6jXIpzm7qEuyDHs1IxtfZmIJGKSOMuCT9j4ml4VKJ3/aJpoWZAW/vYPyPvHalxhR66MF41VlYq2q/WtzoBCIIWcVCFCmKf1r0wh21Xe/ifdTfexbofxwbw/w3QHYq7sH5ZiTIYZ3eH4+UE1LxeId1s1ShRDu3e3jVD3FqjQIkEe54eIBG5OVn5PQQHeiB7dy7U4kFd1IqEyEiSO8py+QnkstBliak/j4DF1UI9VEn7yt6enEFKspJnGvVGHCKJPvTw== 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)(356005)(6666004)(26005)(55016002)(36906005)(508600001)(107886003)(54906003)(82310400003)(6286002)(4326008)(7636003)(16526019)(47076005)(336012)(6636002)(2906002)(110136005)(186003)(86362001)(1076003)(8936002)(5660300002)(70206006)(7696005)(36860700001)(36756003)(426003)(83380400001)(8676002)(2616005)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2021 08:54:11.7404 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41625a3c-92a7-479f-c266-08d9a2955589 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: CO1NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5315 Subject: [dpdk-dev] [PATCH v4 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, 25 insertions(+), 5 deletions(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 966ca9fc63..23ee5d2431 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -83,6 +83,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 @@ -481,6 +482,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"); @@ -621,7 +625,7 @@ args_parse(int argc, char **argv) char *arg; int n, opt; int opt_idx; - size_t i; + size_t i, j; static const struct option lgopts[] = { /* Control */ @@ -699,6 +703,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) @@ -915,6 +920,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; @@ -1236,9 +1253,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 a23b94bb55..641600aaf9 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. -- 2.27.0