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 5F37DA0C4B; Mon, 8 Nov 2021 10:23:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AA02410F4; Mon, 8 Nov 2021 10:23:42 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2085.outbound.protection.outlook.com [40.107.95.85]) by mails.dpdk.org (Postfix) with ESMTP id 08BB6410E9 for ; Mon, 8 Nov 2021 10:23:40 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=F7UUQ8c+Na1J7uAhNP/TGO0h1g2CkqJrPFLOhnhFrD9Eq4PTGbfpY5jHCcN+TtNgnuosWO/GrnR9mzKDAahz0aQZgyi1RHmIluWmdCRdjsuUO6N+pfVX199L6mjMvgpOG9i1njZM4Ki4d8zPVP7/0QJg14PkC/mo0s09bF8yWBUJ4JpzjiQ9UTmRyDtN/prbNCFsyzScgTvjUVz8ZJw4LIsuJ/UFyv/lnj75EgGECSmfen/ga7schb1pUb9nrxX6jSoruOFxAcRhLPQn8u0ErdkOYoQUR9qjXtem6wSRrbDat5Z696G4sGdKvtuozi9iexw0d5adSUREkrlXyKGUUg== 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=GAG0aeoLVctC7bjRHs3ZcuTdXXRfwkC/XMhuKjC4z/r79ZcFTvOr8TIaLR5fpcRp/YhAJ/7uZ2ODw8UCmLYov5AVJWIhkGr//Zln8evwv4N1/YKLMZJd9ZNIpy7wE9oCFS7p6u5JeQmqJgduCrZD9gnXN3o+IHv65L4y0doIsrNExQpx84GRSlMjxClJTWJ3CYGIEK9CnqnPVI7j4jKrnAjfpdmrq2RFkHjVTzjKZezHgbbul0Ra+OgGY3KCb6T8E10ZA8vGbMXJtLk7YOwYoexdGk05R3wf9zXNstPKAalwu33xEGKZl7SaF+Ye8C1JfyvfIVsqiP9qCdwsN73V7Q== 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=oZ2/4+MTHOrJEZPzWTBuf/dDCkYha7cz3amlGlOvm52N5Ham/4+P+V1tmjcJnmHMrbyDJmXmcS5d2zNHxmsJRD8Dl+l1pxolkpLwXaBbfF/1rqPqf1dk33XTMcAi/tHRKWBeVIS98jQR/PUosXysFtLLXdkGgGjfnukgbNlVADVqXnK9wkinhTsfTzqfAU0AM4X6Ssbhf2fYBCYF5rky4gQVxUdBbkw3oBQ6nCzwWfesSq4nZpvtfO34vO0zE5CGTePfO+TwVH6krPkh0Fmo4bq9NbKtuSCyEyn1Y1U+NgI+sGB2tQhA2dQD3zoXDZTbgeZOCSQSKzr6b7U65EyLdA== Received: from BN9PR03CA0532.namprd03.prod.outlook.com (2603:10b6:408:131::27) by BL0PR12MB4740.namprd12.prod.outlook.com (2603:10b6:208:84::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.15; Mon, 8 Nov 2021 09:23:38 +0000 Received: from BN8NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:408:131:cafe::19) by BN9PR03CA0532.outlook.office365.com (2603:10b6:408:131::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13 via Frontend Transport; Mon, 8 Nov 2021 09:23: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 BN8NAM11FT029.mail.protection.outlook.com (10.13.177.68) 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:23: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:23:35 +0000 From: Rongwei Liu To: , , , , Wisam Jaddo CC: , Date: Mon, 8 Nov 2021 11:23:18 +0200 Message-ID: <20211108092319.1780719-3-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211108092319.1780719-1-rongweil@nvidia.com> References: <6177033.fEpqbVaury@thomas> <20211108092319.1780719-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: 240e6d0d-cd8f-4232-c2b5-08d9a2997272 X-MS-TrafficTypeDiagnostic: BL0PR12MB4740: 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: fjGz2SfyQJ3E1I4zSJLWreHBHXAld1CIDHXWobLxxXRGOI9lkvkK7/GEcKs5/JD6JKgnDlyjt4UE5BoNnv+9RRnucZrc6B/53jecEyPN7srqIJZuvV02WpW7rdgLjgJsxuQbTnFHqxwgwXomk8QXGv/OV6kFTJxEVQivVZ0HvTWD0AQ5QdDsGYiKdiXl6Eb3XNAC3Qvpg9aaG/DSb38eSSwatgpvQZmL9RE7r+W4SgQ9QRF9MQoLfadg+aNe/m0rr/Cg6h7Im5XjTAeJjoxwaKYjAvWW6olL59xx9FMQ4BmTIP/AgQ9lT3X3gX9hYeE4mFJ4wvLyf95f3PXlVh3srTErcO8pA3/PgHWFlBhEl5YkoQVgyDQ3CXNKtQtu9AVNiCZU4esAtBYeghSiWyZ4x3Xq6Q9bIAw2R61b7jV5fCdWntYJNMHaVzyb8NVVgmkbxx0NJiKbJITVGveqCaLyba6w6K53gDk2fFPTBXSz+xWwJM07IyblEGnEyD5QIGhnKEqzpBMQqKUaXxbHQsxE1C8VGRreAA6R/wIzfmEqeMOhq6eMfmB3TmnWwNOF3wqHuCl0oLJCEjwncHkyQDJBWEVpGzmVDGXn61fRpYdNQbuoPWYFFZp+uW7kpce/uTa1hg4/upVuv6bf1ICO65YUsXn9A7EjJ1fKlt3R2UrOSk47gWxx9j3DeYGu7E4b1sT0tsWnAsVm6UvbnZFMdVa36w== 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)(356005)(1076003)(70586007)(26005)(54906003)(16526019)(36860700001)(426003)(508600001)(110136005)(47076005)(316002)(5660300002)(336012)(70206006)(7636003)(83380400001)(55016002)(6666004)(2616005)(186003)(36756003)(2906002)(6636002)(8936002)(6286002)(82310400003)(8676002)(107886003)(4326008)(86362001)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2021 09:23:38.1696 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 240e6d0d-cd8f-4232-c2b5-08d9a2997272 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: BN8NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4740 Subject: [dpdk-dev] [PATCH v5 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