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 BA365A0548; Thu, 11 Nov 2021 15:24:28 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7648741158; Thu, 11 Nov 2021 15:24:12 +0100 (CET) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2050.outbound.protection.outlook.com [40.107.96.50]) by mails.dpdk.org (Postfix) with ESMTP id 2D5D941152 for ; Thu, 11 Nov 2021 15:24:11 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CNxt8hiy5RM4mYmn3UBmEMSFluM6TWL701Tb/TMUktDiGdlTwuBSuE1LghKueq2nEfQ/v3m4r4s7FxkVqk9zmjAIwqz9iUnb+ozUz/wPmlcXZ6CEuqLXxKwhlNu5+iXQ0xK6ouIUFanII56Q8ArRnRiOVNkTZd6Z4Z/kcmiTw+5GOuNE9wqcEoJO+567L8aD+ZoRr5jYDtfyRg530CK2fNVKo6e3/SS9QPtmp5D8x9YUibTD/91Wdolr8S31JwMAdm95I5ymhf0xjtrptqM1zHoZ3HXlJjCNpHJ59Pi0Uc+a8GUxQXOONVrcHLN1Ap47bapwISeOZvXN+bcKaM8NZw== 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=xkRMO9tMiX//L16pHj16rkQWT4xcqFWWAdBIvy5oTT0=; b=kO4NJT6+9Zj363uYii8NnH8yWGZrbMWT4A1r5fn4uft/MurWpfiVU82vLnwmp0w/rJJ/jME70tAQHqrpc2ASss/Ud4TC1VdyQI5a5T/IarHW+fWxNFG1nSyTKbjpI9lJMPkVuue4/IOLz7miFJye9ye6S3B6o4g3al2HzbYXRPtjZJoKGewtFgfeQdkGyUrQVX3hks/EJxGisWVXHy50eYoNbUe0eeiJZLLDm2UNKBPhx3XpEyyBoKN3lYRYNwLcsPxtzZw5IQ0+9gzqckMWu6/ng2MEgXs30FZPLDHeP6Rajor4J2d8TwCipfQxGSMfUWhTH7LIE82eTKb7WXZHYg== 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=xkRMO9tMiX//L16pHj16rkQWT4xcqFWWAdBIvy5oTT0=; b=PxurHnTIFsFIuKfXVGOPkPFsWaufaQc6/20/WzlS6sFssamiVSX9BuMYDvldWOFmoOR2naV2tyJ2SGowuV2uysIH1ymvmU4tkksjWoc+WDXnEA2cwOm5jxaAaP/+/111bCWlbeZcocNyD0IMT7jtA3p9nUM/2gGo2NBtxDsfGJE1cwHaIGlg1pypAhlF/jMdHUUvmd0UJDpJK/5SCNujv/NFLLPsXz1BRm6Gh2oaIP0pIKz2lBUcPUAYQ3IejF8DxQSPLgpM5jjZm2S9n4lcVr7FImxGXV8HjSNMgCYgagsa7dgKhZGgVX9RfeknDvL092Gpvco0tP9JQ7+e8zKY5w== Received: from DM5PR05CA0015.namprd05.prod.outlook.com (2603:10b6:3:d4::25) by BY5PR12MB4856.namprd12.prod.outlook.com (2603:10b6:a03:1d5::10) 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:08 +0000 Received: from DM6NAM11FT064.eop-nam11.prod.protection.outlook.com (2603:10b6:3:d4:cafe::30) by DM5PR05CA0015.outlook.office365.com (2603:10b6:3:d4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Thu, 11 Nov 2021 14:24:08 +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:05 +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:24:02 +0000 From: Rongwei Liu To: , , , , Wisam Jaddo CC: , Subject: [PATCH v9 4/5] app/flow-perf: add packet metering mode Date: Thu, 11 Nov 2021 16:23:39 +0200 Message-ID: <20211111142340.2209292-5-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: 7e1bbc32-7da5-479e-24fb-08d9a51eeab3 X-MS-TrafficTypeDiagnostic: BY5PR12MB4856: 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: TrpTnELvAiqLk2bPG90BDe+f6jPnWsfyZ0T9O+3qQxKdQmZlykweFFW2MRwK4GZC805sV7tUMh02w5QL0cctwuK8gQTLkGSCqaI50mTCYESpPzrwz7bAugWBFiIckfMPthfqzdx7/4WlVd0LG0XUTL2kEBLK6RMQ2EXvrSMtQG3lEopfWrZvCZcwQs+sNihCyAY9jmOAoWV/ZuCsMXyBVTHWdfZW/+vPjZncxr+sK6CuYnxd36CFuW2e9bI17vhjBxHjezHUalkXWBE9WMxS6w6AZOv6UyobDW7NOJaaoLqLUwLX7BTGFnb6lx+keVf9ruHmINfJkl5HjSSLzQduCzx+utmBUphHiV7n9pk1kTXwWeIGWVVwITvsb234ynR0uJq31UkL/rwA5kINQK/dAH8ck/lDh3eN9VwxClzbOiFWZgE103xFvATRNvTHW3fsssGbkWWETE+DSTy2voFVfB2/YAVSPkkmabG02xmqmDhsTeR7ZsuHru874niIQQTgUMJG9rvEm/Diqb0z64ewbhaXN1qms6Q8GajO1V0IS9vL+u2kIxYUC3jPRSZ7lrBPXd232QHeZFZY+fThNsjV+4RyCX+ow550n8FyxqJO9IpzV1Yd+oFFWidPvU/tfciI9+pgWdNA4M+wCM6SQ/GSR5O3mibEOIQpG2Fib5KdpJ4uOexqP2CzvuH/jtgwyvJeB9O4+MMeX9dMIU0dNomcUw== 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)(7696005)(336012)(82310400003)(1076003)(356005)(6636002)(5660300002)(7636003)(54906003)(55016002)(8676002)(70586007)(70206006)(47076005)(8936002)(508600001)(110136005)(426003)(4326008)(36756003)(2616005)(26005)(186003)(6286002)(107886003)(16526019)(2906002)(316002)(6666004)(36860700001)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Nov 2021 14:24:05.3747 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e1bbc32-7da5-479e-24fb-08d9a51eeab3 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: BY5PR12MB4856 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 The flow perf application uses the srtcm_rfc2697 as meter profile while doing the meter testing. This patch adds new configuration parameter '--packet-mode' to generate the meter flows with packet cir instead of byte cir. Signed-off-by: Rongwei Liu --- app/test-flow-perf/main.c | 6 ++++++ doc/guides/tools/flow-perf.rst | 3 +++ 2 files changed, 9 insertions(+) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 01bfa20db7..2b612aa32c 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -68,6 +68,7 @@ static bool dump_socket_mem_flag; static bool enable_fwd; static bool unique_data; static bool policy_mtr; +static bool packet_mode; static uint8_t rx_queues_count; static uint8_t tx_queues_count; @@ -488,6 +489,7 @@ usage(char *progname) 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(" --packet-mode: to enable packet mode for meter profile\n"); printf("To set flow attributes:\n"); printf(" --ingress: set ingress attribute in flows\n"); @@ -712,6 +714,7 @@ args_parse(int argc, char **argv) { "vxlan-decap", 0, 0, 0 }, { "policy-mtr", 1, 0, 0 }, { "meter-profile", 1, 0, 0 }, + { "packet-mode", 0, 0, 0 }, }; RTE_ETH_FOREACH_DEV(i) @@ -942,6 +945,8 @@ args_parse(int argc, char **argv) token = strsep(&optarg, ",\0"); } } + if (strcmp(lgopts[opt_idx].name, "packet-mode") == 0) + packet_mode = true; break; default: usage(argv[0]); @@ -1272,6 +1277,7 @@ create_meter_profile(void) mp.srtcm_rfc2697.cbs = meter_profile_values[1] ? meter_profile_values[1] : METER_CIR / 8; mp.srtcm_rfc2697.ebs = meter_profile_values[2]; + mp.packet_mode = packet_mode; 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 24f0fefcd8..0176e9c5cb 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -137,6 +137,9 @@ The command line options are: * ``--meter-profile=N1,N2,N3`` Set the CIR, CBS and EBS parameters, default values are 1250000, 156250 and 0. +* ``--packet-mode`` + Enable packet mode for meter profile. + Attributes: * ``--ingress`` -- 2.27.0