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 C235DA0548; Thu, 11 Nov 2021 15:24:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B35740E03; Thu, 11 Nov 2021 15:24:07 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2043.outbound.protection.outlook.com [40.107.220.43]) by mails.dpdk.org (Postfix) with ESMTP id 82C9341169 for ; Thu, 11 Nov 2021 15:24:05 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f/VzofJ4nu3xfwr8Umzm+Zioxc3CwMm7r/vqiABJrzgnrMqcU99buGRPCK3MkrwVCyg2ysXL9OjnpI0n0RrwhdN21LAEb3XBuClILrkcKvRs5NNyX7lJ6xvOelZQ91IqHtdJ//FI8kRl0yLHQiNRjQIhDcM0Ew1aCGYVY6hFbME+4N1cI0kTVPslLqwlJt3QVhGBpB2yRcZzzqU/RR8R6syrJo5++82XROsWLRkebU+LeeHCp0WHgp61MVnJWWOJJ3vm3ZYQcHLgvkkn04RpOUVIwXclD4YuqW70CFUyU95Ow3449vktLUCF7YGSJAujXEnYwtdqLDx5nGA3eY9jxg== 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=5VKwNSfO7YyqDlpnJHnw/mFO4r1q/iPxFMcRaWyxt1c=; b=MaqrYi0OxaSiN9nIk4ZHeaq1NksBAUKoB/4/hZ1xg80sfxuEL3BYOfAyTR7KY5voB9LwiInUAF7LfcUWqyBKLZjiIovqXYydSQnNzk6V02E4QnCrdeHrFTF2pod306OMdzy9JB0FKWRDvQRMvbpUL9XNlo0RGXrYK1/vr0H3jdEGU+5AZcm65vFtysEIM60rWkePXKYV58vMfFJ6PXzoEQkQmCrwscqcIS/YBbdxE9xtQoCrVa86ZZwcCMi/793qMOiiIuEXYXz6Pi8zy+/blwHbFSP6J1wch7Oq/W3WgvvSzPycLNMTFzoGlefOLEYsUch0TGcRjcMNh6yb+zBOmw== 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=5VKwNSfO7YyqDlpnJHnw/mFO4r1q/iPxFMcRaWyxt1c=; b=tNN6Kd8u3SMCiY5gH4lB4RjQmrLqD3ZS5kkiVpDxI6n2pb+puOfkF+Cg7giEIcrit9u7j8rTa/HhraFqiwQN9AZaSD+uFMhCkdyc03k0PB55be6FSGUqHBU5VXt2bYE2UGcJ0NpyfwsWzPrmArIk1DvPXI4D6fW6ZtPo95svM9ify/Z0QoKCkEPcMDDluwmyR0TnFj8zpn8H7lk282VOsosbod/ije808QCIWjfHp3lwLVg/1fuGoTZYc3RzxNoICFHMJzd/0QPhYJGTKI0P2gRb0jeDcsj8NUxujOBvHtTvQCLNY0dI05lQ2zz2IWYlbvo3wQKphOZCwEF4AHbbqg== Received: from DM5PR05CA0017.namprd05.prod.outlook.com (2603:10b6:3:d4::27) by BY5PR12MB4211.namprd12.prod.outlook.com (2603:10b6:a03:20f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16; Thu, 11 Nov 2021 14:24:03 +0000 Received: from DM6NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:3:d4:cafe::7d) by DM5PR05CA0017.outlook.office365.com (2603:10b6:3:d4::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.7 via Frontend Transport; Thu, 11 Nov 2021 14:24:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;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 DM6NAM11FT064.mail.protection.outlook.com (10.13.172.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Thu, 11 Nov 2021 14:24:02 +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; Thu, 11 Nov 2021 14:23:59 +0000 From: Rongwei Liu To: , , , , Wisam Jaddo CC: , Subject: [PATCH v9 3/5] app/flow-perf: support dynamic values for meter profile Date: Thu, 11 Nov 2021 16:23:38 +0200 Message-ID: <20211111142340.2209292-4-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211111142340.2209292-1-rongweil@nvidia.com> References: <6177033.fEpqbVaury@thomas> <20211111142340.2209292-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: cceba6a7-e8ad-4d84-a0bb-08d9a51ee916 X-MS-TrafficTypeDiagnostic: BY5PR12MB4211: 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: x/7KY8LCVAVyb1+1N3MlXMG/CAwNnhhhx9nOkE1/2aTOqszlNp0QuHVSTfPntweX3oKWuNKuITZz4Qs7iG4CNvcZgNG89Lc0d0UWkJWOCPJzJGpnvpzGnuOL6bN9kUALUsoYvDstoUidEwBmUjSyhF+hCYwKMjuGrd7yutrD6BUY8q0B1S4OOsifnhOGLCspOpG2rgl9mdBuWy8BFRREA3VmiKQ7kEnqSM1GVLanHl1eF1bq+2PD1l5XR517G5oUn8v86CKJvmqqM8UBYXTLPm4ZxpV32iGzS/xpuCx+6+DcfmCcRtfCVTGdXqY0PAMG8WaN/aEb3lgVbBJHTimfLIoykmusQZgN+63nrGvzeeAvGuHvkk6NH5xB4CZmG08Qzyds5TC6I0rhZLOogAvu4JsdfL9RRfwAvEUJxGsZbFuOjxj0ip8zoGcZJArWDjVoLce8KBNCuZFb12PIp9K2wUi2bsAAbGpAa9UF15EOvup5KAf2Kwna2OT7AI7eWTFxALQe54ye6tjGcTgy4O6sZXSX4DNaZ09kANKiSdC6Z9bmmJzA+IENFHUgHFUkEAvpzTDjbFl6f+QARZDmRmb9bM1uJWsiz3jQezaL0kVdpjSi4WKp/OBHbqkyUkSa7B2zBuRRLU1l8bNSlUdY7rho6mOIvqzwArfePPwU2hGEu1+Ze4aCk9a5m22Drm9v2zJVEdkxZnWusYBDRAbhEykLaA== 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)(36906005)(26005)(82310400003)(70586007)(2616005)(316002)(6636002)(1076003)(70206006)(508600001)(6666004)(55016002)(186003)(8676002)(336012)(86362001)(426003)(83380400001)(16526019)(107886003)(2906002)(7696005)(4326008)(36860700001)(5660300002)(36756003)(7636003)(8936002)(47076005)(54906003)(110136005)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2021 14:24:02.6512 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cceba6a7-e8ad-4d84-a0bb-08d9a51ee916 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: DM6NAM11FT064.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4211 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 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 --- 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 e4083f053e..24f0fefcd8 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