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 BB63AA0C4B; Mon, 8 Nov 2021 10:58:50 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DDD374111C; Mon, 8 Nov 2021 10:58:41 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2046.outbound.protection.outlook.com [40.107.237.46]) by mails.dpdk.org (Postfix) with ESMTP id B6980410E9 for ; Mon, 8 Nov 2021 10:58:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UEdStleqZN5Evitxtex8CVHDmAQ9eHPaQxPb9ck9OIb9mpQQ+pUbjQnkjg+br1qSlvZbV8fPo3uS+DjYH3nUwZDNGGYWMqM8tzDwt7Uo0HZckyx1PFI1MJ0YPR6T3uFMVDyG8s60rU3FgMTGRhjsKfj3ihZnXSk0nY3gL938hzB1oisnSzCmE0NTyJcgy18ao5/OvPPuWPR4sqix6q3BMrSLlvLV+66YCB4PZH9aFFNwpaN4t/8choQiSgXI4O6230F+gkSn2kJYAdMCkyL7g8NcByEfyTQ19DoiR8TR13DeJ09NZO1j+8nZN8O/Z4YebRSs/RUeFeK+H79PTq8UQA== 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=OQx8COr6SrIjLnGzZ1g9a+klq71CrfTHedBYGLsMhsk=; b=Mw9F4S/XXBUuKOdsfuYxKDML76kjcDDqd+U84zTKdojRI4kI0oK2SF/V4fzNfU3cyoRz72U68bVgMbic6paln6K+tXUdKsZpyv7uyhQ7cT7sa2BYHnZTmGbn4VcSWj3Lajit2Efbr/FQRsJlyo2h1NFea0Lw9ToOnCmyyUAaNAIV/VWVh0rzUEvKZGUEfUNxa+4f8ZMYdtKjfX050HAVZf6OqrPjamwugX4B6pWEhnyQqra3/eCqQWaijaB95N6+4tQ5FaPTuOQyYhomSsZ4lYx390Fsr+cPI2P5bmEfqT0q6BNf1s9qjqf7mzKE8k8ALXXO5sT0hFTgiUPSRuK2hA== 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=OQx8COr6SrIjLnGzZ1g9a+klq71CrfTHedBYGLsMhsk=; b=dHl19I9wQ4+bjSKC6eOUTveS2tzJMUOgOrnBTLKLgbAuhrGSDeq44RpiTgOBv1hXaWQKvn29Zs403wXipfW0Kd2PLS/RJDt+n81ZNBjgUnYtp2dc22GhGqps1PpBZ3PFV+zNIfdIT9FYhURf1z2rxDO3OXUhYvHB/iT+wFZKYJiOitGxq2wC8KR6oWXgVFvrPKdWLipcuQo5jDBNOci1mpwOiTEyqUnTuNW3rB1jrgHuUUR6jsGWMqYZp+4TR94A7Rt/Y8vIYGvYOm5waE+rn/vl2wThF4sb46KEKzywLZlibTXneburlE9BFbHZLZPC37tjyb6vZyUQdm6dNumdBA== Received: from DM6PR04CA0011.namprd04.prod.outlook.com (2603:10b6:5:334::16) by CH0PR12MB5089.namprd12.prod.outlook.com (2603:10b6:610:bc::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Mon, 8 Nov 2021 09:58:38 +0000 Received: from DM6NAM11FT027.eop-nam11.prod.protection.outlook.com (2603:10b6:5:334:cafe::b6) by DM6PR04CA0011.outlook.office365.com (2603:10b6:5:334::16) 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 09:58:38 +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 DM6NAM11FT027.mail.protection.outlook.com (10.13.172.205) 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 09:58:38 +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 09:58:35 +0000 From: Rongwei Liu To: , , , , Wisam Jaddo CC: , Date: Mon, 8 Nov 2021 11:58:18 +0200 Message-ID: <20211108095819.1783710-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211108095819.1783710-1-rongweil@nvidia.com> References: <6177033.fEpqbVaury@thomas> <20211108095819.1783710-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: 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: 6910e7d9-41b1-4ba0-2b53-08d9a29e562d X-MS-TrafficTypeDiagnostic: CH0PR12MB5089: 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: rJCOd8mxA1WGGDVgoesgERZBwxkhuuNqaEjS84DrYwqFK64PBssxPRKPkaqkB05I5DwUVw26F7bFNec2jygpKbbBhMVKJ7kyrALeM2MaAIOK5b7L2wgVhOevv8X3JxLE7FbYHvs1BDn1QOC+g9lDFfi09CUY7UsGZTg/F1X+paH82v84ke0Uigx0LaThOemc0q8jvq7gAf9tLeYPgXWz4ymn5aeFU1WhJL4d+JqwAgYQIAjvTeNYJ12ENCldN5p9xlxUh3BSUG60qafYEP+RrPWhnvttaE8mgPagNwiPd3Bt8j1H6QkEtvWPxmM/krmzcjPtId9IV6LuvLLEXn30S32PMGBd+WXnA2Rn+JjG2U6PCT3TaLT9viWhTeF4sfShndDqsSlyVZxTaQCtNfgT1pnK6s3OsV+iWfcfnArlhiKndDQ+j65w+KFeR236XitHAe5kb5MCaInlILy2o+MexNS0iAgEYpRidQXyiGr64g8S+Bb1aXrRGluDayxMaQyiZxHSNx7jWZ9CyK/s1ITVTPbz6KRonslg5QjCw48wBmzYkQU1oKm0S0cDObQuykQP4ozGvBBlKDeqyMqZVskCNs/X3jUM7OXNIeeltORAZQL/1kAetIgwrTrl2Ofnyz3921ZGknA6m2/IbeZLtJJyDU5BODNsnWafKpxEGp0s9l0FqHkqlub0Atrdbpq9afJ1j0iezUO+nucg0tAMLnWtPQ== 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)(8936002)(82310400003)(36860700001)(36756003)(4326008)(7696005)(110136005)(1076003)(316002)(54906003)(6286002)(2906002)(426003)(508600001)(70586007)(5660300002)(86362001)(70206006)(336012)(107886003)(2616005)(26005)(356005)(6666004)(6636002)(55016002)(8676002)(16526019)(186003)(7636003)(83380400001)(47076005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2021 09:58:38.2849 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6910e7d9-41b1-4ba0-2b53-08d9a29e562d 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: DM6NAM11FT027.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5089 Subject: [dpdk-dev] [PATCH v6 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 | 28 ++++++++++++++++++++++++---- doc/guides/tools/flow-perf.rst | 3 ++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index a960e5b245..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"); @@ -618,9 +622,10 @@ args_parse(int argc, char **argv) char **argvopt; 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 */ @@ -698,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) @@ -914,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; @@ -1235,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