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 32CCEA034F; Wed, 10 Nov 2021 13:58:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4297B41155; Wed, 10 Nov 2021 13:57:54 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2068.outbound.protection.outlook.com [40.107.93.68]) by mails.dpdk.org (Postfix) with ESMTP id C61974113F for ; Wed, 10 Nov 2021 13:57:50 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z9fX5S94zpIGLRPE8EZJ2i8fhtsF6HzTebD+Ffp28unMONKpQ1zWN8AbBh1xjf/oXZKsyUaA877YEEy15pdzVCbCxyz6JutBkKuHh6MSoCDM6XGU2yqvk0tQYehokRzKkPP3OQc8fopO5s/6+pRQns60Fs/XMDdP2oeoVwn4/GSJtV6WnSIAi+Hv3e13x71OkjH33VMRdLM0vvkyH8r94FKK71iWAS+9j5MSP9WBVRyrpnsPQHlL+xghh51ooP6e9EorpycUT2x3hCyvpbEfT6jKbqPrwfAu1jkQA47JpwZABGT0oz+CYvjNTx/kZ2iGghM/25t8hM7KaTscSlrs1A== 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=HRbVqGpJ7oClLx5CxjjhQP3FInxHfTFU+2P8v5IeiU8=; b=fQ5SKE5HOD8HAHdBAHDrWlpds3XSiaj0pBrd40N/MmRzND1pjMZVUCqhIFDzdCh6ZkU8iv1cG980Vhqn++Juu7jdN/3cv1eLFkFwOVnKd6tcJUv4Vh9TcfBO8201ofSs8nBCwZeq2HsCUr4EH/oZ8gPMrX+VZAKQz15OxmIlEw3WBTAOV0gh/S39biAeDFC+CrP9oNX849mD5dr94GbboLt0g5ecwxT+KGutcEK0fZuIol4+St6IbiCiO4uwhEi7kxiVhmIxI9Pwtd/QmhMh3E7205J0YlPiqpnJtT0ZiMkZHVuMuhv2eaVFwp1J7j3hafrJf9uHcpBeBUgtH402dQ== 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=HRbVqGpJ7oClLx5CxjjhQP3FInxHfTFU+2P8v5IeiU8=; b=TYZlc3S9LGGpXGIzdhxaIeVOXSLNy0popzf/uKL5WOCWiO/6qqMYNQqHLzO7Iav8XbdF05+kbf6q0F88pCrdbrXwDexL8RgOSpp3TdrLBa0H9Mibue+oFTGwoEL/gcpS3v84N4z9WftcsAw+P8WyBp1F46A8NUHgarN+7N9E+/YtSrwtznXTnF6RlcCkT3aVJkNO/Im0klRmj+4JW3DJIHSUdT/faaBbO9PX7mA2T6Z+OwXOBAN2OvnLgCc7W+7E326LmefwDRsvszxvCVxbe0hFNBSqmsBO3AcXCctIKrfrxyum31DI8QhuhzCsg4slASs5Cvn3o2Ves5FIJzPlAA== Received: from CO2PR04CA0194.namprd04.prod.outlook.com (2603:10b6:104:5::24) by SJ0PR12MB5440.namprd12.prod.outlook.com (2603:10b6:a03:3ac::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.15; Wed, 10 Nov 2021 12:57:49 +0000 Received: from CO1NAM11FT008.eop-nam11.prod.protection.outlook.com (2603:10b6:104:5:cafe::d1) by CO2PR04CA0194.outlook.office365.com (2603:10b6:104:5::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11 via Frontend Transport; Wed, 10 Nov 2021 12:57:49 +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 CO1NAM11FT008.mail.protection.outlook.com (10.13.175.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 12:57:48 +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; Wed, 10 Nov 2021 12:57:45 +0000 From: Rongwei Liu To: , , , , Wisam Jaddo CC: , Date: Wed, 10 Nov 2021 14:57:25 +0200 Message-ID: <20211110125725.2076706-4-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211110125725.2076706-1-rongweil@nvidia.com> References: <6177033.fEpqbVaury@thomas> <20211110125725.2076706-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: 978e6b5f-adc9-4c0b-4485-08d9a449b2ab X-MS-TrafficTypeDiagnostic: SJ0PR12MB5440: 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: 0tIvqZjT0aW7aMF74uxezy8B3dlFSd/I7IZGVZ1ZWqB9u1YcZenID4JbBrBe+nju4pG0ZmZHt6XRB3Y40K62WTcULvtix5lAScZYzqEmPHoTY6NQHwZn6CVnHyHnkLZ5v1POFFwekIP5zlrw4bg5mIojShqTmB2aGJrlf+WxUYVcNUXOXDQpKt98aCbNaSYFaks28vOJE3CL3Mz3+OBjLKNgxAvzmB0bQ6qD866a4sYlc/i7oOHXE3E5pO/aS9lz6acTtZ+YFswVYVm5GwPd2LGkSZ+tJCYLnORumLolzLPBvRUuccNGonCEUtc+T0Rtt9icur0ZEwUhu8Gnks6ZSlT+OoddkyOcGYTEc1+HBcJIsViqfgET86un/94g0m1l0VHtQXXL1ijaCgGso4HVbPcXcmW1m87Mx97qpWRHCFTfR1IiywWVMsKcaoUkPI2EMn5v2kX76C8jICfzRBfcKQRBcHtp4/cjMjLkLLZAuvf7LDDdzO+pfSzCoYRsSOsi9v2iOYAfF/kRtaazRcMfU+2eXZRKjr4x7v+ZrJ8yVTyj4MdvDI2NS2a7SScI6PACwTajJUN9kX0SWEYN9u1WpsHmmIGrMRA3bLwLLrfWfvtxWRGqoU8obn5iGtPmTJYm6B9Al3lOJsrGVMQbYuQfUyRfhTH6e9u/DVdCDkolxR++lG8fDJWdSZEwozt9OjUk5tfQRbERUKyQNjBT+FyEow== 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)(26005)(2616005)(6286002)(55016002)(5660300002)(8936002)(36860700001)(47076005)(36756003)(16526019)(70206006)(186003)(7696005)(1076003)(426003)(107886003)(356005)(7636003)(82310400003)(8676002)(70586007)(6666004)(86362001)(2906002)(4326008)(508600001)(54906003)(110136005)(316002)(336012)(6636002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 12:57:48.5722 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 978e6b5f-adc9-4c0b-4485-08d9a449b2ab 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: CO1NAM11FT008.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5440 Subject: [dpdk-dev] [PATCH v8 3/3] app/flow-perf: add packet metering mode 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" 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 Acked-by: Wisam Monther --- 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 3f1e5986e3..41eae15470 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