From patchwork Thu Jun 4 13:34:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wisam Jaddo X-Patchwork-Id: 70852 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9B400A00C4; Thu, 4 Jun 2020 15:35:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 287A31D5ED; Thu, 4 Jun 2020 15:35:26 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2057.outbound.protection.outlook.com [40.107.20.57]) by dpdk.org (Postfix) with ESMTP id C62D41D5D5 for ; Thu, 4 Jun 2020 15:35:23 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ei8YyRoa1PG+ULNvRZtTd5nA6GBvQD6OY8Pow6QveoIOn+LD4QjJtxLqOLASamjQyeHhXvh7GMwnzpxtXuR2c5yqFX1zGTaGcNAWWCdkRdPDh6GzBkgRgho7daBLJXtiAQlnMYEpmDMlsWUBStLBZ2yyOkyztGrDt/tK5k0ywtZ5JniIBr1gJsoTF2XV7dW/ifaP+MGa3CG/67pMaCNpFkHSEG8Coh9TBm2cdeOkLUQgMPOVw8rMWoiOoSjO0ygMrakLmGfftyk2L4OZHX/4tR97wmiCFA+adiQweQnd/UqZGddh+nOhsZf82NrSHBO2hTZ1ferpLuvV2776a6GlzQ== 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-SenderADCheck; bh=bz3ZIvksaMr8LgZkv5HAAbuqCOPB/pe+4bJ/ZM11PDE=; b=XrDaVFJ31/mMFSF7OAHTRWUw9leOBN8kUX1yROgVkd4ON7qUry5OzEegwURI6MlcwriQT3jTkXE57O6x8hYk60qzVMp3lDIPWSdyKCcv+yKap0UPDEtZ0lCIb9TRXTpnv6AdkuhAcRfH2XMem6G2xpiSMwlu1cPK+05Hb6pXTsXSCP1n/ZMgX1y29ichtgECU4CtSe7IlrnBo1AJO/6KDjym8cpaAddc978t153zx3ZU5jPg6nEFosY63U8z99SuoBNACxwMaI5IB7M+EIvQiOeTGj71IPazn9m2SUAbR+wD8TpapK21JHAG4vlE/tQVTukTGmwAy9Iq3kXRZbpsQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bz3ZIvksaMr8LgZkv5HAAbuqCOPB/pe+4bJ/ZM11PDE=; b=LPh4oZSfyus5mwPcl5cZtirlH+TH0se5ZyqYTLdgh71pgo6DygBV0VWkIxNFpmCZx1waK/mnh3rfZXjFgdnMEyU5wT4huc2f3FOwFmNe5+aUANuIwiwJsAVbtIvrlFr8YDtsC5syr0CVrDJeAq0nZq4EoPHd2TLjK3LOHTM+cSU= Authentication-Results: solarflare.com; dkim=none (message not signed) header.d=none;solarflare.com; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR05MB4577.eurprd05.prod.outlook.com (2603:10a6:208:b7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.25; Thu, 4 Jun 2020 13:35:22 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc%6]) with mapi id 15.20.3045.024; Thu, 4 Jun 2020 13:35:22 +0000 From: Wisam Jaddo To: arybchenko@solarflare.com, jackmin@mellanox.com, thomas@monjalon.net, jerinjacobk@gmail.com, ajit.khaparde@broadcom.com Cc: dev@dpdk.org Date: Thu, 4 Jun 2020 13:34:58 +0000 Message-Id: <20200604133502.28491-2-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200604133502.28491-1-wisamm@mellanox.com> References: <20200511110811.11474-2-wisamm@mellanox.com> <20200604133502.28491-1-wisamm@mellanox.com> X-ClientProxiedBy: AM0PR01CA0117.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::22) To AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM0PR01CA0117.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Thu, 4 Jun 2020 13:35:21 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fa8fbcb0-7a0f-42c7-b331-08d8088c215f X-MS-TrafficTypeDiagnostic: AM0PR05MB4577: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:270; X-Forefront-PRVS: 04244E0DC5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MOwfUty/PDwJe+viXC04GpQ/GeCI6r2qHcsE4m9rzIK0gB58VZIGMIbNp7zCx2eaoS797dvgennQHFyYD30+4ujjximNE4c0+tOvFqO4pLKpw7OLOiPmsjKsAynnTzxKJEijgjmd+lZOw/V+lXJYIHwVTnRPa94KWvZic0kHcyAtF6n8/34s342hdEXRXjlzzxWhAc7olkR5CFpmRYDNvAzaxaz5IUA/qZe6yaN8Lx9U1zbOktaL12eOxly5F1MvBKlRPxfiOIa5hqpuRqmjnlq7z3uuIbheszj3OZ30u0imwH3FDuMz1yqqO00DI7yK5oQG8iAMrBq/cHq7wTgBPA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6610.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(396003)(376002)(346002)(366004)(39860400002)(1076003)(316002)(4326008)(2906002)(26005)(956004)(52116002)(2616005)(30864003)(66556008)(55016002)(66946007)(86362001)(36756003)(8936002)(7696005)(83380400001)(6666004)(8886007)(186003)(5660300002)(8676002)(478600001)(16526019)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 52CzitvJGOLxsAF33Bl1bxesR4Mni6IfekNdhBnecod+b1yMYTG2nU0wDLz/Hz6/WuTjwZ+Mp75+qvESTUoeIAYXnqHYGgULyIZNKOV2/4D7MTGzlKm6mmJ64ycIxfBKCAY1Ja8GNZ/UVFLwrBoyixocoSmh117lGkvXjkr43EltAb8csH18s+cibSw4agKwYpRku5p4d/zdLm87iR6nhtfhsH6Cfz3W97PtyDlVw+I9HGnrK+CTpFKlv2U/tP6dReSX8yKwqE/mA+aeEuIvW8DdRxHzNcYLhZepx3yi9yJ2OaawlHzAECSMT2ivHZtCFidJbdw5sglP/LycB3/IYye61GbdlVyvPg3iPuW1EZHBOq5RHE5bsEkQxo51Y1uQ2gAc1ChTEBb0R3QwP5OpQQihYphVVg+5PlS5aqDxBoG0+OkK0/5ckzk0l+85Ftqk2qPMLcmXoWgJbFAYDFTTXBxTwkQ+x1PqsyWP+BBV0lo= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa8fbcb0-7a0f-42c7-b331-08d8088c215f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2020 13:35:22.4656 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gcKbyy2d0MZHOfBIeyLwhHk6xFHDAiS1ETFdGyd49o43wDJCfal95Jnfeypit6wGRxoK9/zOAuZuiEVczd6Wkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4577 Subject: [dpdk-dev] [PATCH v7 1/5] app/flow-perf: add flow performance skeleton X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Add flow performance application skeleton. Signed-off-by: Wisam Jaddo Reviewed-by: Andrew Rybchenko Acked-by: Xiaoyu Min --- MAINTAINERS | 5 + app/Makefile | 1 + app/meson.build | 1 + app/test-flow-perf/Makefile | 23 +++ app/test-flow-perf/config.h | 14 ++ app/test-flow-perf/main.c | 194 +++++++++++++++++++++++++ app/test-flow-perf/meson.build | 8 + config/common_base | 5 + doc/guides/rel_notes/release_20_08.rst | 4 + doc/guides/tools/flow-perf.rst | 44 ++++++ doc/guides/tools/index.rst | 1 + 11 files changed, 300 insertions(+) create mode 100644 app/test-flow-perf/Makefile create mode 100644 app/test-flow-perf/config.h create mode 100644 app/test-flow-perf/main.c create mode 100644 app/test-flow-perf/meson.build create mode 100644 doc/guides/tools/flow-perf.rst diff --git a/MAINTAINERS b/MAINTAINERS index d2b286701..f1a501ad2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1520,6 +1520,11 @@ T: git://dpdk.org/next/dpdk-next-net F: app/test-pmd/ F: doc/guides/testpmd_app_ug/ +Flow performance tool +M: Wisam Jaddo +F: app/test-flow-perf +F: doc/guides/flow-perf.rst + Compression performance test application T: git://dpdk.org/next/dpdk-next-crypto F: app/test-compress-perf/ diff --git a/app/Makefile b/app/Makefile index 823771c5f..0392a7de0 100644 --- a/app/Makefile +++ b/app/Makefile @@ -10,6 +10,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_PDUMP) += pdump DIRS-$(CONFIG_RTE_LIBRTE_ACL) += test-acl DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test-cmdline DIRS-$(CONFIG_RTE_LIBRTE_FIB) += test-fib +DIRS-$(CONFIG_RTE_TEST_FLOW_PERF) += test-flow-perf DIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += test-pipeline DIRS-$(CONFIG_RTE_LIBRTE_IPSEC) += test-sad diff --git a/app/meson.build b/app/meson.build index 0f7fe9464..408676b06 100644 --- a/app/meson.build +++ b/app/meson.build @@ -15,6 +15,7 @@ apps = [ 'test-crypto-perf', 'test-eventdev', 'test-fib', + 'test-flow-perf', 'test-pipeline', 'test-pmd', 'test-sad'] diff --git a/app/test-flow-perf/Makefile b/app/test-flow-perf/Makefile new file mode 100644 index 000000000..db043c17a --- /dev/null +++ b/app/test-flow-perf/Makefile @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright 2020 Mellanox Technologies, Ltd + +include $(RTE_SDK)/mk/rte.vars.mk + +ifeq ($(CONFIG_RTE_TEST_FLOW_PERF),y) + +# +# library name +# +APP = dpdk-test-flow-perf + +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) + +# +# all source are stored in SRCS-y +# +SRCS-y += main.c + +include $(RTE_SDK)/mk/rte.app.mk + +endif diff --git a/app/test-flow-perf/config.h b/app/test-flow-perf/config.h new file mode 100644 index 000000000..cf41e0345 --- /dev/null +++ b/app/test-flow-perf/config.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: BSD-3-Claus + * Copyright 2020 Mellanox Technologies, Ltd + */ + +#define GET_RSS_HF() (ETH_RSS_IP | ETH_RSS_TCP) + +/* Configuration */ +#define RXQ_NUM 4 +#define TXQ_NUM 4 +#define TOTAL_MBUF_NUM 32000 +#define MBUF_SIZE 2048 +#define MBUF_CACHE_SIZE 512 +#define NR_RXD 256 +#define NR_TXD 256 diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c new file mode 100644 index 000000000..8659870af --- /dev/null +++ b/app/test-flow-perf/main.c @@ -0,0 +1,194 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 Mellanox Technologies, Ltd + * + * This file contain the application main file + * This application provides the user the ability to test the + * insertion rate for specific rte_flow rule under stress state ~4M rule/ + * + * Then it will also provide packet per second measurement after installing + * all rules, the user may send traffic to test the PPS that match the rules + * after all rules are installed, to check performance or functionality after + * the stress. + * + * The flows insertion will go for all ports first, then it will print the + * results, after that the application will go into forwarding packets mode + * it will start receiving traffic if any and then forwarding it back and + * gives packet per second measurement. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "config.h" + +static uint32_t nb_lcores; +static struct rte_mempool *mbuf_mp; + +static void +usage(char *progname) +{ + printf("\nusage: %s\n", progname); +} + +static void +args_parse(int argc, char **argv) +{ + char **argvopt; + int opt; + int opt_idx; + static struct option lgopts[] = { + /* Control */ + { "help", 0, 0, 0 }, + }; + + argvopt = argv; + + while ((opt = getopt_long(argc, argvopt, "", + lgopts, &opt_idx)) != EOF) { + switch (opt) { + case 0: + if (strcmp(lgopts[opt_idx].name, "help") == 0) { + usage(argv[0]); + rte_exit(EXIT_SUCCESS, "Displayed help\n"); + } + break; + default: + fprintf(stderr, "Invalid option: %s\n", argv[optind]); + usage(argv[0]); + rte_exit(EXIT_SUCCESS, "Invalid option\n"); + break; + } + } +} + +static void +init_port(void) +{ + int ret; + uint16_t std_queue; + uint16_t port_id; + uint16_t nr_ports; + struct rte_eth_conf port_conf = { + .rx_adv_conf = { + .rss_conf.rss_hf = + GET_RSS_HF(), + } + }; + struct rte_eth_txconf txq_conf; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_dev_info dev_info; + + nr_ports = rte_eth_dev_count_avail(); + if (nr_ports == 0) + rte_exit(EXIT_FAILURE, "Error: no port detected\n"); + + mbuf_mp = rte_pktmbuf_pool_create("mbuf_pool", + TOTAL_MBUF_NUM, MBUF_CACHE_SIZE, + 0, MBUF_SIZE, + rte_socket_id()); + if (mbuf_mp == NULL) + rte_exit(EXIT_FAILURE, "Error: can't init mbuf pool\n"); + + for (port_id = 0; port_id < nr_ports; port_id++) { + ret = rte_eth_dev_info_get(port_id, &dev_info); + if (ret != 0) + rte_exit(EXIT_FAILURE, + "Error during getting device" + " (port %u) info: %s\n", + port_id, strerror(-ret)); + + port_conf.txmode.offloads &= dev_info.tx_offload_capa; + port_conf.rxmode.offloads &= dev_info.rx_offload_capa; + + printf(":: initializing port: %d\n", port_id); + + ret = rte_eth_dev_configure(port_id, RXQ_NUM, + TXQ_NUM, &port_conf); + if (ret < 0) + rte_exit(EXIT_FAILURE, + ":: cannot configure device: err=%d, port=%u\n", + ret, port_id); + + rxq_conf = dev_info.default_rxconf; + for (std_queue = 0; std_queue < RXQ_NUM; std_queue++) { + ret = rte_eth_rx_queue_setup(port_id, std_queue, NR_RXD, + rte_eth_dev_socket_id(port_id), + &rxq_conf, + mbuf_mp); + if (ret < 0) + rte_exit(EXIT_FAILURE, + ":: Rx queue setup failed: err=%d, port=%u\n", + ret, port_id); + } + + txq_conf = dev_info.default_txconf; + for (std_queue = 0; std_queue < TXQ_NUM; std_queue++) { + ret = rte_eth_tx_queue_setup(port_id, std_queue, NR_TXD, + rte_eth_dev_socket_id(port_id), + &txq_conf); + if (ret < 0) + rte_exit(EXIT_FAILURE, + ":: Tx queue setup failed: err=%d, port=%u\n", + ret, port_id); + } + + /* Catch all packets from traffic generator. */ + ret = rte_eth_promiscuous_enable(port_id); + if (ret != 0) + rte_exit(EXIT_FAILURE, + ":: promiscuous mode enable failed: err=%s, port=%u\n", + rte_strerror(-ret), port_id); + + ret = rte_eth_dev_start(port_id); + if (ret < 0) + rte_exit(EXIT_FAILURE, + "rte_eth_dev_start:err=%d, port=%u\n", + ret, port_id); + + printf(":: initializing port: %d done\n", port_id); + } +} + +int +main(int argc, char **argv) +{ + int ret; + uint16_t port; + struct rte_flow_error error; + + ret = rte_eal_init(argc, argv); + if (ret < 0) + rte_exit(EXIT_FAILURE, "EAL init failed\n"); + + argc -= ret; + argv += ret; + if (argc > 1) + args_parse(argc, argv); + + init_port(); + + nb_lcores = rte_lcore_count(); + if (nb_lcores <= 1) + rte_exit(EXIT_FAILURE, "This app needs at least two cores\n"); + + RTE_ETH_FOREACH_DEV(port) { + rte_flow_flush(port, &error); + rte_eth_dev_stop(port); + rte_eth_dev_close(port); + } + return 0; +} diff --git a/app/test-flow-perf/meson.build b/app/test-flow-perf/meson.build new file mode 100644 index 000000000..25711378f --- /dev/null +++ b/app/test-flow-perf/meson.build @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2020 Mellanox Technologies, Ltd + +sources = files( + 'main.c', +) + +deps += ['ethdev'] diff --git a/config/common_base b/config/common_base index c7d5c7321..fe30c515e 100644 --- a/config/common_base +++ b/config/common_base @@ -1117,6 +1117,11 @@ CONFIG_RTE_TEST_PMD=y CONFIG_RTE_TEST_PMD_RECORD_CORE_CYCLES=n CONFIG_RTE_TEST_PMD_RECORD_BURST_STATS=n +# +# Compile the rte flow perf application +# +CONFIG_RTE_TEST_FLOW_PERF=y + # # Compile the bbdev test application # diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst index 39064afbe..8ab5b4a34 100644 --- a/doc/guides/rel_notes/release_20_08.rst +++ b/doc/guides/rel_notes/release_20_08.rst @@ -56,6 +56,10 @@ New Features Also, make sure to start the actual text at the margin. ========================================================= + * **Add flow performance application.** + + Add new application to test rte_flow performance. + Removed Items ------------- diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst new file mode 100644 index 000000000..49eb450ae --- /dev/null +++ b/doc/guides/tools/flow-perf.rst @@ -0,0 +1,44 @@ +.. SPDX-License-Identifier: BSD-3-Clause + Copyright 2020 Mellanox Technologies, Ltd + +Flow performance tool +===================== + +Application for rte_flow performance testing. + + +Compiling the Application +========================= + +The ``test-flow-perf`` application is compiled as part of the main compilation +of the DPDK libraries and tools. + +Refer to the DPDK Getting Started Guides for details. + + +Running the Application +======================= + +EAL Command-line Options +------------------------ + +Please refer to :doc:`EAL parameters (Linux) <../linux_gsg/linux_eal_parameters>` +or :doc:`EAL parameters (FreeBSD) <../freebsd_gsg/freebsd_eal_parameters>` for +a list of available EAL command-line options. + + +Flow performance Options +------------------------ + +The following are the command-line options for the flow performance application. +They must be separated from the EAL options, shown in the previous section, +with a ``--`` separator: + +.. code-block:: console + + sudo ./dpdk-test-flow-perf -n 4 -w 08:00.0 -- + +The command line options are: + +* ``--help`` + Display a help message and quit. diff --git a/doc/guides/tools/index.rst b/doc/guides/tools/index.rst index 782b30864..7279daebc 100644 --- a/doc/guides/tools/index.rst +++ b/doc/guides/tools/index.rst @@ -16,3 +16,4 @@ DPDK Tools User Guides cryptoperf comp_perf testeventdev + flow-perf From patchwork Thu Jun 4 13:34:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wisam Jaddo X-Patchwork-Id: 70853 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1066CA00C4; Thu, 4 Jun 2020 15:35:46 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA7F61D606; Thu, 4 Jun 2020 15:35:27 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20053.outbound.protection.outlook.com [40.107.2.53]) by dpdk.org (Postfix) with ESMTP id EBFC31D5E2 for ; Thu, 4 Jun 2020 15:35:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=neWR1qXdZkwSGIPVlLBaA/C+SeUG8PGel0XhUk1tkoyxsOJAqP+myOgbwZllCMAa0WUZxGHZuS0NT6STrvpJ4FIlTiAe4whEU243FG9mVBeqZ3Re5iq2RI5OlNvLxt+PV1LC8XyXfXWtaYn5k+lW9Swo1PUDgLP1NNP8DZAX6OcPWf41qqts3VDbDeWqNwe8C7AV9ewVcWxCFvHftnDQeJFtYWev6/f92pc5XVxS0glPhGwt516C7iA18Kf4bFh5cr5g7SgL+zTK6KLbPafKdXV6AJ8q333w9GYSboleyUn1QmJjOYNtuplfPV6Cf6vIpGsBuvWPR4enQPDEEukbdA== 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-SenderADCheck; bh=6LqV158S07zuZNfyyTSxv55yfFq/FXvB0bD3W2ehn+8=; b=WBSQ9FnHYztsUZHLJmCJyUtZ9PssqmtcXXdUJoE59iTm9OUCxzg48uNwjNnfwhv4X5s44knRnCeU1UIxcntfFlzIkxKBWf8eu00dKbobxtBm6SMuqg/EjgdXiD907ej2sTTkXK7lckdsy1t2Y2udSbC9LOxB2dlK14LNbfAAuH4YvKKmavDBhveQA4MuXjWpmid1WDAerQNb4s3hoZxLTIpWZGjK0F81E+Pc/MBDKx8lcewXRniMuM1CmoahucESHGkJuikDFXBAXhYnVH6fByWOzzVg4Y2+XsFWcfZnBP1tro928TxueUSjM37Ujz/FrSlOC1vLuDummKHiZRqdJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6LqV158S07zuZNfyyTSxv55yfFq/FXvB0bD3W2ehn+8=; b=qkddadwXQEI+PIuaAX959UgPHJw2yTD5mBSsDSnLN6n7IgF1dwXkgcmB5OibpNvXaHIYtzWOcO2q+7A0fnfMbUVJQNx5OwDI4B/I0t4G3GZGujUydC7HPcQ3GpGS7XTdxkdZErBysFddGfTfqXVnN+Sk2uJZ6Hzx5D6JM5plZe4= Authentication-Results: solarflare.com; dkim=none (message not signed) header.d=none;solarflare.com; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR05MB6642.eurprd05.prod.outlook.com (2603:10a6:20b:146::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.20; Thu, 4 Jun 2020 13:35:23 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc%6]) with mapi id 15.20.3045.024; Thu, 4 Jun 2020 13:35:23 +0000 From: Wisam Jaddo To: arybchenko@solarflare.com, jackmin@mellanox.com, thomas@monjalon.net, jerinjacobk@gmail.com, ajit.khaparde@broadcom.com Cc: dev@dpdk.org Date: Thu, 4 Jun 2020 13:34:59 +0000 Message-Id: <20200604133502.28491-3-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200604133502.28491-1-wisamm@mellanox.com> References: <20200511110811.11474-2-wisamm@mellanox.com> <20200604133502.28491-1-wisamm@mellanox.com> X-ClientProxiedBy: AM0PR01CA0117.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::22) To AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM0PR01CA0117.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Thu, 4 Jun 2020 13:35:22 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 15e3bf40-1911-4a51-6155-08d8088c220f X-MS-TrafficTypeDiagnostic: AM0PR05MB6642: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-Forefront-PRVS: 04244E0DC5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B8j57mH6hNW7qUIWxYQVPt0JJ5qmOuQpFWI6fjeqJQwNp/OM7/I/WU9Th9+r9wj8Z6JZQrPQIBwFU/G0/Fv6pbHxY0/QaUmD9luHCeQvatrcdWWuwj6pkQ8G83bgMaitdIIcxxrACWaXIqaGA6qJVuqJlOciSvN/dca0fq1wdmD8s/NOuhztavSdWbV1CqBEIfSqpH0Lp/paQ3nBTqwNI+Q+IbC5YYwFTqiEeQuuRCflokj+jK6fHF/leCYdaged9EBTjBXqAFBg2f1TMX3Brru7uE1vm4UjluyoknEU/VkYTslkXj8by8p56OrANA81L1CMMfpUWCq+OZFaCABGIw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6610.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(136003)(39860400002)(346002)(366004)(396003)(30864003)(5660300002)(2906002)(8936002)(2616005)(6666004)(956004)(1076003)(316002)(8676002)(8886007)(66556008)(66476007)(478600001)(55016002)(36756003)(52116002)(7696005)(86362001)(26005)(4326008)(186003)(83380400001)(66946007)(16526019)(579004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: O/cCIbbuw3WgKD2q0oqPnVgRRQNQ155w4Cl1cdsUF0/FyIrPZesIUUUSuCXdgBPC4zcKgBWWPlOB3I7K7wricDhRjcjvS4xqEkWH913ZrU6eS4riDInIVmkgNC/bIZlIWR35ehHUbFqGhArBZ6zjJSO9CxtsB/fnJ7WBuX4VFmdF4Mv6dNUJUP9PJOPdx16DwHS2+xMEA+XrwA4JH6nN0HngQ7n4Ed2GfX5/cVI8ww4w5DZ1temxNfGCRl9w0qaCsG0pN1QaJ17YaOLwatfNJpfjnOU/bCExch8GbmOh+hDowbfPLdEmNsTG9U7PbNV11r7v7wIhgtd7VfJg/LaKxjQv+DPPRBo0y0xdxhcIhUvGHzGK2yE6N64DYCd1i+yzPitYzh3ANDn3BRi+He2DwJ+ihZTtIp0t3rrYryCOWLvNeS6+UPFh5kZ3wgR7itpEUwqT7rm7RDtG0ZHnLFtpOjtn7sEcvPfAhXXXd4/pvh0= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15e3bf40-1911-4a51-6155-08d8088c220f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2020 13:35:23.6949 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fgH9P9AUPfffvQoJzzylkxYjnnLztjopAjAakDxs6pg+kM3YfBZPYifrYyH4S4JQbgq4LGyxkj4i0j/DFJb/Iw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6642 Subject: [dpdk-dev] [PATCH v7 2/5] app/flow-perf: add insertion rate calculation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Add insertion rate calculation feature into flow performance application. The application now provide the ability to test insertion rate of specific rte_flow rule, by stressing it to the NIC, and calculate the insertion rate. The application offers some options in the command line, to configure which rule to apply. After that the application will start producing rules with same pattern but increasing the outer IP source address by 1 each time, thus it will give different flow each time, and all other items will have open masks. The current design have single core insertion rate. Signed-off-by: Wisam Jaddo Acked-by: Xiaoyu Min --- app/test-flow-perf/Makefile | 3 + app/test-flow-perf/actions_gen.c | 276 +++++++++++++++ app/test-flow-perf/actions_gen.h | 18 + app/test-flow-perf/config.h | 17 + app/test-flow-perf/flow_gen.c | 61 ++++ app/test-flow-perf/flow_gen.h | 37 ++ app/test-flow-perf/items_gen.c | 397 +++++++++++++++++++++ app/test-flow-perf/items_gen.h | 18 + app/test-flow-perf/main.c | 467 ++++++++++++++++++++++++- app/test-flow-perf/meson.build | 3 + doc/guides/rel_notes/release_20_08.rst | 3 + doc/guides/tools/flow-perf.rst | 196 ++++++++++- 12 files changed, 1488 insertions(+), 8 deletions(-) create mode 100644 app/test-flow-perf/actions_gen.c create mode 100644 app/test-flow-perf/actions_gen.h create mode 100644 app/test-flow-perf/flow_gen.c create mode 100644 app/test-flow-perf/flow_gen.h create mode 100644 app/test-flow-perf/items_gen.c create mode 100644 app/test-flow-perf/items_gen.h diff --git a/app/test-flow-perf/Makefile b/app/test-flow-perf/Makefile index db043c17a..4f2db7591 100644 --- a/app/test-flow-perf/Makefile +++ b/app/test-flow-perf/Makefile @@ -16,6 +16,9 @@ CFLAGS += $(WERROR_FLAGS) # # all source are stored in SRCS-y # +SRCS-y += actions_gen.c +SRCS-y += flow_gen.c +SRCS-y += items_gen.c SRCS-y += main.c include $(RTE_SDK)/mk/rte.app.mk diff --git a/app/test-flow-perf/actions_gen.c b/app/test-flow-perf/actions_gen.c new file mode 100644 index 000000000..864d0c978 --- /dev/null +++ b/app/test-flow-perf/actions_gen.c @@ -0,0 +1,276 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 Mellanox Technologies, Ltd + * + * The file contains the implementations of actions generators. + * Each generator is responsible for preparing it's action instance + * and initializing it with needed data. + */ + +#include +#include +#include +#include + +#include "actions_gen.h" +#include "flow_gen.h" +#include "config.h" + +/* Storage for additional parameters for actions */ +struct additional_para { + uint16_t queue; + uint16_t next_table; + uint16_t *queues; + uint16_t queues_number; +}; + +/* Storage for struct rte_flow_action_rss including external data. */ +struct action_rss_data { + struct rte_flow_action_rss conf; + uint8_t key[40]; + uint16_t queue[128]; +}; + +static void +add_mark(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_mark mark_action; + + do { + mark_action.id = MARK_ID; + } while (0); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_MARK; + actions[actions_counter].conf = &mark_action; +} + +static void +add_queue(struct rte_flow_action *actions, + uint8_t actions_counter, + struct additional_para para) +{ + static struct rte_flow_action_queue queue_action; + + do { + queue_action.index = para.queue; + } while (0); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_QUEUE; + actions[actions_counter].conf = &queue_action; +} + +static void +add_jump(struct rte_flow_action *actions, + uint8_t actions_counter, + struct additional_para para) +{ + static struct rte_flow_action_jump jump_action; + + do { + jump_action.group = para.next_table; + } while (0); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_JUMP; + actions[actions_counter].conf = &jump_action; +} + +static void +add_rss(struct rte_flow_action *actions, + uint8_t actions_counter, + struct additional_para para) +{ + static struct rte_flow_action_rss *rss_action; + static struct action_rss_data *rss_data; + + uint16_t queue; + + rss_data = rte_malloc("rss_data", + sizeof(struct action_rss_data), 0); + + if (rss_data == NULL) + rte_exit(EXIT_FAILURE, "No Memory available!"); + + *rss_data = (struct action_rss_data){ + .conf = (struct rte_flow_action_rss){ + .func = RTE_ETH_HASH_FUNCTION_DEFAULT, + .level = 0, + .types = GET_RSS_HF(), + .key_len = sizeof(rss_data->key), + .queue_num = para.queues_number, + .key = rss_data->key, + .queue = rss_data->queue, + }, + .key = { 1 }, + .queue = { 0 }, + }; + + for (queue = 0; queue < para.queues_number; queue++) + rss_data->queue[queue] = para.queues[queue]; + + rss_action = &rss_data->conf; + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_RSS; + actions[actions_counter].conf = rss_action; +} + +static void +add_set_meta(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_meta meta_action; + + do { + meta_action.data = RTE_BE32(META_DATA); + meta_action.mask = RTE_BE32(0xffffffff); + } while (0); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_META; + actions[actions_counter].conf = &meta_action; +} + +static void +add_set_tag(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_set_tag tag_action; + + do { + tag_action.data = RTE_BE32(META_DATA); + tag_action.mask = RTE_BE32(0xffffffff); + tag_action.index = TAG_INDEX; + } while (0); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_SET_TAG; + actions[actions_counter].conf = &tag_action; +} + +static void +add_port_id(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_port_id port_id; + + do { + port_id.id = PORT_ID_DST; + } while (0); + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_PORT_ID; + actions[actions_counter].conf = &port_id; +} + +static void +add_drop(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_DROP; +} + +static void +add_count(struct rte_flow_action *actions, + uint8_t actions_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_action_count count_action; + + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_COUNT; + actions[actions_counter].conf = &count_action; +} + +void +fill_actions(struct rte_flow_action *actions, uint64_t flow_actions, + uint32_t counter, uint16_t next_table, uint16_t hairpinq) +{ + struct additional_para additional_para_data; + uint8_t actions_counter = 0; + uint16_t hairpin_queues[hairpinq]; + uint16_t queues[RXQ_NUM]; + uint16_t i; + + for (i = 0; i < RXQ_NUM; i++) + queues[i] = i; + + for (i = 0; i < hairpinq; i++) + hairpin_queues[i] = i + RXQ_NUM; + + additional_para_data = (struct additional_para){ + .queue = counter % RXQ_NUM, + .next_table = next_table, + .queues = queues, + .queues_number = RXQ_NUM, + }; + + if (hairpinq != 0) { + additional_para_data.queues = hairpin_queues; + additional_para_data.queues_number = hairpinq; + additional_para_data.queue = (counter % hairpinq) + RXQ_NUM; + } + + static const struct actions_dict { + uint64_t mask; + void (*funct)( + struct rte_flow_action *actions, + uint8_t actions_counter, + struct additional_para para + ); + } flows_actions[] = { + { + .mask = FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_MARK), + .funct = add_mark, + }, + { + .mask = FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_COUNT), + .funct = add_count, + }, + { + .mask = FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_SET_META), + .funct = add_set_meta, + }, + { + .mask = FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_SET_TAG), + .funct = add_set_tag, + }, + { + .mask = FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_QUEUE), + .funct = add_queue, + }, + { + .mask = FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_RSS), + .funct = add_rss, + }, + { + .mask = FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_JUMP), + .funct = add_jump, + }, + { + .mask = FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_PORT_ID), + .funct = add_port_id + }, + { + .mask = FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_DROP), + .funct = add_drop, + }, + { + .mask = HAIRPIN_QUEUE_ACTION, + .funct = add_queue, + }, + { + .mask = HAIRPIN_RSS_ACTION, + .funct = add_rss, + }, + }; + + for (i = 0; i < RTE_DIM(flows_actions); i++) { + if ((flow_actions & flows_actions[i].mask) == 0) + continue; + flows_actions[i].funct( + actions, actions_counter++, + additional_para_data + ); + } + actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_END; +} diff --git a/app/test-flow-perf/actions_gen.h b/app/test-flow-perf/actions_gen.h new file mode 100644 index 000000000..0defa7c97 --- /dev/null +++ b/app/test-flow-perf/actions_gen.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 Mellanox Technologies, Ltd + * + * This file contains the functions definitions to + * generate each supported action. + */ + +#ifndef FLOW_PERF_ACTION_GEN +#define FLOW_PERF_ACTION_GEN + +#include + +#include "config.h" + +void fill_actions(struct rte_flow_action *actions, uint64_t actions_selector, + uint32_t counter, uint16_t next_table, uint16_t hairpinq); + +#endif /* FLOW_PERF_ACTION_GEN */ diff --git a/app/test-flow-perf/config.h b/app/test-flow-perf/config.h index cf41e0345..a4626e72b 100644 --- a/app/test-flow-perf/config.h +++ b/app/test-flow-perf/config.h @@ -2,6 +2,9 @@ * Copyright 2020 Mellanox Technologies, Ltd */ +#define FLOW_ITEM_MASK(_x) (UINT64_C(1) << _x) +#define FLOW_ACTION_MASK(_x) (UINT64_C(1) << _x) +#define FLOW_ATTR_MASK(_x) (UINT64_C(1) << _x) #define GET_RSS_HF() (ETH_RSS_IP | ETH_RSS_TCP) /* Configuration */ @@ -12,3 +15,17 @@ #define MBUF_CACHE_SIZE 512 #define NR_RXD 256 #define NR_TXD 256 + +/* Items/Actions parameters */ +#define JUMP_ACTION_TABLE 2 +#define VLAN_VALUE 1 +#define VNI_VALUE 1 +#define META_DATA 1 +#define TAG_INDEX 0 +#define PORT_ID_DST 1 +#define MARK_ID 1 +#define TEID_VALUE 1 + +/* Flow items/acctions max size */ +#define MAX_ITEMS_NUM 32 +#define MAX_ACTIONS_NUM 32 diff --git a/app/test-flow-perf/flow_gen.c b/app/test-flow-perf/flow_gen.c new file mode 100644 index 000000000..e87276bd1 --- /dev/null +++ b/app/test-flow-perf/flow_gen.c @@ -0,0 +1,61 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 Mellanox Technologies, Ltd + * + * The file contains the implementations of the method to + * fill items, actions & attributes in their corresponding + * arrays, and then generate rte_flow rule. + * + * After the generation. The rule goes to validation then + * creation state and then return the results. + */ + +#include + +#include "flow_gen.h" +#include "items_gen.h" +#include "actions_gen.h" +#include "config.h" + +static void +fill_attributes(struct rte_flow_attr *attr, + uint64_t flow_attrs, uint16_t group) +{ + if (flow_attrs & INGRESS) + attr->ingress = 1; + if (flow_attrs & EGRESS) + attr->egress = 1; + if (flow_attrs & TRANSFER) + attr->transfer = 1; + attr->group = group; +} + +struct rte_flow * +generate_flow(uint16_t port_id, + uint16_t group, + uint64_t flow_attrs, + uint64_t flow_items, + uint64_t flow_actions, + uint16_t next_table, + uint32_t outer_ip_src, + uint16_t hairpinq, + struct rte_flow_error *error) +{ + struct rte_flow_attr attr; + struct rte_flow_item items[MAX_ITEMS_NUM]; + struct rte_flow_action actions[MAX_ACTIONS_NUM]; + struct rte_flow *flow = NULL; + + memset(items, 0, sizeof(items)); + memset(actions, 0, sizeof(actions)); + memset(&attr, 0, sizeof(struct rte_flow_attr)); + + fill_attributes(&attr, flow_attrs, group); + + fill_actions(actions, flow_actions, + outer_ip_src, next_table, hairpinq); + + fill_items(items, flow_items, outer_ip_src); + + flow = rte_flow_create(port_id, &attr, items, actions, error); + return flow; +} diff --git a/app/test-flow-perf/flow_gen.h b/app/test-flow-perf/flow_gen.h new file mode 100644 index 000000000..848331e22 --- /dev/null +++ b/app/test-flow-perf/flow_gen.h @@ -0,0 +1,37 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 Mellanox Technologies, Ltd + * + * This file contains the items, actions and attributes + * definition. And the methods to prepare and fill items, + * actions and attributes to generate rte_flow rule. + */ + +#ifndef FLOW_PERF_FLOW_GEN +#define FLOW_PERF_FLOW_GEN + +#include +#include + +#include "config.h" + +/* Actions */ +#define HAIRPIN_QUEUE_ACTION FLOW_ACTION_MASK(0) +#define HAIRPIN_RSS_ACTION FLOW_ACTION_MASK(1) + +/* Attributes */ +#define INGRESS FLOW_ATTR_MASK(0) +#define EGRESS FLOW_ATTR_MASK(1) +#define TRANSFER FLOW_ATTR_MASK(2) + +struct rte_flow * +generate_flow(uint16_t port_id, + uint16_t group, + uint64_t flow_attrs, + uint64_t flow_items, + uint64_t flow_actions, + uint16_t next_table, + uint32_t outer_ip_src, + uint16_t hairpinq, + struct rte_flow_error *error); + +#endif /* FLOW_PERF_FLOW_GEN */ diff --git a/app/test-flow-perf/items_gen.c b/app/test-flow-perf/items_gen.c new file mode 100644 index 000000000..6a8915100 --- /dev/null +++ b/app/test-flow-perf/items_gen.c @@ -0,0 +1,397 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 Mellanox Technologies, Ltd + * + * This file contain the implementations of the items + * related methods. Each Item have a method to prepare + * the item and add it into items array in given index. + */ + +#include +#include + +#include "items_gen.h" +#include "config.h" + +/* Storage for additional parameters for items */ +struct additional_para { + rte_be32_t src_ip; +}; + +static void +add_ether(struct rte_flow_item *items, + uint8_t items_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_item_eth eth_spec; + static struct rte_flow_item_eth eth_mask; + + memset(ð_spec, 0, sizeof(struct rte_flow_item_eth)); + memset(ð_mask, 0, sizeof(struct rte_flow_item_eth)); + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_ETH; + items[items_counter].spec = ð_spec; + items[items_counter].mask = ð_mask; +} + +static void +add_vlan(struct rte_flow_item *items, + uint8_t items_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_item_vlan vlan_spec; + static struct rte_flow_item_vlan vlan_mask; + + uint16_t vlan_value = VLAN_VALUE; + + memset(&vlan_spec, 0, sizeof(struct rte_flow_item_vlan)); + memset(&vlan_mask, 0, sizeof(struct rte_flow_item_vlan)); + + vlan_spec.tci = RTE_BE16(vlan_value); + vlan_mask.tci = RTE_BE16(0xffff); + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_VLAN; + items[items_counter].spec = &vlan_spec; + items[items_counter].mask = &vlan_mask; +} + +static void +add_ipv4(struct rte_flow_item *items, + uint8_t items_counter, struct additional_para para) +{ + static struct rte_flow_item_ipv4 ipv4_spec; + static struct rte_flow_item_ipv4 ipv4_mask; + + memset(&ipv4_spec, 0, sizeof(struct rte_flow_item_ipv4)); + memset(&ipv4_mask, 0, sizeof(struct rte_flow_item_ipv4)); + + ipv4_spec.hdr.src_addr = para.src_ip; + ipv4_mask.hdr.src_addr = RTE_BE32(0xffffffff); + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_IPV4; + items[items_counter].spec = &ipv4_spec; + items[items_counter].mask = &ipv4_mask; +} + + +static void +add_ipv6(struct rte_flow_item *items, + uint8_t items_counter, struct additional_para para) +{ + static struct rte_flow_item_ipv6 ipv6_spec; + static struct rte_flow_item_ipv6 ipv6_mask; + + memset(&ipv6_spec, 0, sizeof(struct rte_flow_item_ipv6)); + memset(&ipv6_mask, 0, sizeof(struct rte_flow_item_ipv6)); + + /** Set ipv6 src **/ + memset(&ipv6_spec.hdr.src_addr, para.src_ip, + sizeof(ipv6_spec.hdr.src_addr) / 2); + + /** Full mask **/ + memset(&ipv6_mask.hdr.src_addr, 0xff, + sizeof(ipv6_spec.hdr.src_addr)); + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_IPV6; + items[items_counter].spec = &ipv6_spec; + items[items_counter].mask = &ipv6_mask; +} + +static void +add_tcp(struct rte_flow_item *items, + uint8_t items_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_item_tcp tcp_spec; + static struct rte_flow_item_tcp tcp_mask; + + memset(&tcp_spec, 0, sizeof(struct rte_flow_item_tcp)); + memset(&tcp_mask, 0, sizeof(struct rte_flow_item_tcp)); + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_TCP; + items[items_counter].spec = &tcp_spec; + items[items_counter].mask = &tcp_mask; +} + +static void +add_udp(struct rte_flow_item *items, + uint8_t items_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_item_udp udp_spec; + static struct rte_flow_item_udp udp_mask; + + memset(&udp_spec, 0, sizeof(struct rte_flow_item_udp)); + memset(&udp_mask, 0, sizeof(struct rte_flow_item_udp)); + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_UDP; + items[items_counter].spec = &udp_spec; + items[items_counter].mask = &udp_mask; +} + +static void +add_vxlan(struct rte_flow_item *items, + uint8_t items_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_item_vxlan vxlan_spec; + static struct rte_flow_item_vxlan vxlan_mask; + + uint32_t vni_value; + uint8_t i; + + vni_value = VNI_VALUE; + + memset(&vxlan_spec, 0, sizeof(struct rte_flow_item_vxlan)); + memset(&vxlan_mask, 0, sizeof(struct rte_flow_item_vxlan)); + + /* Set standard vxlan vni */ + for (i = 0; i < 3; i++) { + vxlan_spec.vni[2 - i] = vni_value >> (i * 8); + vxlan_mask.vni[2 - i] = 0xff; + } + + /* Standard vxlan flags */ + vxlan_spec.flags = 0x8; + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_VXLAN; + items[items_counter].spec = &vxlan_spec; + items[items_counter].mask = &vxlan_mask; +} + +static void +add_vxlan_gpe(struct rte_flow_item *items, + uint8_t items_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_item_vxlan_gpe vxlan_gpe_spec; + static struct rte_flow_item_vxlan_gpe vxlan_gpe_mask; + + uint32_t vni_value; + uint8_t i; + + vni_value = VNI_VALUE; + + memset(&vxlan_gpe_spec, 0, sizeof(struct rte_flow_item_vxlan_gpe)); + memset(&vxlan_gpe_mask, 0, sizeof(struct rte_flow_item_vxlan_gpe)); + + /* Set vxlan-gpe vni */ + for (i = 0; i < 3; i++) { + vxlan_gpe_spec.vni[2 - i] = vni_value >> (i * 8); + vxlan_gpe_mask.vni[2 - i] = 0xff; + } + + /* vxlan-gpe flags */ + vxlan_gpe_spec.flags = 0x0c; + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_VXLAN_GPE; + items[items_counter].spec = &vxlan_gpe_spec; + items[items_counter].mask = &vxlan_gpe_mask; +} + +static void +add_gre(struct rte_flow_item *items, + uint8_t items_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_item_gre gre_spec; + static struct rte_flow_item_gre gre_mask; + + uint16_t proto; + + proto = RTE_ETHER_TYPE_TEB; + + memset(&gre_spec, 0, sizeof(struct rte_flow_item_gre)); + memset(&gre_mask, 0, sizeof(struct rte_flow_item_gre)); + + gre_spec.protocol = RTE_BE16(proto); + gre_mask.protocol = RTE_BE16(0xffff); + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_GRE; + items[items_counter].spec = &gre_spec; + items[items_counter].mask = &gre_mask; +} + +static void +add_geneve(struct rte_flow_item *items, + uint8_t items_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_item_geneve geneve_spec; + static struct rte_flow_item_geneve geneve_mask; + + uint32_t vni_value; + uint8_t i; + + vni_value = VNI_VALUE; + + memset(&geneve_spec, 0, sizeof(struct rte_flow_item_geneve)); + memset(&geneve_mask, 0, sizeof(struct rte_flow_item_geneve)); + + for (i = 0; i < 3; i++) { + geneve_spec.vni[2 - i] = vni_value >> (i * 8); + geneve_mask.vni[2 - i] = 0xff; + } + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_GENEVE; + items[items_counter].spec = &geneve_spec; + items[items_counter].mask = &geneve_mask; +} + +static void +add_gtp(struct rte_flow_item *items, + uint8_t items_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_item_gtp gtp_spec; + static struct rte_flow_item_gtp gtp_mask; + + uint32_t teid_value; + + teid_value = TEID_VALUE; + + memset(>p_spec, 0, sizeof(struct rte_flow_item_gtp)); + memset(>p_mask, 0, sizeof(struct rte_flow_item_gtp)); + + gtp_spec.teid = RTE_BE32(teid_value); + gtp_mask.teid = RTE_BE32(0xffffffff); + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_GTP; + items[items_counter].spec = >p_spec; + items[items_counter].mask = >p_mask; +} + +static void +add_meta_data(struct rte_flow_item *items, + uint8_t items_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_item_meta meta_spec; + static struct rte_flow_item_meta meta_mask; + + uint32_t data; + + data = META_DATA; + + memset(&meta_spec, 0, sizeof(struct rte_flow_item_meta)); + memset(&meta_mask, 0, sizeof(struct rte_flow_item_meta)); + + meta_spec.data = RTE_BE32(data); + meta_mask.data = RTE_BE32(0xffffffff); + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_META; + items[items_counter].spec = &meta_spec; + items[items_counter].mask = &meta_mask; +} + + +static void +add_meta_tag(struct rte_flow_item *items, + uint8_t items_counter, + __rte_unused struct additional_para para) +{ + static struct rte_flow_item_tag tag_spec; + static struct rte_flow_item_tag tag_mask; + uint32_t data; + uint8_t index; + + data = META_DATA; + index = TAG_INDEX; + + memset(&tag_spec, 0, sizeof(struct rte_flow_item_tag)); + memset(&tag_mask, 0, sizeof(struct rte_flow_item_tag)); + + tag_spec.data = RTE_BE32(data); + tag_mask.data = RTE_BE32(0xffffffff); + tag_spec.index = index; + tag_mask.index = 0xff; + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_TAG; + items[items_counter].spec = &tag_spec; + items[items_counter].mask = &tag_mask; +} + +void +fill_items(struct rte_flow_item *items, + uint64_t flow_items, uint32_t outer_ip_src) +{ + uint8_t items_counter = 0; + uint8_t i; + struct additional_para additional_para_data = { + .src_ip = outer_ip_src, + }; + + /* Support outer items up to tunnel layer only. */ + static const struct items_dict { + uint64_t mask; + void (*funct)( + struct rte_flow_item *items, + uint8_t items_counter, + struct additional_para para + ); + } flows_items[] = { + { + .mask = RTE_FLOW_ITEM_TYPE_META, + .funct = add_meta_data, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_TAG, + .funct = add_meta_tag, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_ETH, + .funct = add_ether, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_VLAN, + .funct = add_vlan, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_IPV4, + .funct = add_ipv4, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_IPV6, + .funct = add_ipv6, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_TCP, + .funct = add_tcp, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_UDP, + .funct = add_udp, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_VXLAN, + .funct = add_vxlan, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_VXLAN_GPE, + .funct = add_vxlan_gpe, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_GRE, + .funct = add_gre, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_GENEVE, + .funct = add_geneve, + }, + { + .mask = RTE_FLOW_ITEM_TYPE_GTP, + .funct = add_gtp, + }, + + }; + + for (i = 0; i < RTE_DIM(flows_items); i++) { + if ((flow_items & FLOW_ITEM_MASK(flows_items[i].mask)) == 0) + continue; + flows_items[i].funct( + items, items_counter++, + additional_para_data + ); + } + + items[items_counter].type = RTE_FLOW_ITEM_TYPE_END; +} diff --git a/app/test-flow-perf/items_gen.h b/app/test-flow-perf/items_gen.h new file mode 100644 index 000000000..9509d0f11 --- /dev/null +++ b/app/test-flow-perf/items_gen.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2020 Mellanox Technologies, Ltd + * + * This file contains the items related methods + */ + +#ifndef FLOW_PERF_ITEMS_GEN +#define FLOW_PERF_ITEMS_GEN + +#include +#include + +#include "config.h" + +void fill_items(struct rte_flow_item *items, uint64_t flow_items, + uint32_t outer_ip_src); + +#endif /* FLOW_PERF_ITEMS_GEN */ diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 8659870af..5bff48d32 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -34,29 +35,257 @@ #include #include "config.h" +#include "flow_gen.h" -static uint32_t nb_lcores; +#define MAX_ITERATIONS 100 +#define DEFAULT_RULES_COUNT 4000000 +#define DEFAULT_ITERATION 100000 + +struct rte_flow *flow; +static uint8_t flow_group; + +static uint64_t flow_items; +static uint64_t flow_actions; +static uint64_t flow_attrs; +static volatile bool force_quit; +static bool dump_iterations; static struct rte_mempool *mbuf_mp; +static uint32_t nb_lcores; +static uint32_t flows_count; +static uint32_t iterations_number; +static uint32_t hairpinq; static void usage(char *progname) { printf("\nusage: %s\n", progname); + printf("\nControl configurations:\n"); + printf(" --flows-count=N: to set the number of needed" + " flows to insert, default is 4,000,000\n"); + printf(" --dump-iterations: To print rates for each" + " iteration\n"); + + printf("To set flow attributes:\n"); + printf(" --ingress: set ingress attribute in flows\n"); + printf(" --egress: set egress attribute in flows\n"); + printf(" --transfer: set transfer attribute in flows\n"); + printf(" --group=N: set group for all flows," + " default is 0\n"); + + printf("To set flow items:\n"); + printf(" --ether: add ether layer in flow items\n"); + printf(" --vlan: add vlan layer in flow items\n"); + printf(" --ipv4: add ipv4 layer in flow items\n"); + printf(" --ipv6: add ipv6 layer in flow items\n"); + printf(" --tcp: add tcp layer in flow items\n"); + printf(" --udp: add udp layer in flow items\n"); + printf(" --vxlan: add vxlan layer in flow items\n"); + printf(" --vxlan-gpe: add vxlan-gpe layer in flow items\n"); + printf(" --gre: add gre layer in flow items\n"); + printf(" --geneve: add geneve layer in flow items\n"); + printf(" --gtp: add gtp layer in flow items\n"); + printf(" --meta: add meta layer in flow items\n"); + printf(" --tag: add tag layer in flow items\n"); + + printf("To set flow actions:\n"); + printf(" --port-id: add port-id action in flow actions\n"); + printf(" --rss: add rss action in flow actions\n"); + printf(" --queue: add queue action in flow actions\n"); + printf(" --jump: add jump action in flow actions\n"); + printf(" --mark: add mark action in flow actions\n"); + printf(" --count: add count action in flow actions\n"); + printf(" --set-meta: add set meta action in flow actions\n"); + printf(" --set-tag: add set tag action in flow actions\n"); + printf(" --drop: add drop action in flow actions\n"); + printf(" --hairpin-queue=N: add hairpin-queue action in flow actions\n"); + printf(" --hairpin-rss=N: add hairping-rss action in flow actions\n"); } static void args_parse(int argc, char **argv) { char **argvopt; - int opt; + int n, opt; int opt_idx; - static struct option lgopts[] = { + size_t i; + + static const struct option_dict { + const char *str; + const uint64_t mask; + uint64_t *bitmap; + } flow_options[] = { + { + .str = "ether", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_ETH), + .bitmap = &flow_items + }, + { + .str = "ipv4", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_IPV4), + .bitmap = &flow_items + }, + { + .str = "ipv6", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_IPV6), + .bitmap = &flow_items + }, + { + .str = "vlan", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_VLAN), + .bitmap = &flow_items + }, + { + .str = "tcp", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_TCP), + .bitmap = &flow_items + }, + { + .str = "udp", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_UDP), + .bitmap = &flow_items + }, + { + .str = "vxlan", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_VXLAN), + .bitmap = &flow_items + }, + { + .str = "vxlan-gpe", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_VXLAN_GPE), + .bitmap = &flow_items + }, + { + .str = "gre", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_GRE), + .bitmap = &flow_items + }, + { + .str = "geneve", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_GENEVE), + .bitmap = &flow_items + }, + { + .str = "gtp", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_GTP), + .bitmap = &flow_items + }, + { + .str = "meta", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_META), + .bitmap = &flow_items + }, + { + .str = "tag", + .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_TAG), + .bitmap = &flow_items + }, + { + .str = "ingress", + .mask = INGRESS, + .bitmap = &flow_attrs + }, + { + .str = "egress", + .mask = EGRESS, + .bitmap = &flow_attrs + }, + { + .str = "transfer", + .mask = TRANSFER, + .bitmap = &flow_attrs + }, + { + .str = "port-id", + .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_PORT_ID), + .bitmap = &flow_actions + }, + { + .str = "rss", + .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_RSS), + .bitmap = &flow_actions + }, + { + .str = "queue", + .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_QUEUE), + .bitmap = &flow_actions + }, + { + .str = "jump", + .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_JUMP), + .bitmap = &flow_actions + }, + { + .str = "mark", + .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_MARK), + .bitmap = &flow_actions + }, + { + .str = "count", + .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_COUNT), + .bitmap = &flow_actions + }, + { + .str = "set-meta", + .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_SET_META), + .bitmap = &flow_actions + }, + { + .str = "set-tag", + .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_SET_TAG), + .bitmap = &flow_actions + }, + { + .str = "drop", + .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_DROP), + .bitmap = &flow_actions + } + }; + + static const struct option lgopts[] = { /* Control */ { "help", 0, 0, 0 }, + { "flows-count", 1, 0, 0 }, + { "dump-iterations", 0, 0, 0 }, + /* Attributes */ + { "ingress", 0, 0, 0 }, + { "egress", 0, 0, 0 }, + { "transfer", 0, 0, 0 }, + { "group", 1, 0, 0 }, + /* Items */ + { "ether", 0, 0, 0 }, + { "vlan", 0, 0, 0 }, + { "ipv4", 0, 0, 0 }, + { "ipv6", 0, 0, 0 }, + { "tcp", 0, 0, 0 }, + { "udp", 0, 0, 0 }, + { "vxlan", 0, 0, 0 }, + { "vxlan-gpe", 0, 0, 0 }, + { "gre", 0, 0, 0 }, + { "geneve", 0, 0, 0 }, + { "gtp", 0, 0, 0 }, + { "meta", 0, 0, 0 }, + { "tag", 0, 0, 0 }, + /* Actions */ + { "port-id", 0, 0, 0 }, + { "rss", 0, 0, 0 }, + { "queue", 0, 0, 0 }, + { "jump", 0, 0, 0 }, + { "mark", 0, 0, 0 }, + { "count", 0, 0, 0 }, + { "set-meta", 0, 0, 0 }, + { "set-tag", 0, 0, 0 }, + { "drop", 0, 0, 0 }, + { "hairpin-queue", 1, 0, 0 }, + { "hairpin-rss", 1, 0, 0 }, }; + flow_items = 0; + flow_actions = 0; + flow_attrs = 0; + hairpinq = 0; argvopt = argv; + printf(":: Flow -> "); while ((opt = getopt_long(argc, argvopt, "", lgopts, &opt_idx)) != EOF) { switch (opt) { @@ -65,6 +294,65 @@ args_parse(int argc, char **argv) usage(argv[0]); rte_exit(EXIT_SUCCESS, "Displayed help\n"); } + + if (strcmp(lgopts[opt_idx].name, "group") == 0) { + n = atoi(optarg); + if (n >= 0) + flow_group = n; + else + rte_exit(EXIT_SUCCESS, + "flow group should be >= 0\n"); + printf("group %d ", flow_group); + } + + for (i = 0; i < RTE_DIM(flow_options); i++) + if (strcmp(lgopts[opt_idx].name, + flow_options[i].str) == 0) { + *flow_options[i].bitmap |= + flow_options[i].mask; + printf("%s / ", flow_options[i].str); + } + + if (strcmp(lgopts[opt_idx].name, + "hairpin-rss") == 0) { + n = atoi(optarg); + if (n > 0) + hairpinq = n; + else + rte_exit(EXIT_SUCCESS, + "Hairpin queues should be > 0\n"); + + flow_actions |= HAIRPIN_RSS_ACTION; + printf("hairpin-rss / "); + } + if (strcmp(lgopts[opt_idx].name, + "hairpin-queue") == 0) { + n = atoi(optarg); + if (n > 0) + hairpinq = n; + else + rte_exit(EXIT_SUCCESS, + "Hairpin queues should be > 0\n"); + + flow_actions |= HAIRPIN_QUEUE_ACTION; + printf("hairpin-queue / "); + } + + /* Control */ + if (strcmp(lgopts[opt_idx].name, + "flows-count") == 0) { + n = atoi(optarg); + if (n > (int) iterations_number) + flows_count = n; + else { + printf("\n\nflows_count should be > %d\n", + iterations_number); + rte_exit(EXIT_SUCCESS, " "); + } + } + if (strcmp(lgopts[opt_idx].name, + "dump-iterations") == 0) + dump_iterations = true; break; default: fprintf(stderr, "Invalid option: %s\n", argv[optind]); @@ -73,6 +361,123 @@ args_parse(int argc, char **argv) break; } } + printf("end_flow\n"); +} + +static void +print_flow_error(struct rte_flow_error error) +{ + printf("Flow can't be created %d message: %s\n", + error.type, + error.message ? error.message : "(no stated reason)"); +} + +static inline void +flows_handler(void) +{ + struct rte_flow_error error; + clock_t start_iter, end_iter; + double cpu_time_used; + double flows_rate; + double cpu_time_per_iter[MAX_ITERATIONS]; + double delta; + uint16_t nr_ports; + uint32_t i; + int port_id; + int iter_id; + + nr_ports = rte_eth_dev_count_avail(); + + for (i = 0; i < MAX_ITERATIONS; i++) + cpu_time_per_iter[i] = -1; + + if (iterations_number > flows_count) + iterations_number = flows_count; + + printf(":: Flows Count per port: %d\n", flows_count); + + for (port_id = 0; port_id < nr_ports; port_id++) { + cpu_time_used = 0; + if (flow_group > 0) { + /* + * Create global rule to jump into flow_group, + * this way the app will avoid the default rules. + * + * Golbal rule: + * group 0 eth / end actions jump group + * + */ + flow = generate_flow(port_id, 0, flow_attrs, + FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_ETH), + FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_JUMP), + flow_group, 0, 0, &error); + + if (flow == NULL) { + print_flow_error(error); + rte_exit(EXIT_FAILURE, "error in creating flow"); + } + } + + /* Insertion Rate */ + printf("Flows insertion on port = %d\n", port_id); + start_iter = clock(); + for (i = 0; i < flows_count; i++) { + flow = generate_flow(port_id, flow_group, + flow_attrs, flow_items, flow_actions, + JUMP_ACTION_TABLE, i, hairpinq, &error); + + if (force_quit) + i = flows_count; + + if (!flow) { + print_flow_error(error); + rte_exit(EXIT_FAILURE, "error in creating flow"); + } + + if (i && !((i + 1) % iterations_number)) { + /* Save the insertion rate of each iter */ + end_iter = clock(); + delta = (double) (end_iter - start_iter); + iter_id = ((i + 1) / iterations_number) - 1; + cpu_time_per_iter[iter_id] = + delta / CLOCKS_PER_SEC; + cpu_time_used += cpu_time_per_iter[iter_id]; + start_iter = clock(); + } + } + + /* Iteration rate per iteration */ + if (dump_iterations) + for (i = 0; i < MAX_ITERATIONS; i++) { + if (cpu_time_per_iter[i] == -1) + continue; + delta = (double)(iterations_number / + cpu_time_per_iter[i]); + flows_rate = delta / 1000; + printf(":: Iteration #%d: %d flows " + "in %f sec[ Rate = %f K/Sec ]\n", + i, iterations_number, + cpu_time_per_iter[i], flows_rate); + } + + /* Insertion rate for all flows */ + flows_rate = ((double) (flows_count / cpu_time_used) / 1000); + printf("\n:: Total flow insertion rate -> %f K/Sec\n", + flows_rate); + printf(":: The time for creating %d in flows %f seconds\n", + flows_count, cpu_time_used); + } +} + +static void +signal_handler(int signum) +{ + if (signum == SIGINT || signum == SIGTERM) { + printf("\n\nSignal %d received, preparing to exit...\n", + signum); + printf("Error: Stats are wrong due to sudden signal!\n\n"); + force_quit = true; + } } static void @@ -80,8 +485,13 @@ init_port(void) { int ret; uint16_t std_queue; + uint16_t hairpin_q; uint16_t port_id; uint16_t nr_ports; + uint16_t nr_queues; + struct rte_eth_hairpin_conf hairpin_conf = { + .peer_count = 1, + }; struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf.rss_hf = @@ -92,6 +502,10 @@ init_port(void) struct rte_eth_rxconf rxq_conf; struct rte_eth_dev_info dev_info; + nr_queues = RXQ_NUM; + if (hairpinq != 0) + nr_queues = RXQ_NUM + hairpinq; + nr_ports = rte_eth_dev_count_avail(); if (nr_ports == 0) rte_exit(EXIT_FAILURE, "Error: no port detected\n"); @@ -116,8 +530,8 @@ init_port(void) printf(":: initializing port: %d\n", port_id); - ret = rte_eth_dev_configure(port_id, RXQ_NUM, - TXQ_NUM, &port_conf); + ret = rte_eth_dev_configure(port_id, nr_queues, + nr_queues, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, ":: cannot configure device: err=%d, port=%u\n", @@ -153,6 +567,38 @@ init_port(void) ":: promiscuous mode enable failed: err=%s, port=%u\n", rte_strerror(-ret), port_id); + if (hairpinq != 0) { + for (hairpin_q = RXQ_NUM, std_queue = 0; + std_queue < nr_queues; + hairpin_q++, std_queue++) { + hairpin_conf.peers[0].port = port_id; + hairpin_conf.peers[0].queue = + std_queue + TXQ_NUM; + ret = rte_eth_rx_hairpin_queue_setup( + port_id, hairpin_q, + NR_RXD, &hairpin_conf); + if (ret != 0) + rte_exit(EXIT_FAILURE, + ":: Hairpin rx queue setup failed: err=%d, port=%u\n", + ret, port_id); + } + + for (hairpin_q = TXQ_NUM, std_queue = 0; + std_queue < nr_queues; + hairpin_q++, std_queue++) { + hairpin_conf.peers[0].port = port_id; + hairpin_conf.peers[0].queue = + std_queue + RXQ_NUM; + ret = rte_eth_tx_hairpin_queue_setup( + port_id, hairpin_q, + NR_TXD, &hairpin_conf); + if (ret != 0) + rte_exit(EXIT_FAILURE, + ":: Hairpin tx queue setup failed: err=%d, port=%u\n", + ret, port_id); + } + } + ret = rte_eth_dev_start(port_id); if (ret < 0) rte_exit(EXIT_FAILURE, @@ -174,6 +620,15 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "EAL init failed\n"); + force_quit = false; + dump_iterations = false; + flows_count = DEFAULT_RULES_COUNT; + iterations_number = DEFAULT_ITERATION; + flow_group = 0; + + signal(SIGINT, signal_handler); + signal(SIGTERM, signal_handler); + argc -= ret; argv += ret; if (argc > 1) @@ -185,6 +640,8 @@ main(int argc, char **argv) if (nb_lcores <= 1) rte_exit(EXIT_FAILURE, "This app needs at least two cores\n"); + flows_handler(); + RTE_ETH_FOREACH_DEV(port) { rte_flow_flush(port, &error); rte_eth_dev_stop(port); diff --git a/app/test-flow-perf/meson.build b/app/test-flow-perf/meson.build index 25711378f..6eaf83b41 100644 --- a/app/test-flow-perf/meson.build +++ b/app/test-flow-perf/meson.build @@ -2,6 +2,9 @@ # Copyright(c) 2020 Mellanox Technologies, Ltd sources = files( + 'actions_gen.c', + 'flow_gen.c', + 'items_gen.c', 'main.c', ) diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst index 8ab5b4a34..22dfc6806 100644 --- a/doc/guides/rel_notes/release_20_08.rst +++ b/doc/guides/rel_notes/release_20_08.rst @@ -60,6 +60,9 @@ New Features Add new application to test rte_flow performance. + Application features: + * Measure rte_flow insertion rate. + Removed Items ------------- diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst index 49eb450ae..6634c3454 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -1,10 +1,30 @@ .. SPDX-License-Identifier: BSD-3-Clause Copyright 2020 Mellanox Technologies, Ltd -Flow performance tool +Flow Performance Tool ===================== Application for rte_flow performance testing. +The application provide the ability to test insertion rate of specific +rte_flow rule, by stressing it to the NIC, and calculate the insertion +rate. + +The application offers some options in the command line, to configure +which rule to apply. + +After that the application will start producing rules with same pattern +but increasing the outer IP source address by 1 each time, thus it will +give different flow each time, and all other items will have open masks. + + +Known Limitations +================= + +The current version has limitations which can be removed in future: + +* Support outer items up to tunnel layer only. +* Single core insertion only. +* Only one instance of same action can be added in one rule. Compiling the Application @@ -27,7 +47,7 @@ or :doc:`EAL parameters (FreeBSD) <../freebsd_gsg/freebsd_eal_parameters>` for a list of available EAL command-line options. -Flow performance Options +Flow Performance Options ------------------------ The following are the command-line options for the flow performance application. @@ -36,9 +56,179 @@ with a ``--`` separator: .. code-block:: console - sudo ./dpdk-test-flow-perf -n 4 -w 08:00.0 -- + sudo ./dpdk-test-flow_perf -n 4 -w 08:00.0 -- --ingress --ether --ipv4 --queue --flows-count=1000000 The command line options are: * ``--help`` Display a help message and quit. + +* ``--flows-count=N`` + Set the number of needed flows to insert, + where 1 <= N <= "number of flows". + The default value is 4,000,000. + +* ``--dump-iterations`` + Print rates for each iteration of flows. + Default iteration is 1,00,000. + + +Attributes: + +* ``--ingress`` + Set Ingress attribute to all flows attributes. + +* ``--egress`` + Set Egress attribute to all flows attributes. + +* ``--transfer`` + Set Transfer attribute to all flows attributes. + +* ``--group=N`` + Set group for all flows, where N >= 0. + Default group is 0. + +Items: + +* ``--ether`` + Add Ether item to all flows items, This item have open mask. + +* ``--vlan`` + Add VLAN item to all flows items, + This item have VLAN value defined in user_parameters.h + under ``VNI_VALUE`` with full mask, default value = 1. + Other fields are open mask. + +* ``--ipv4`` + Add IPv4 item to all flows items, + This item have incremental source IP, with full mask. + Other fields are open mask. + +* ``--ipv6`` + Add IPv6 item to all flows item, + This item have incremental source IP, with full mask. + Other fields are open mask. + +* ``--tcp`` + Add TCP item to all flows items, This item have open mask. + +* ``--udp`` + Add UDP item to all flows items, This item have open mask. + +* ``--vxlan`` + Add VXLAN item to all flows items, + This item have VNI value defined in user_parameters.h + under ``VNI_VALUE`` with full mask, default value = 1. + Other fields are open mask. + +* ``--vxlan-gpe`` + Add VXLAN-GPE item to all flows items, + This item have VNI value defined in user_parameters.h + under ``VNI_VALUE`` with full mask, default value = 1. + Other fields are open mask. + +* ``--gre`` + Add GRE item to all flows items, + This item have protocol value defined in user_parameters.h + under ``GRE_PROTO`` with full mask, default protocol = 0x6558 "Ether" + Other fields are open mask. + +* ``--geneve`` + Add GENEVE item to all flows items, + This item have VNI value defined in user_parameters.h + under ``VNI_VALUE`` with full mask, default value = 1. + Other fields are open mask. + +* ``--gtp`` + Add GTP item to all flows items, + This item have TEID value defined in user_parameters.h + under ``TEID_VALUE`` with full mask, default value = 1. + Other fields are open mask. + +* ``--meta`` + Add Meta item to all flows items, + This item have data value defined in user_parameters.h + under ``META_DATA`` with full mask, default value = 1. + Other fields are open mask. + +* ``--tag`` + Add Tag item to all flows items, + This item have data value defined in user_parameters.h + under ``META_DATA`` with full mask, default value = 1. + + Also it have tag value defined in user_parameters.h + under ``TAG_INDEX`` with full mask, default value = 0. + Other fields are open mask. + + +Actions: + +* ``--port-id`` + Add port redirection action to all flows actions. + Port redirection destination is defined in user_parameters.h + under PORT_ID_DST, default value = 1. + +* ``--rss`` + Add RSS action to all flows actions, + The queues in RSS action will be all queues configured + in the app. + +* ``--queue`` + Add queue action to all flows items, + The queue will change in round robin state for each flow. + + For example: + The app running with 4 RX queues + Flow #0: queue index 0 + Flow #1: queue index 1 + Flow #2: queue index 2 + Flow #3: queue index 3 + Flow #4: queue index 0 + ... + +* ``--jump`` + Add jump action to all flows actions. + Jump action destination is defined in user_parameters.h + under ``JUMP_ACTION_TABLE``, default value = 2. + +* ``--mark`` + Add mark action to all flows actions. + Mark action id is defined in user_parameters.h + under ``MARK_ID``, default value = 1. + +* ``--count`` + Add count action to all flows actions. + +* ``--set-meta`` + Add set-meta action to all flows actions. + Meta data is defined in user_parameters.h under ``META_DATA`` + with full mask, default value = 1. + +* ``--set-tag`` + Add set-tag action to all flows actions. + Meta data is defined in user_parameters.h under ``META_DATA`` + with full mask, default value = 1. + + Tag index is defined in user_parameters.h under ``TAG_INDEX`` + with full mask, default value = 0. + +* ``--drop`` + Add drop action to all flows actions. + +* ``--hairpin-queue=N`` + Add hairpin queue action to all flows actions. + The queue will change in round robin state for each flow. + + For example: + The app running with 4 RX hairpin queues and 4 normal RX queues + Flow #0: queue index 4 + Flow #1: queue index 5 + Flow #2: queue index 6 + Flow #3: queue index 7 + Flow #4: queue index 4 + ... + +* ``--hairpin-rss=N`` + Add hairpin RSS action to all flows actions. + The queues in RSS action will be all hairpin queues configured + in the app. From patchwork Thu Jun 4 13:35:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wisam Jaddo X-Patchwork-Id: 70854 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9554AA00C4; Thu, 4 Jun 2020 15:35:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 32C101D5F7; Thu, 4 Jun 2020 15:35:29 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2080.outbound.protection.outlook.com [40.107.20.80]) by dpdk.org (Postfix) with ESMTP id EA9D81D5F5 for ; Thu, 4 Jun 2020 15:35:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Uqis970+IV88J0RqItUteKTaI3vdfMN/WrGFF8frpndP+ioWpwMUFwszwT44AaOKEtDjsDsapu4H8K+LaQ0ubiE5T6mPW6FWcnZpKHpE8St+IW2T7GmBpyjzjSg/OaFg76f23E0XSLW+wXOI7B6TKdn3DS4sxTBb3siwQY27BzqM0gt2cKGygkr+K6bH5GWZxDDc+TQ8792O/IY0M7jfnkHl6odXtSuMSsr6eSGoBGiebJvSptzDVWAgTQE1mNSFPivfcAGvYCG50ruMwCS0zMcvYpaCsBULHsOzCMU/XLOTH/J25ZzNxJ8kwK7aUx1BZ+7c2Mdd6K6nLf+RgQN19g== 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-SenderADCheck; bh=QqhkntZPGrb+/1hPLH7jvGgmBvh72PJDBBDAB2B2DGs=; b=EuqYsM+2wZKW+YvmddKbhDWkYmW+pjhB1bDWgz+BOxioI7bg4sVEp2N4b+y2bd5kBMzaz2AYkIZhmRUT0rccFELX1KU3aPjBpz9qnIS7VsuGefHcNV34gUIv5ObTCFSLY6RkiQPUnplBFVBOvQLQRkTNUfOOgDPQTU1DaKIcR0mR95dz5lt6cys7eYWLGMEK51ucyCTnLjvRvS2k7QQbIQ81/9wRO2utVw8L8SnHJqA82ribpmE2FknCBHQUw2md1+6AS2XxMPu6g6LSIkPwO1zn5XKiDI3mMyTNqrsiTj0Ack2O5DMDWX3yEbLvgTNtmKoUBqS3mOA0VnwQBLIJEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QqhkntZPGrb+/1hPLH7jvGgmBvh72PJDBBDAB2B2DGs=; b=qVhYOKsV2DR/39eRfwh8V6oVCIN2ocxAa8PJ4/4k3azKS/vBJlh2w1wzUZPmZEQxh8K7tZecAustvz/kTchY1FvnAj3Q3e5oihA6kwS2mmVVe1fB0sAllgcmPY24JVeFRRD0c/SSTD3D9U4AxkZLH1OVTzEqa5y8951loF94SwU= Authentication-Results: solarflare.com; dkim=none (message not signed) header.d=none;solarflare.com; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR05MB4577.eurprd05.prod.outlook.com (2603:10a6:208:b7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.25; Thu, 4 Jun 2020 13:35:25 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc%6]) with mapi id 15.20.3045.024; Thu, 4 Jun 2020 13:35:25 +0000 From: Wisam Jaddo To: arybchenko@solarflare.com, jackmin@mellanox.com, thomas@monjalon.net, jerinjacobk@gmail.com, ajit.khaparde@broadcom.com Cc: dev@dpdk.org Date: Thu, 4 Jun 2020 13:35:00 +0000 Message-Id: <20200604133502.28491-4-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200604133502.28491-1-wisamm@mellanox.com> References: <20200511110811.11474-2-wisamm@mellanox.com> <20200604133502.28491-1-wisamm@mellanox.com> X-ClientProxiedBy: AM0PR01CA0117.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::22) To AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM0PR01CA0117.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Thu, 4 Jun 2020 13:35:23 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e57393b7-c312-4234-ec40-08d8088c22c5 X-MS-TrafficTypeDiagnostic: AM0PR05MB4577: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1388; X-Forefront-PRVS: 04244E0DC5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ym1Z9swESnWECAJy+NeVUmKSsxfhi34w9PH9zLdBR6Rw21N0Uhlp2fUR3VYrdrtUUK0ZOk3VLAj3kYsnd5Z1Pt6p5VxI9FVJLA6nIhaGZpJHjIh1nfTTu1DUndyVHZ+QwGgXPrsM2G12UFk73+WipkuozHLSBrmQlou8Yvk79EtgIH6I1HIen86irVhvXrV7NeungwwOM7wLXoV4f497g5SmNJUjl/2wgdIS7UXuv5dtNtZtPCAeNQdUQ7nQVXnnNT0qD8N9ULkoudUshXidha8xTYYdy7ThqN2BVvn52/NW2hkIJVuyBsNB+LfKZ3eta+QinhpXTmXv9Gts95nvPw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6610.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(396003)(376002)(346002)(366004)(39860400002)(1076003)(316002)(4326008)(2906002)(26005)(956004)(52116002)(2616005)(66556008)(55016002)(66946007)(86362001)(36756003)(8936002)(7696005)(83380400001)(6666004)(8886007)(186003)(5660300002)(8676002)(478600001)(16526019)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Ht1u/yX15EaYPTEw9TZyhYHPxu2yis074FrNnNpOA4I5bYarUYfecgZzv+vXXkCw+d8PKT2ZjeH0NHD9YyJUdxkXtXonbjxpe+rGLh3Ei6yC7r12dAYMwX6VrT+J6Gn/D0w43hndubAsNttbt5LBmjIwsN2m0pwQ6SUAXjYUoPQarsewc4zJOPzYOdpNCNJcFchtUxKGzOFAGTxgaUMg3hvZD5LN+lphqnuXnUg5zB1KWy2B9A8mJzJ9CE1OjVXc72OWe+R2yIWH6lPgG3xLYV0qXXVMnjZil5MpzmDiw/lmK2YLbPHkSFjisjp7QpEhSA9txjB5OpYEMxqdUu30ABv0GNlx3eg7Rtvg/m3rn/9ga7ny3VKW1ZePtJvmuGq6/k3khAhGz9WtYzmsLf3b/dF30FoNyUpAOnIVYXarxJy6g0mPBIhq8PljfGP9+QFTaCeJe8zpNAt5XFmYX+1FDTy5V3F0eQSsGE+sEg3DsTA= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e57393b7-c312-4234-ec40-08d8088c22c5 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2020 13:35:25.0382 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QTO4YF1ts6+jxR6K5w8wa8szsUtJhCh3hniYi2tOVkix6oNxeRo41zzpZKUaGe6WJ0OxFXLhn96WkMFW6XHV9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4577 Subject: [dpdk-dev] [PATCH v7 3/5] app/flow-perf: add deletion rate calculation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Add the ability to test deletion rate for flow performance application. This feature is disabled by default, and can be enabled by add "--deletion-rate" in the application command line options. Signed-off-by: Wisam Jaddo Acked-by: Xiaoyu Min --- app/test-flow-perf/main.c | 87 ++++++++++++++++++++++++++ doc/guides/rel_notes/release_20_08.rst | 1 + doc/guides/tools/flow-perf.rst | 4 ++ 3 files changed, 92 insertions(+) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 5bff48d32..bb7c3f6b5 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -49,6 +49,7 @@ static uint64_t flow_actions; static uint64_t flow_attrs; static volatile bool force_quit; static bool dump_iterations; +static bool delete_flag; static struct rte_mempool *mbuf_mp; static uint32_t nb_lcores; static uint32_t flows_count; @@ -64,6 +65,8 @@ usage(char *progname) " flows to insert, default is 4,000,000\n"); printf(" --dump-iterations: To print rates for each" " iteration\n"); + printf(" --deletion-rate: Enable deletion rate" + " calculations\n"); printf("To set flow attributes:\n"); printf(" --ingress: set ingress attribute in flows\n"); @@ -246,6 +249,7 @@ args_parse(int argc, char **argv) { "help", 0, 0, 0 }, { "flows-count", 1, 0, 0 }, { "dump-iterations", 0, 0, 0 }, + { "deletion-rate", 0, 0, 0 }, /* Attributes */ { "ingress", 0, 0, 0 }, { "egress", 0, 0, 0 }, @@ -353,6 +357,9 @@ args_parse(int argc, char **argv) if (strcmp(lgopts[opt_idx].name, "dump-iterations") == 0) dump_iterations = true; + if (strcmp(lgopts[opt_idx].name, + "deletion-rate") == 0) + delete_flag = true; break; default: fprintf(stderr, "Invalid option: %s\n", argv[optind]); @@ -372,9 +379,75 @@ print_flow_error(struct rte_flow_error error) error.message ? error.message : "(no stated reason)"); } +static inline void +destroy_flows(int port_id, struct rte_flow **flow_list) +{ + struct rte_flow_error error; + clock_t start_iter, end_iter; + double cpu_time_used = 0; + double flows_rate; + double cpu_time_per_iter[MAX_ITERATIONS]; + double delta; + uint32_t i; + int iter_id; + + for (i = 0; i < MAX_ITERATIONS; i++) + cpu_time_per_iter[i] = -1; + + if (iterations_number > flows_count) + iterations_number = flows_count; + + /* Deletion Rate */ + printf("Flows Deletion on port = %d\n", port_id); + start_iter = clock(); + for (i = 0; i < flows_count; i++) { + if (flow_list[i] == 0) + break; + + memset(&error, 0x33, sizeof(error)); + if (rte_flow_destroy(port_id, flow_list[i], &error)) { + print_flow_error(error); + rte_exit(EXIT_FAILURE, "Error in deleting flow"); + } + + if (i && !((i + 1) % iterations_number)) { + /* Save the deletion rate of each iter */ + end_iter = clock(); + delta = (double) (end_iter - start_iter); + iter_id = ((i + 1) / iterations_number) - 1; + cpu_time_per_iter[iter_id] = + delta / CLOCKS_PER_SEC; + cpu_time_used += cpu_time_per_iter[iter_id]; + start_iter = clock(); + } + } + + /* Deletion rate per iteration */ + if (dump_iterations) + for (i = 0; i < MAX_ITERATIONS; i++) { + if (cpu_time_per_iter[i] == -1) + continue; + delta = (double)(iterations_number / + cpu_time_per_iter[i]); + flows_rate = delta / 1000; + printf(":: Iteration #%d: %d flows " + "in %f sec[ Rate = %f K/Sec ]\n", + i, iterations_number, + cpu_time_per_iter[i], flows_rate); + } + + /* Deletion rate for all flows */ + flows_rate = ((double) (flows_count / cpu_time_used) / 1000); + printf("\n:: Total flow deletion rate -> %f K/Sec\n", + flows_rate); + printf(":: The time for deleting %d in flows %f seconds\n", + flows_count, cpu_time_used); +} + static inline void flows_handler(void) { + struct rte_flow **flow_list; struct rte_flow_error error; clock_t start_iter, end_iter; double cpu_time_used; @@ -385,6 +458,7 @@ flows_handler(void) uint32_t i; int port_id; int iter_id; + uint32_t flow_index; nr_ports = rte_eth_dev_count_avail(); @@ -396,8 +470,14 @@ flows_handler(void) printf(":: Flows Count per port: %d\n", flows_count); + flow_list = rte_zmalloc("flow_list", + (sizeof(struct rte_flow *) * flows_count) + 1, 0); + if (flow_list == NULL) + rte_exit(EXIT_FAILURE, "No Memory available!"); + for (port_id = 0; port_id < nr_ports; port_id++) { cpu_time_used = 0; + flow_index = 0; if (flow_group > 0) { /* * Create global rule to jump into flow_group, @@ -416,6 +496,7 @@ flows_handler(void) print_flow_error(error); rte_exit(EXIT_FAILURE, "error in creating flow"); } + flow_list[flow_index++] = flow; } /* Insertion Rate */ @@ -434,6 +515,8 @@ flows_handler(void) rte_exit(EXIT_FAILURE, "error in creating flow"); } + flow_list[flow_index++] = flow; + if (i && !((i + 1) % iterations_number)) { /* Save the insertion rate of each iter */ end_iter = clock(); @@ -466,6 +549,9 @@ flows_handler(void) flows_rate); printf(":: The time for creating %d in flows %f seconds\n", flows_count, cpu_time_used); + + if (delete_flag) + destroy_flows(port_id, flow_list); } } @@ -624,6 +710,7 @@ main(int argc, char **argv) dump_iterations = false; flows_count = DEFAULT_RULES_COUNT; iterations_number = DEFAULT_ITERATION; + delete_flag = false; flow_group = 0; signal(SIGINT, signal_handler); diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst index 22dfc6806..05bef91c3 100644 --- a/doc/guides/rel_notes/release_20_08.rst +++ b/doc/guides/rel_notes/release_20_08.rst @@ -62,6 +62,7 @@ New Features Application features: * Measure rte_flow insertion rate. + * Measure rte_flow deletion rate. Removed Items diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst index 6634c3454..79a3013d5 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -26,6 +26,8 @@ The current version has limitations which can be removed in future: * Single core insertion only. * Only one instance of same action can be added in one rule. +The application also provide the ability to measure rte flow deletion rate. + Compiling the Application ========================= @@ -72,6 +74,8 @@ The command line options are: Print rates for each iteration of flows. Default iteration is 1,00,000. +* ``--deletion-rate`` + Enable deletion rate calculations. Attributes: From patchwork Thu Jun 4 13:35:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wisam Jaddo X-Patchwork-Id: 70855 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0A165A00C4; Thu, 4 Jun 2020 15:36:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 508BA1D613; Thu, 4 Jun 2020 15:35:30 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2080.outbound.protection.outlook.com [40.107.20.80]) by dpdk.org (Postfix) with ESMTP id 12E521D5F7 for ; Thu, 4 Jun 2020 15:35:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T77GuQw9dBET80u3ZniPmff1YHW8qlBRCV7vEIyOOiCh5J1P8Z82OZSjVCcYFzzmUERp5Mrj5ck++oPy5VrG+hcWRLnV8eoQAWJFJXhZUNB2Tr95cV11vwDwOrXhzoGZOd+pst8B8xGZYtDr1piEaFhKnVMNp/lccu66PnMFnUWb0J0+wyYM1XQJvXse9QsuziaLVvlFfP91Aoe1IIDBxoDBzogHyKS8UUId2t6Z8W2tqhEIFDHK+b3JUzI5qsOCiLHNjjdMFTvTY1GOGI3iWhs6i5mLu0jmTlzx801FUqttIPxU6RI7av6bzJONG5sV+Cu3XyYPGtJteteUNInjCA== 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-SenderADCheck; bh=kyttfv4xhYqVKrftPpMa39dHv/1GcUWdIKVEm1p/OY0=; b=MJcEqHsFID0x0UBDeHP93LzdDMBmkctc/53o3RTtex5GK1gMiFio+3QFbNbv7N4BEj6eKaibZbXO3W79ueOwsdkiJauPJyaZpJqfoadL9RU/AOMD+ZqVJqrjxep6ODpNt+t2LqN8pcD1s0T9oYT4gCu49eMqGVLgHrbReWmJpv2Z8AYy2Xffc6w3DeqoskT5O595VPhb5GOekGoIrD0CCSh546oOBYWgKbrLm1afaUfjUx1N3guWhFB7FroADU6afdDLbczMLAJ9qV4iBFz6XHy9Paw6s5ru4A9k84LgQZ3EoED84ijkoM0cYm6j7z+VSsMDYGPitBGZjMsAcyZGbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kyttfv4xhYqVKrftPpMa39dHv/1GcUWdIKVEm1p/OY0=; b=qKRyje+yPFg4JuCubAVgJGuRkekt/d7XY8z3QwQgnUyN/AfLzUbLRj6jiWw5keSqsJbn268K4Gp/JFbupK/2FeE5NqtlZJ9C2+5lf0B+OruLM0nmkx/EOxW44fc8U3D3/AKNQEYcdYcNmvWDD0sbL68avlRYAmWkHe61kSkQ3Aw= Authentication-Results: solarflare.com; dkim=none (message not signed) header.d=none;solarflare.com; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR05MB4577.eurprd05.prod.outlook.com (2603:10a6:208:b7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.25; Thu, 4 Jun 2020 13:35:26 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc%6]) with mapi id 15.20.3045.024; Thu, 4 Jun 2020 13:35:26 +0000 From: Wisam Jaddo To: arybchenko@solarflare.com, jackmin@mellanox.com, thomas@monjalon.net, jerinjacobk@gmail.com, ajit.khaparde@broadcom.com Cc: dev@dpdk.org, Suanming Mou Date: Thu, 4 Jun 2020 13:35:01 +0000 Message-Id: <20200604133502.28491-5-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200604133502.28491-1-wisamm@mellanox.com> References: <20200511110811.11474-2-wisamm@mellanox.com> <20200604133502.28491-1-wisamm@mellanox.com> X-ClientProxiedBy: AM0PR01CA0117.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::22) To AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM0PR01CA0117.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Thu, 4 Jun 2020 13:35:25 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 65de1608-e726-42e9-37da-08d8088c23a1 X-MS-TrafficTypeDiagnostic: AM0PR05MB4577: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-Forefront-PRVS: 04244E0DC5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R49vyAjZwXFZEbSCrHpN4ZNu5+pK/w0VZPC63E2gCWYvXnMhdPe5NgZ3Yx5qrCqu+Ih3vAfMNCTltpvQkbdbbnMX71F343ntBdOaE5/tta/DVW8ZXarLtFPAKJIBl5gruBTWyLviwk6clOSjTb3MDCYMi22YmjgLYLxEKXiedlueAREj9SUSZomTrUwmFclMlk+jHqj+Jc0uxlycvII4c0S+hKfHRnXLZPkj1Kz1+taBZgaZVZMODJCAOkUM8D5/iXkYvGQuaoJKPJfiogq7Wkr3oyueT5766NO9uflSYgKmJaQJ11o/UN/4Qz4ElcAw X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6610.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(396003)(376002)(346002)(366004)(39860400002)(1076003)(316002)(107886003)(4326008)(2906002)(26005)(956004)(52116002)(2616005)(66556008)(55016002)(66946007)(86362001)(36756003)(8936002)(7696005)(83380400001)(6666004)(8886007)(186003)(5660300002)(8676002)(478600001)(16526019)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: /pepZ1axBKNoH5DH/PbprB81M4FD6/vNyJ4VM63F+q37MDyUv31k0qNaIJk7+WRpD0tEdRqLp/r2NHuYulagvmpeL/Ms0ecte4Xcp/Bft9LxRpZWTB4UqPG6Bh9s5OBxiw7NvZLSNG7NYrN8G5dHYLaYZY1k/NBc30d8F/EDdhiodJyCdcj1zFplhZ+Y+zmxnBg2mxprOh2ZaForlQhec7HS9GrhZ/A+hWJ9hNUX0YHjtZErZm/zmc2yL0QRVVOcFZZ32b71rtp0TwdkQx1wDhgT8IIm65BRUqkeowvMNFOXzZOzn92JZ6b9OYs/9b4bSEzPHVyI/jmjZmS9AaFZ6zNmm+hn17+OEDmekSOW/BQaxGqclH6k7G7e5EVd9vvt7vQFoXwrL/VBrQeS2qyGZsjL+8i0lRISWgU1hSp2ZrAa8WQHmib487qKURzu21HK+lmmJrDqJBr9uRikgWLxE/AU5XluKKugAkHGeTZMYvc= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65de1608-e726-42e9-37da-08d8088c23a1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2020 13:35:26.1985 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qeq7JBta/ibv+WiNyn0AdVi8z9pgPi3/91gZLdoHAi56dEErzrJDn5lNGPHIXVcwIWesxwCf+GZVfQHRIBOqKw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4577 Subject: [dpdk-dev] [PATCH v7 4/5] app/flow-perf: add memory dump to app X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Introduce new feature to dump memory statistics of each socket and a total for all before and after the creation. This will give two main advantage: 1- Check the memory consumption for large number of flows "insertion rate scenario alone" 2- Check that no memory leackage after doing insertion then deletion. Signed-off-by: Suanming Mou Signed-off-by: Wisam Jaddo Acked-by: Xiaoyu Min --- app/test-flow-perf/main.c | 72 +++++++++++++++++++++++++- doc/guides/rel_notes/release_20_08.rst | 1 + doc/guides/tools/flow-perf.rst | 6 ++- 3 files changed, 77 insertions(+), 2 deletions(-) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index bb7c3f6b5..e458f4853 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -49,7 +49,8 @@ static uint64_t flow_actions; static uint64_t flow_attrs; static volatile bool force_quit; static bool dump_iterations; -static bool delete_flag; +static bool delete_flag; +static bool dump_socket_mem_flag; static struct rte_mempool *mbuf_mp; static uint32_t nb_lcores; static uint32_t flows_count; @@ -67,6 +68,7 @@ usage(char *progname) " iteration\n"); printf(" --deletion-rate: Enable deletion rate" " calculations\n"); + printf(" --dump-socket-mem: To dump all socket memory\n"); printf("To set flow attributes:\n"); printf(" --ingress: set ingress attribute in flows\n"); @@ -250,6 +252,7 @@ args_parse(int argc, char **argv) { "flows-count", 1, 0, 0 }, { "dump-iterations", 0, 0, 0 }, { "deletion-rate", 0, 0, 0 }, + { "dump-socket-mem", 0, 0, 0 }, /* Attributes */ { "ingress", 0, 0, 0 }, { "egress", 0, 0, 0 }, @@ -360,6 +363,9 @@ args_parse(int argc, char **argv) if (strcmp(lgopts[opt_idx].name, "deletion-rate") == 0) delete_flag = true; + if (strcmp(lgopts[opt_idx].name, + "dump-socket-mem") == 0) + dump_socket_mem_flag = true; break; default: fprintf(stderr, "Invalid option: %s\n", argv[optind]); @@ -371,6 +377,62 @@ args_parse(int argc, char **argv) printf("end_flow\n"); } +/* Dump the socket memory statistics on console */ +static size_t +dump_socket_mem(FILE *f) +{ + struct rte_malloc_socket_stats socket_stats; + unsigned int i = 0; + size_t total = 0; + size_t alloc = 0; + size_t free = 0; + unsigned int n_alloc = 0; + unsigned int n_free = 0; + bool active_nodes = false; + + + for (i = 0; i < RTE_MAX_NUMA_NODES; i++) { + if (rte_malloc_get_socket_stats(i, &socket_stats) || + !socket_stats.heap_totalsz_bytes) + continue; + active_nodes = true; + total += socket_stats.heap_totalsz_bytes; + alloc += socket_stats.heap_allocsz_bytes; + free += socket_stats.heap_freesz_bytes; + n_alloc += socket_stats.alloc_count; + n_free += socket_stats.free_count; + if (dump_socket_mem_flag) { + fprintf(f, "::::::::::::::::::::::::::::::::::::::::"); + fprintf(f, + "\nSocket %u:\nsize(M) total: %.6lf\nalloc:" + " %.6lf(%.3lf%%)\nfree: %.6lf" + "\nmax: %.6lf" + "\ncount alloc: %u\nfree: %u\n", + i, + socket_stats.heap_totalsz_bytes / 1.0e6, + socket_stats.heap_allocsz_bytes / 1.0e6, + (double)socket_stats.heap_allocsz_bytes * 100 / + (double)socket_stats.heap_totalsz_bytes, + socket_stats.heap_freesz_bytes / 1.0e6, + socket_stats.greatest_free_size / 1.0e6, + socket_stats.alloc_count, + socket_stats.free_count); + fprintf(f, "::::::::::::::::::::::::::::::::::::::::"); + } + } + if (dump_socket_mem_flag && active_nodes) { + fprintf(f, + "\nTotal: size(M)\ntotal: %.6lf" + "\nalloc: %.6lf(%.3lf%%)\nfree: %.6lf" + "\ncount alloc: %u\nfree: %u\n", + total / 1.0e6, alloc / 1.0e6, + (double)alloc * 100 / (double)total, free / 1.0e6, + n_alloc, n_free); + fprintf(f, "::::::::::::::::::::::::::::::::::::::::\n"); + } + return alloc; +} + static void print_flow_error(struct rte_flow_error error) { @@ -701,6 +763,7 @@ main(int argc, char **argv) int ret; uint16_t port; struct rte_flow_error error; + int64_t alloc, last_alloc; ret = rte_eal_init(argc, argv); if (ret < 0) @@ -711,6 +774,7 @@ main(int argc, char **argv) flows_count = DEFAULT_RULES_COUNT; iterations_number = DEFAULT_ITERATION; delete_flag = false; + dump_socket_mem_flag = false; flow_group = 0; signal(SIGINT, signal_handler); @@ -727,7 +791,13 @@ main(int argc, char **argv) if (nb_lcores <= 1) rte_exit(EXIT_FAILURE, "This app needs at least two cores\n"); + last_alloc = (int64_t)dump_socket_mem(stdout); flows_handler(); + alloc = (int64_t)dump_socket_mem(stdout); + + if (last_alloc) + fprintf(stdout, ":: Memory allocation change(M): %.6lf\n", + (alloc - last_alloc) / 1.0e6); RTE_ETH_FOREACH_DEV(port) { rte_flow_flush(port, &error); diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst index 05bef91c3..170086d1c 100644 --- a/doc/guides/rel_notes/release_20_08.rst +++ b/doc/guides/rel_notes/release_20_08.rst @@ -63,6 +63,7 @@ New Features Application features: * Measure rte_flow insertion rate. * Measure rte_flow deletion rate. + * Dump rte_flow memory consumption. Removed Items diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst index 79a3013d5..5dbd6eb3b 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -26,7 +26,8 @@ The current version has limitations which can be removed in future: * Single core insertion only. * Only one instance of same action can be added in one rule. -The application also provide the ability to measure rte flow deletion rate. +The application also provide the ability to measure rte flow deletion rate, +in addition to memory consumption before and after the flows creation. Compiling the Application @@ -77,6 +78,9 @@ The command line options are: * ``--deletion-rate`` Enable deletion rate calculations. +* ``--dump-socket-mem`` + Dump the memory stats for each socket before the insertion and after. + Attributes: * ``--ingress`` From patchwork Thu Jun 4 13:35:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wisam Jaddo X-Patchwork-Id: 70856 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 78E26A00C4; Thu, 4 Jun 2020 15:36:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AFD1F1D621; Thu, 4 Jun 2020 15:35:31 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2069.outbound.protection.outlook.com [40.107.20.69]) by dpdk.org (Postfix) with ESMTP id 9CDEA1D60A for ; Thu, 4 Jun 2020 15:35:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ILOWg+oUCC1oPKlWmaMiyIXsL+XoFs0wPOJZIPvMYUHh+HbAeAITYvPQsq7NFmCo3EPGCpLC+WOzgyMfdGcPxd+2A+AQiSnzotYqyh2yoaJ2QPP/BTT++E5XZIu+/wOfOd8pXPMMnAnFJOTjBFzED4YeuI1cN9Oi05BgKUQQ+3WCajNOa2YoUT8zlUZMc+MFEsWIgBg70A1hBHayvPEeRMHX6haKNsu9Y4oJktkBKaHbXEgrj2YyMbGYHzx1ZHrR16kwRId7Omg8i+TYmXP2yVlfAOnCMbjNX1XwG45hvaQstWQ4c9whYcL145lf2lJHbJxrUq66QNGzEe3LSvIZGA== 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-SenderADCheck; bh=9aCK/BBKLLdI0v1gSe1fLN3aqTT6NISSdS0vtHoF//A=; b=hNpUJOOLLr4NDtgdDeOEGJ+JrTgnA8p6FPmzc/OhR5iLLTp76g8VLOojjWolwxW3Zggml/2m3eckh2O2lpt392MY/PFESUgCb8nP6A+dsc9Ydm5bph5fbKYUBLNOCsUDfaMdxdxkKNMeJJkE1FkiWyhkPb+sbGVxaF9WrqN2wvP7kHrLj5ilU98rj3KYo9S84FTd97EHABVSkYhsOvMWEQkpapENBNas9BQqS2pJkRnolwKuS4sgGjea2js6Qud936Rnn4+lDqgbqBShIPj2Nl9U8VP3mrCtNV0hxcUxx5On033yMySWdnTTEsTfzk/JcsXU2+pBlIDx+JN5pN7KWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9aCK/BBKLLdI0v1gSe1fLN3aqTT6NISSdS0vtHoF//A=; b=U/iy6+z5X2N9/k7ugGJGP5v3PGRQBqYshgWZDKbiMUu/iZ3Ao5NMgU35o5vXAI/O1b+ogARJmdmlZWG/6ucmePWu4k3uTgBZhG/qZ0H+s0zKzUzERFmJplm0gqWmj5KVXPJn2atUHubTDf/98QObc8dEWEphE+l0LNV3vsVRiVk= Authentication-Results: solarflare.com; dkim=none (message not signed) header.d=none;solarflare.com; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR05MB4577.eurprd05.prod.outlook.com (2603:10a6:208:b7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.25; Thu, 4 Jun 2020 13:35:27 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::900:c0ac:78bd:18fc%6]) with mapi id 15.20.3045.024; Thu, 4 Jun 2020 13:35:27 +0000 From: Wisam Jaddo To: arybchenko@solarflare.com, jackmin@mellanox.com, thomas@monjalon.net, jerinjacobk@gmail.com, ajit.khaparde@broadcom.com Cc: dev@dpdk.org Date: Thu, 4 Jun 2020 13:35:02 +0000 Message-Id: <20200604133502.28491-6-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200604133502.28491-1-wisamm@mellanox.com> References: <20200511110811.11474-2-wisamm@mellanox.com> <20200604133502.28491-1-wisamm@mellanox.com> X-ClientProxiedBy: AM0PR01CA0117.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::22) To AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mellanox.com (37.142.13.130) by AM0PR01CA0117.eurprd01.prod.exchangelabs.com (2603:10a6:208:168::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3066.18 via Frontend Transport; Thu, 4 Jun 2020 13:35:26 +0000 X-Mailer: git-send-email 2.17.1 X-Originating-IP: [37.142.13.130] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: abcb1bd5-5a60-45aa-e2ca-08d8088c2440 X-MS-TrafficTypeDiagnostic: AM0PR05MB4577: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:295; X-Forefront-PRVS: 04244E0DC5 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KzLSOEWpT/GwapVxFP75kQwGuvDyeW7xk3BxHece1yHU+89RD8cYXoNdSqCx4RqmYnsG6fYgeNulat7JrdxsBFmivJxiXFUPdeWNyJPJw3VzAW7L9WYjZ+PtmKYajB1B4xZNwd5IDsK2p7e1jEsMdqOhQpYkN7pP+qtaz6Lr1lIcDUvTC7DREjhhssiHEeQ8EyL3r0nMZdEI4+Q9erM006uYeW3e+mtlVZq3MFGSEbUNsUe5cjJ0YH8kcSEAZWk1mHLc0vsGjkJWnErNLShJIQQqSi333fdCuYbcOYkdqB0CcxTJwUCQqxDLikwj2zRip/0vj74BGVG3HWPPsEOIUw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6610.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(396003)(376002)(346002)(366004)(39860400002)(1076003)(316002)(4326008)(2906002)(26005)(956004)(52116002)(2616005)(30864003)(66556008)(55016002)(66946007)(86362001)(36756003)(8936002)(7696005)(83380400001)(6666004)(8886007)(186003)(5660300002)(8676002)(478600001)(16526019)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: zz56lOAi5eUp8jirRvkD0JP9URZampeBfsW0HQU2OnfXrTKmV2vHETHtCOU4EphEX/qR4knxV1xDJahlQ1VFSdCT/37QHCb0HLlJJxa5Q2ToKfYgALJihaOZG57DdyJxBapIXxV+HZb9Xd11XZUBH5KPKafY4KzIvu3KJmkRyp7Wce/8NqyY0V7JxvCrXCGb4H6TGwoluDZKXo8L83+lxOdJPhaQVjMqkL1EGSOlgTorBKd9OYFz59faCMo+SPR+7kCgpr8Pi9W1Wmck84nxurgN2taJSTVBCDC+CSnL+fsLD/wzfJKftUWXNadP0b8CjqJ7gtrFUu7Vb86070gpEScLthujQQ5O0RXCiomxXvvFWwGTVN4B9doldHA5Xl5DWDCp7+w4/FFj06xITHxSAwiX5gPDgr6usAPXvdopd7p/7JcQL4BvfLSf0DtE4WbNv8hd1STFepQinEvYdhc2p+KlqdfqrCYMHrSHR+QOe6k= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: abcb1bd5-5a60-45aa-e2ca-08d8088c2440 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2020 13:35:27.3038 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CMBkm6R7e+kbABjBpp6ARM/I/a/IWAGjepU1FoHwxPniy14ep3LickC4YMmg3aPM0vLVe0uAwL0XUhvBKw21DA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4577 Subject: [dpdk-dev] [PATCH v7 5/5] app/flow-perf: add packet forwarding support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Introduce packet forwarding support to the app to do some performance measurements. The measurements are reported in term of packet per second unit. The forwarding will start after the end of insertion/deletion operations. The support has single and multi performance measurements. Signed-off-by: Wisam Jaddo Acked-by: Xiaoyu Min --- app/test-flow-perf/main.c | 301 +++++++++++++++++++++++++ doc/guides/rel_notes/release_20_08.rst | 1 + doc/guides/tools/flow-perf.rst | 6 + 3 files changed, 308 insertions(+) diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index e458f4853..62ea76dd1 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -47,15 +48,45 @@ static uint8_t flow_group; static uint64_t flow_items; static uint64_t flow_actions; static uint64_t flow_attrs; + static volatile bool force_quit; static bool dump_iterations; static bool delete_flag; static bool dump_socket_mem_flag; +static bool enable_fwd; + static struct rte_mempool *mbuf_mp; static uint32_t nb_lcores; static uint32_t flows_count; static uint32_t iterations_number; static uint32_t hairpinq; +static uint32_t nb_lcores; + +#define MAX_PKT_BURST 32 +#define LCORE_MODE_PKT 1 +#define LCORE_MODE_STATS 2 +#define MAX_STREAMS 64 +#define MAX_LCORES 64 + +struct stream { + int tx_port; + int tx_queue; + int rx_port; + int rx_queue; +}; + +struct lcore_info { + int mode; + int streams_nb; + struct stream streams[MAX_STREAMS]; + /* stats */ + uint64_t tx_pkts; + uint64_t tx_drops; + uint64_t rx_pkts; + struct rte_mbuf *pkts[MAX_PKT_BURST]; +} __attribute__((__aligned__(64))); /* let it be cacheline aligned */ + +static struct lcore_info lcore_infos[MAX_LCORES]; static void usage(char *progname) @@ -69,6 +100,8 @@ usage(char *progname) printf(" --deletion-rate: Enable deletion rate" " calculations\n"); printf(" --dump-socket-mem: To dump all socket memory\n"); + printf(" --enable-fwd: To enable packets forwarding" + " after insertion\n"); printf("To set flow attributes:\n"); printf(" --ingress: set ingress attribute in flows\n"); @@ -253,6 +286,7 @@ args_parse(int argc, char **argv) { "dump-iterations", 0, 0, 0 }, { "deletion-rate", 0, 0, 0 }, { "dump-socket-mem", 0, 0, 0 }, + { "enable-fwd", 0, 0, 0 }, /* Attributes */ { "ingress", 0, 0, 0 }, { "egress", 0, 0, 0 }, @@ -366,6 +400,9 @@ args_parse(int argc, char **argv) if (strcmp(lgopts[opt_idx].name, "dump-socket-mem") == 0) dump_socket_mem_flag = true; + if (strcmp(lgopts[opt_idx].name, + "enable-fwd") == 0) + enable_fwd = true; break; default: fprintf(stderr, "Invalid option: %s\n", argv[optind]); @@ -628,6 +665,265 @@ signal_handler(int signum) } } +static inline uint16_t +do_rx(struct lcore_info *li, uint16_t rx_port, uint16_t rx_queue) +{ + uint16_t cnt = 0; + cnt = rte_eth_rx_burst(rx_port, rx_queue, li->pkts, MAX_PKT_BURST); + li->rx_pkts += cnt; + return cnt; +} + +static inline void +do_tx(struct lcore_info *li, uint16_t cnt, uint16_t tx_port, + uint16_t tx_queue) +{ + uint16_t nr_tx = 0; + uint16_t i; + + nr_tx = rte_eth_tx_burst(tx_port, tx_queue, li->pkts, cnt); + li->tx_pkts += nr_tx; + li->tx_drops += cnt - nr_tx; + + for (i = nr_tx; i < cnt; i++) + rte_pktmbuf_free(li->pkts[i]); +} + +/* + * Method to convert numbers into pretty numbers that easy + * to read. The design here is to add comma after each three + * digits and set all of this inside buffer. + * + * For example if n = 1799321, the output will be + * 1,799,321 after this method which is easier to read. + */ +static char * +pretty_number(uint64_t n, char *buf) +{ + char p[6][4]; + int i = 0; + int off = 0; + + while (n > 1000) { + sprintf(p[i], "%03d", (int)(n % 1000)); + n /= 1000; + i += 1; + } + + sprintf(p[i++], "%d", (int)n); + + while (i--) + off += sprintf(buf + off, "%s,", p[i]); + buf[strlen(buf) - 1] = '\0'; + + return buf; +} + +static void +packet_per_second_stats(void) +{ + struct lcore_info *old; + struct lcore_info *li, *oli; + int nr_lines = 0; + int i; + + old = rte_zmalloc("old", + sizeof(struct lcore_info) * MAX_LCORES, 0); + if (old == NULL) + rte_exit(EXIT_FAILURE, "No Memory available!"); + + memcpy(old, lcore_infos, + sizeof(struct lcore_info) * MAX_LCORES); + + while (!force_quit) { + uint64_t total_tx_pkts = 0; + uint64_t total_rx_pkts = 0; + uint64_t total_tx_drops = 0; + uint64_t tx_delta, rx_delta, drops_delta; + char buf[3][32]; + int nr_valid_core = 0; + + sleep(1); + + if (nr_lines) { + char go_up_nr_lines[16]; + + sprintf(go_up_nr_lines, "%c[%dA\r", 27, nr_lines); + printf("%s\r", go_up_nr_lines); + } + + printf("\n%6s %16s %16s %16s\n", "core", "tx", "tx drops", "rx"); + printf("%6s %16s %16s %16s\n", "------", "----------------", + "----------------", "----------------"); + nr_lines = 3; + for (i = 0; i < MAX_LCORES; i++) { + li = &lcore_infos[i]; + oli = &old[i]; + if (li->mode != LCORE_MODE_PKT) + continue; + + tx_delta = li->tx_pkts - oli->tx_pkts; + rx_delta = li->rx_pkts - oli->rx_pkts; + drops_delta = li->tx_drops - oli->tx_drops; + printf("%6d %16s %16s %16s\n", i, + pretty_number(tx_delta, buf[0]), + pretty_number(drops_delta, buf[1]), + pretty_number(rx_delta, buf[2])); + + total_tx_pkts += tx_delta; + total_rx_pkts += rx_delta; + total_tx_drops += drops_delta; + + nr_valid_core++; + nr_lines += 1; + } + + if (nr_valid_core > 1) { + printf("%6s %16s %16s %16s\n", "total", + pretty_number(total_tx_pkts, buf[0]), + pretty_number(total_tx_drops, buf[1]), + pretty_number(total_rx_pkts, buf[2])); + nr_lines += 1; + } + + memcpy(old, lcore_infos, + sizeof(struct lcore_info) * MAX_LCORES); + } +} + +static int +start_forwarding(void *data __rte_unused) +{ + int lcore = rte_lcore_id(); + int stream_id; + uint16_t cnt; + struct lcore_info *li = &lcore_infos[lcore]; + + if (!li->mode) + return 0; + + if (li->mode == LCORE_MODE_STATS) { + printf(":: started stats on lcore %u\n", lcore); + packet_per_second_stats(); + return 0; + } + + while (!force_quit) + for (stream_id = 0; stream_id < MAX_STREAMS; stream_id++) { + if (li->streams[stream_id].rx_port == -1) + continue; + + cnt = do_rx(li, + li->streams[stream_id].rx_port, + li->streams[stream_id].rx_queue); + if (cnt) + do_tx(li, cnt, + li->streams[stream_id].tx_port, + li->streams[stream_id].tx_queue); + } + return 0; +} + +static void +init_lcore_info(void) +{ + int i, j; + unsigned int lcore; + uint16_t nr_port; + uint16_t queue; + int port; + int stream_id = 0; + int streams_per_core; + int unassigned_streams; + int nb_fwd_streams; + nr_port = rte_eth_dev_count_avail(); + + /* First logical core is reserved for stats printing */ + lcore = rte_get_next_lcore(-1, 0, 0); + lcore_infos[lcore].mode = LCORE_MODE_STATS; + + /* + * Initialize all cores + * All cores at first must have -1 value in all streams + * This means that this stream is not used, or not set + * yet. + */ + for (i = 0; i < MAX_LCORES; i++) + for (j = 0; j < MAX_STREAMS; j++) { + lcore_infos[i].streams[j].tx_port = -1; + lcore_infos[i].streams[j].rx_port = -1; + lcore_infos[i].streams[j].tx_queue = -1; + lcore_infos[i].streams[j].rx_queue = -1; + lcore_infos[i].streams_nb = 0; + } + + /* + * Calculate the total streams count. + * Also distribute those streams count between the available + * logical cores except first core, since it's reserved for + * stats prints. + */ + nb_fwd_streams = nr_port * RXQ_NUM; + if ((int)(nb_lcores - 1) >= nb_fwd_streams) + for (i = 0; i < (int)(nb_lcores - 1); i++) { + lcore = rte_get_next_lcore(lcore, 0, 0); + lcore_infos[lcore].streams_nb = 1; + } + else { + streams_per_core = nb_fwd_streams / (nb_lcores - 1); + unassigned_streams = nb_fwd_streams % (nb_lcores - 1); + for (i = 0; i < (int)(nb_lcores - 1); i++) { + lcore = rte_get_next_lcore(lcore, 0, 0); + lcore_infos[lcore].streams_nb = streams_per_core; + if (unassigned_streams) { + lcore_infos[lcore].streams_nb++; + unassigned_streams--; + } + } + } + + /* + * Set the streams for the cores according to each logical + * core stream count. + * The streams is built on the design of what received should + * forward as well, this means that if you received packets on + * port 0 queue 0 then the same queue should forward the + * packets, using the same logical core. + */ + lcore = rte_get_next_lcore(-1, 0, 0); + for (port = 0; port < nr_port; port++) { + /* Create FWD stream */ + for (queue = 0; queue < RXQ_NUM; queue++) { + if (!lcore_infos[lcore].streams_nb || + !(stream_id % lcore_infos[lcore].streams_nb)) { + lcore = rte_get_next_lcore(lcore, 0, 0); + lcore_infos[lcore].mode = LCORE_MODE_PKT; + stream_id = 0; + } + lcore_infos[lcore].streams[stream_id].rx_queue = queue; + lcore_infos[lcore].streams[stream_id].tx_queue = queue; + lcore_infos[lcore].streams[stream_id].rx_port = port; + lcore_infos[lcore].streams[stream_id].tx_port = port; + stream_id++; + } + } + + /* Print all streams */ + printf(":: Stream -> core id[N]: (rx_port, rx_queue)->(tx_port, tx_queue)\n"); + for (i = 0; i < MAX_LCORES; i++) + for (j = 0; j < MAX_STREAMS; j++) { + /* No streams for this core */ + if (lcore_infos[i].streams[j].tx_port == -1) + break; + printf("Stream -> core id[%d]: (%d,%d)->(%d,%d)\n", + i, + lcore_infos[i].streams[j].rx_port, + lcore_infos[i].streams[j].rx_queue, + lcore_infos[i].streams[j].tx_port, + lcore_infos[i].streams[j].tx_queue); + } +} + static void init_port(void) { @@ -799,6 +1095,11 @@ main(int argc, char **argv) fprintf(stdout, ":: Memory allocation change(M): %.6lf\n", (alloc - last_alloc) / 1.0e6); + if (enable_fwd) { + init_lcore_info(); + rte_eal_mp_remote_launch(start_forwarding, NULL, CALL_MASTER); + } + RTE_ETH_FOREACH_DEV(port) { rte_flow_flush(port, &error); rte_eth_dev_stop(port); diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst index 170086d1c..0a6abbea2 100644 --- a/doc/guides/rel_notes/release_20_08.rst +++ b/doc/guides/rel_notes/release_20_08.rst @@ -64,6 +64,7 @@ New Features * Measure rte_flow insertion rate. * Measure rte_flow deletion rate. * Dump rte_flow memory consumption. + * Measure packet per second forwarding. Removed Items diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst index 5dbd6eb3b..60d0b12eb 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -29,6 +29,8 @@ The current version has limitations which can be removed in future: The application also provide the ability to measure rte flow deletion rate, in addition to memory consumption before and after the flows creation. +The app supports single and multi core performance measurements. + Compiling the Application ========================= @@ -81,6 +83,10 @@ The command line options are: * ``--dump-socket-mem`` Dump the memory stats for each socket before the insertion and after. +* ``--enable-fwd`` + Enable packets forwarding after insertion/deletion operations. + + Attributes: * ``--ingress``