get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/66775/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 66775,
    "url": "https://patches.dpdk.org/api/patches/66775/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1584452772-31147-1-git-send-email-wisamm@mellanox.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1584452772-31147-1-git-send-email-wisamm@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1584452772-31147-1-git-send-email-wisamm@mellanox.com",
    "date": "2020-03-17T13:46:12",
    "name": "[RFC] app/test-flow-perf: add rte_flow perf app",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f006aacffd510e87c6b1d0f4bf5f0879885122bd",
    "submitter": {
        "id": 938,
        "url": "https://patches.dpdk.org/api/people/938/?format=api",
        "name": "Wisam Jaddo",
        "email": "wisamm@mellanox.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1584452772-31147-1-git-send-email-wisamm@mellanox.com/mbox/",
    "series": [
        {
            "id": 8953,
            "url": "https://patches.dpdk.org/api/series/8953/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=8953",
            "date": "2020-03-17T13:46:12",
            "name": "[RFC] app/test-flow-perf: add rte_flow perf app",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/8953/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/66775/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/66775/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 67BC9A0565;\n\tTue, 17 Mar 2020 14:46:27 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 52CDE25D9;\n\tTue, 17 Mar 2020 14:46:26 +0100 (CET)",
            "from EUR04-HE1-obe.outbound.protection.outlook.com\n (mail-eopbgr70077.outbound.protection.outlook.com [40.107.7.77])\n by dpdk.org (Postfix) with ESMTP id 5BB1D1AFF\n for <dev@dpdk.org>; Tue, 17 Mar 2020 14:46:24 +0100 (CET)",
            "from AM0PR05MB6610.eurprd05.prod.outlook.com (20.178.202.18) by\n AM0PR05MB4868.eurprd05.prod.outlook.com (20.177.41.214) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.2793.15; Tue, 17 Mar 2020 13:46:22 +0000",
            "from AM0PR05MB6610.eurprd05.prod.outlook.com\n ([fe80::f9b0:5b27:21a3:c758]) by AM0PR05MB6610.eurprd05.prod.outlook.com\n ([fe80::f9b0:5b27:21a3:c758%3]) with mapi id 15.20.2814.021; Tue, 17 Mar 2020\n 13:46:22 +0000",
            "from mellanox.com (37.142.13.130) by\n PR2P264CA0048.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101:1::36) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id\n 15.20.2814.18 via Frontend Transport; Tue, 17 Mar 2020 13:46:21 +0000"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=GrMzq/1xsGZefjKKQ9AKfD+hl5N/fdSf8Nxf/zWDeD5EbTmVepwR4U25O0TeeAm/HSJ2FT52rEkOFbqxYavWkRA/19S2ulrX+DO2gOtkurxCGQzVqE19xSjfo3JEMfIsUUNuLYLnQc5RhzPfibFc69lSmkfGI/dfDF2EcGup7YBKMFG2gk62gFtWrlXH4O2xUZVpZ4RaxraqhGt1IjmTilZuoCiIrsnlFrwwbcMeN6d8T8mVBn6ncXtGjqOdkXgl2RB9w90UfIJasUJjzORzuGjmGf8xo4lIU8PmNt1ElKhgC5p92a/d5C91ysp7GdPMiK9NaAnyuIU+ll7nFxwt7w==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=bNn0q8r8/dFW5AZurF5FhfpAFfChwttz0n9SrAq1u4A=;\n b=PC9HQRMYwORKU3PbrGSObwO7qtTEtkWDHj7Fqcj+CpLbFGYPeN9ksEcya0MZHlYSFgjSXv30M706yRobDP9RSk7RaxDwsQJBZxWoWDuMGaenJ4SxqE6GuGJ1tpans8S2Ke14H+IZAyVrZOcCsiOKxGheDNaMyu2k3vxLYHz/kv7BUdv+4br7Eu6LCeH1bogzUluTx0JzUKeIPfLuje4PmTbq3zhpXSFNPYE6U5TF+vKDTBHhMUYfSdBMTmYarzHy949mZ5Tu2JZ0a3W6ccnJgUDDt5Cb8jaSkzaNZYj1E7N5tKZFutBrBSetq8tiXcRTPEDi3IhbFN4PATsR717Acw==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com;\n dkim=pass header.d=mellanox.com; arc=none",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=bNn0q8r8/dFW5AZurF5FhfpAFfChwttz0n9SrAq1u4A=;\n b=EPtlQRhCeYKBTrnBJUykoIg1NosxcoF4chvVXt9/VBcV1gYFnCVDlUiRJd7WGHet6CDQeFHt5lYqzTKk1Rcbm03PVNLAw9lduFeTIkOEqPyWNJefS9I+oHwTGFiJAfngh4P/DAF4P93VA7rWuAjUJBa++3AfxTy8CZ37dbSM060=",
        "Authentication-Results": "spf=none (sender IP is )\n smtp.mailfrom=wisamm@mellanox.com;",
        "From": "Wisam Jaddo <wisamm@mellanox.com>",
        "To": "dev@dpdk.org,\n\tthomas@monjalon.net,\n\tmatan@mellanox.com",
        "Cc": "rasland@mellanox.com",
        "Date": "Tue, 17 Mar 2020 15:46:12 +0200",
        "Message-Id": "<1584452772-31147-1-git-send-email-wisamm@mellanox.com>",
        "X-Mailer": [
            "git-send-email 2.7.4",
            "git-send-email 2.7.4"
        ],
        "Content-Type": "text/plain",
        "X-ClientProxiedBy": "PR2P264CA0048.FRAP264.PROD.OUTLOOK.COM\n (2603:10a6:101:1::36) To AM0PR05MB6610.eurprd05.prod.outlook.com\n (2603:10a6:208:12f::18)",
        "MIME-Version": "1.0",
        "X-MS-Exchange-MessageSentRepresentingType": "1",
        "X-Originating-IP": "[37.142.13.130]",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-HT": "Tenant",
        "X-MS-Office365-Filtering-Correlation-Id": "520dfe29-fcc8-4f39-99de-08d7ca7993ef",
        "X-MS-TrafficTypeDiagnostic": "AM0PR05MB4868:|AM0PR05MB4868:",
        "X-LD-Processed": "a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr",
        "X-MS-Exchange-Transport-Forked": "True",
        "X-Microsoft-Antispam-PRVS": "\n <AM0PR05MB4868D2DBF5D4F32D89E20EECA9F60@AM0PR05MB4868.eurprd05.prod.outlook.com>",
        "X-MS-Oob-TLC-OOBClassifiers": "OLM:3276;",
        "X-Forefront-PRVS": "0345CFD558",
        "X-Forefront-Antispam-Report": "SFV:NSPM;\n SFS:(10009020)(4636009)(136003)(39860400002)(396003)(366004)(376002)(346002)(199004)(2906002)(36756003)(16526019)(186003)(8936002)(6636002)(81166006)(81156014)(5660300002)(7696005)(8676002)(52116002)(316002)(55016002)(2616005)(26005)(956004)(478600001)(66476007)(6666004)(86362001)(8886007)(30864003)(107886003)(66556008)(66946007)(4326008);\n DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB4868;\n H:AM0PR05MB6610.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en;\n PTR:InfoNoRecords; A:1;",
        "Received-SPF": "None (protection.outlook.com: mellanox.com does not designate\n permitted sender hosts)",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-Microsoft-Antispam": "BCL:0;",
        "X-Microsoft-Antispam-Message-Info": "\n HYrKxcBi+KRPk3sAG04E3jFQp27azW2yjgjK0Caf8PugoAcK53VLBv0p4w2uEM4nenkurqqy4pXkNk6iL+Ff2legjbItCIo6dWwSte7dfz3Sjam3VlLgQZB0YY1SETjGodKGa1IoiWCzFIgfgHweitDebMHga9/EEpzPsywXAtUFVlLEkIHnOJVO7N++7CwFcXjaofEA+WVrDReIE+eNPurmIyKniVD9Vi/FtbrGwgfM5shMGvrH9MtEnCohgTpuJrzdWQzTfaJI8HJAFFRCxAyxhu8cmEbq0sr4sWKMU3kPFFAQvK/2F6d23X6dPwHgXzTaWgcHqy55mlV9C/WFkMiaxxbiJlDkK//O3xHqg2vOaOVRorbHeoE+8NMYXGby54cBFg6Cl74tJEPIuKptvg775sD1TGgiGvvGJzAY5JVJ/b53CY81Xxg+qMf6SmZt",
        "X-MS-Exchange-AntiSpam-MessageData": "\n kSNyvb4q+stMEquNQ1AjExp+K9mNDTGqmoot3t3ikexrRMVEvJZnY1ag52zgI/1lamdWJwoQLgviZNDSxFC8cMlFa/mnTSJ1JS26v+8y8gts8kE5O9GWuf4I0e/2eUDDGgmWaSiaNlvMdd0QZ2HPuQ==",
        "X-OriginatorOrg": "Mellanox.com",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 520dfe29-fcc8-4f39-99de-08d7ca7993ef",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "17 Mar 2020 13:46:22.2188 (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": "\n PBsF6L11lrpizFmrzIoCoWk2LO82aGzR5l04rZa+L6Nd1LYhHxWe7Qsk3M7vZGlicX9t2uIOyC4EoQkUpkVZvQ==",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM0PR05MB4868",
        "Subject": "[dpdk-dev] [RFC] app/test-flow-perf: add rte_flow perf app",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Introducing new application for rte_flow performance\ntesting. The application provide the ability to test\ninsertion rate of specific rte_flow rule, by stressing\nit to the NIC, and calculate the insertion rate.\n\nIt also provides packet per second measurements\nafter the insertion operation is done.\n\nThe application offers some options in the command\nline, to configure which rule to apply.\n\nAfter that the application will start producing rules\nwith same pattern but increasing the outer IP source\naddress by 1 each time, thus it will give different\nflow each time, and all other items will have open masks.\n\nThe current design have single core insertion rate.\nIn the future we may have a multi core insertion rate\nmeasurement support in the app.\n\nThe app supports single and multi core performance\nmeasurements.\n\nSigned-off-by: Wisam Jaddo <wisamm@mellanox.com>\n---\n app/Makefile                     |   1 +\n app/meson.build                  |   1 +\n app/test-flow-perf/Makefile      |  28 ++\n app/test-flow-perf/actions_gen.c |  26 ++\n app/test-flow-perf/actions_gen.h |  15 +\n app/test-flow-perf/flow_gen.c    |  97 ++++++\n app/test-flow-perf/flow_gen.h    |  47 +++\n app/test-flow-perf/items_gen.c   |  37 +++\n app/test-flow-perf/items_gen.h   |  16 +\n app/test-flow-perf/main.c        | 656 +++++++++++++++++++++++++++++++++++++++\n app/test-flow-perf/meson.build   |  14 +\n config/common_base               |   5 +\n 12 files changed, 943 insertions(+)\n create mode 100644 app/test-flow-perf/Makefile\n create mode 100644 app/test-flow-perf/actions_gen.c\n create mode 100644 app/test-flow-perf/actions_gen.h\n create mode 100644 app/test-flow-perf/flow_gen.c\n create mode 100644 app/test-flow-perf/flow_gen.h\n create mode 100644 app/test-flow-perf/items_gen.c\n create mode 100644 app/test-flow-perf/items_gen.h\n create mode 100644 app/test-flow-perf/main.c\n create mode 100644 app/test-flow-perf/meson.build",
    "diff": "diff --git a/app/Makefile b/app/Makefile\nindex db9d2d5..694df67 100644\n--- a/app/Makefile\n+++ b/app/Makefile\n@@ -9,6 +9,7 @@ DIRS-$(CONFIG_RTE_PROC_INFO) += proc-info\n DIRS-$(CONFIG_RTE_LIBRTE_PDUMP) += pdump\n DIRS-$(CONFIG_RTE_LIBRTE_ACL) += test-acl\n DIRS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test-cmdline\n+DIRS-$(CONFIG_RTE_TEST_FLOW_PERF) += test-flow-perf\n DIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += test-pipeline\n DIRS-$(CONFIG_RTE_LIBRTE_IPSEC) += test-sad\n \ndiff --git a/app/meson.build b/app/meson.build\nindex 71109cc..20d77b0 100644\n--- a/app/meson.build\n+++ b/app/meson.build\n@@ -14,6 +14,7 @@ apps = [\n \t'test-compress-perf',\n \t'test-crypto-perf',\n \t'test-eventdev',\n+\t'test-flow-perf',\n \t'test-pipeline',\n \t'test-pmd',\n \t'test-sad']\ndiff --git a/app/test-flow-perf/Makefile b/app/test-flow-perf/Makefile\nnew file mode 100644\nindex 0000000..d633725\n--- /dev/null\n+++ b/app/test-flow-perf/Makefile\n@@ -0,0 +1,28 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright 2020 Mellanox Technologies, Ltd\n+\n+include $(RTE_SDK)/mk/rte.vars.mk\n+\n+ifeq ($(CONFIG_RTE_TEST_FLOW_PERF),y)\n+\n+\n+#\n+# library name\n+#\n+APP = flow_perf\n+\n+CFLAGS += -O3\n+CFLAGS += $(WERROR_FLAGS)\n+CFLAGS += -Wno-deprecated-declarations\n+\n+#\n+# all source are stored in SRCS-y\n+#\n+SRCS-y += actions_gen.c\n+SRCS-y += flow_gen.c\n+SRCS-y := items_gen.c\n+SRCS-y += main.c\n+\n+include $(RTE_SDK)/mk/rte.app.mk\n+\n+endif\ndiff --git a/app/test-flow-perf/actions_gen.c b/app/test-flow-perf/actions_gen.c\nnew file mode 100644\nindex 0000000..a40ec0e\n--- /dev/null\n+++ b/app/test-flow-perf/actions_gen.c\n@@ -0,0 +1,26 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ * The file contains the implementations of actions generators.\n+ * Each generator is responsible for preparing it's action instance\n+ * and initializing it with needed data.\n+ *\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#include \"actions_gen.h\"\n+\n+static struct rte_flow_action_queue queue_action;\n+static struct rte_flow_action_mark mark_action;\n+\n+\n+static void\n+gen_queue(uint16_t queue)\n+{\n+\tqueue_action.index = queue;\n+}\n+\n+static void\n+gen_mark(uint32_t mark_id)\n+{\n+\tmark_action.id = mark_id;\n+}\ndiff --git a/app/test-flow-perf/actions_gen.h b/app/test-flow-perf/actions_gen.h\nnew file mode 100644\nindex 0000000..a690a1a\n--- /dev/null\n+++ b/app/test-flow-perf/actions_gen.h\n@@ -0,0 +1,15 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ * This file contains the functions definitions to\n+ * generate each supported action.\n+ *\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#define MAX_ACTIONS_NUM   4\n+\n+static void\n+gen_queue(uint16_t queue);\n+\n+static void\n+gen_mark(uint32_t mark_id);\ndiff --git a/app/test-flow-perf/flow_gen.c b/app/test-flow-perf/flow_gen.c\nnew file mode 100644\nindex 0000000..74d2908\n--- /dev/null\n+++ b/app/test-flow-perf/flow_gen.c\n@@ -0,0 +1,97 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ * The file contains the implementations of the method to\n+ * fill items, actions & attributes in their corresponding\n+ * arrays, and then generate rte_flow rule.\n+ *\n+ * After the generation. The rule goes to validation then\n+ * creation state and then return the results.\n+ *\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#include \"flow_gen.h\"\n+#include \"items_gen.c\"\n+#include \"actions_gen.c\"\n+\n+struct rte_flow *\n+generate_flow(uint16_t port_id,\n+\t\tuint16_t flow_items,\n+\t\tuint16_t flow_actions,\n+\t\tuint8_t flow_attrs,\n+\t\tuint16_t group_id,\n+\t\tuint16_t nr_queues,\n+\t\tuint32_t outer_ip_src,\n+\t\tstruct rte_flow_error *error)\n+{\n+\tstruct rte_flow_attr attr;\n+\tstruct rte_flow_item items[MAX_ITEMS_NUM];\n+\tstruct rte_flow_action actions[MAX_ACTIONS_NUM];\n+\tstruct rte_flow *flow = NULL;\n+\tint res;\n+\n+\tmemset(items, 0, sizeof(items));\n+\tmemset(actions, 0, sizeof(actions));\n+\tmemset(&attr, 0, sizeof(struct rte_flow_attr));\n+\n+\tfill_attributes(&attr, flow_attrs, group_id);\n+\n+\tfill_actions(actions, flow_actions, nr_queues, outer_ip_src);\n+\n+\tfill_items(items, flow_items, outer_ip_src);\n+\n+\tres = rte_flow_validate(port_id, &attr, items, actions, error);\n+\tif (!res)\n+\t\tflow = rte_flow_create(port_id, &attr, items, actions, error);\n+\treturn flow;\n+}\n+\n+static void\n+fill_attributes(struct rte_flow_attr *attr,\n+\tuint8_t flow_attrs, uint16_t group_id)\n+{\n+\tif (flow_attrs & INGRESS)\n+\t\tattr->ingress = 1;\n+\tif (flow_attrs & EGRESS)\n+\t\tattr->egress = 1;\n+\tif (flow_attrs & TRANSFER)\n+\t\tattr->transfer = 1;\n+\tattr->group = group_id;\n+}\n+\n+static void\n+fill_items(struct rte_flow_item items[MAX_ITEMS_NUM],\n+\tuint16_t flow_items, uint32_t outer_ip_src)\n+{\n+\tuint8_t items_counter = 0;\n+\n+\tif (flow_items & ETH_ITEM)\n+\t\tadd_ether(items, items_counter++);\n+\tif (flow_items & IPV4_ITEM)\n+\t\tadd_ipv4(items, items_counter++, outer_ip_src);\n+\n+\titems[items_counter].type = RTE_FLOW_ITEM_TYPE_END;\n+}\n+\n+static void\n+fill_actions(struct rte_flow_action actions[MAX_ACTIONS_NUM],\n+\tuint16_t flow_actions, uint16_t nr_queues, uint32_t counter)\n+{\n+\tuint8_t actions_counter = 0;\n+\n+\t/* None-fate actions */\n+\tif (flow_actions & MARK_ACTION) {\n+\t\tgen_mark(1);\n+\t\tactions[actions_counter].type = RTE_FLOW_ACTION_TYPE_MARK;\n+\t\tactions[actions_counter++].conf = &mark_action;\n+\t}\n+\n+\t/* Fate actions */\n+\tif (flow_actions & QUEUE_ACTION) {\n+\t\tgen_queue(counter % nr_queues);\n+\t\tactions[actions_counter].type = RTE_FLOW_ACTION_TYPE_QUEUE;\n+\t\tactions[actions_counter++].conf = &queue_action;\n+\t}\n+\n+\tactions[actions_counter].type = RTE_FLOW_ACTION_TYPE_END;\n+}\ndiff --git a/app/test-flow-perf/flow_gen.h b/app/test-flow-perf/flow_gen.h\nnew file mode 100644\nindex 0000000..b006d10\n--- /dev/null\n+++ b/app/test-flow-perf/flow_gen.h\n@@ -0,0 +1,47 @@\n+/* SPDX-License-Identifier: BSD-3-Claus\n+ *\n+ * This file contains the items, actions and attributes\n+ * definition. And the methods to prepare and fill items,\n+ * actions and attributes to generate rte_flow rule.\n+ *\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#define MAX_ACTIONS_NUM   4\n+#define MAX_ITEMS_NUM     8\n+\n+/* Items */\n+#define ETH_ITEM  0x0001\n+#define IPV4_ITEM 0x0002\n+\n+/* Actions */\n+#define QUEUE_ACTION 0x0001\n+#define MARK_ACTION  0x0002\n+#define DROP_ACTION  0x0004\n+\n+/* Attributes */\n+#define INGRESS  0x0001\n+#define EGRESS   0x0002\n+#define TRANSFER 0x0004\n+\n+struct rte_flow *\n+generate_flow(uint16_t port_id,\n+\t\tuint16_t flow_items,\n+\t\tuint16_t flow_actions,\n+\t\tuint8_t flow_attrs,\n+\t\tuint16_t group_id,\n+\t\tuint16_t nr_queues,\n+\t\tuint32_t outer_ip_src,\n+\t\tstruct rte_flow_error *error);\n+\n+static void\n+fill_attributes(struct rte_flow_attr *attr,\n+\tuint8_t flow_attrs, uint16_t group_id);\n+\n+static void\n+fill_items(struct rte_flow_item items[MAX_ITEMS_NUM],\n+\tuint16_t flow_items, uint32_t outer_ip_src);\n+\n+static void\n+fill_actions(struct rte_flow_action actions[MAX_ACTIONS_NUM],\n+\tuint16_t flow_actions, uint16_t nr_queues, uint32_t counter);\ndiff --git a/app/test-flow-perf/items_gen.c b/app/test-flow-perf/items_gen.c\nnew file mode 100644\nindex 0000000..029d8c6\n--- /dev/null\n+++ b/app/test-flow-perf/items_gen.c\n@@ -0,0 +1,37 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ * This file contain the implementations of the items\n+ * related methods. Each Item have a method to prepare\n+ * the item and add it into items array in given index.\n+ *\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#include \"items_gen.h\"\n+\n+static struct rte_flow_item_eth eth_spec;\n+static struct rte_flow_item_eth eth_mask;\n+\n+static struct rte_flow_item_ipv4 ipv4_spec;\n+static struct rte_flow_item_ipv4 ipv4_mask;\n+\n+static inline void\n+add_ether(struct rte_flow_item items[MAX_ITEMS_NUM],\n+\tuint8_t items_counter)\n+{\n+\tRTE_SET_USED(eth_spec);\n+\tRTE_SET_USED(eth_mask);\n+\tRTE_SET_USED(items);\n+\tRTE_SET_USED(items_counter);\n+}\n+\n+static inline void\n+add_ipv4(struct rte_flow_item items[MAX_ITEMS_NUM],\n+\tuint8_t items_counter, uint32_t src_ipv4)\n+{\n+\tRTE_SET_USED(ipv4_spec);\n+\tRTE_SET_USED(ipv4_mask);\n+\tRTE_SET_USED(items);\n+\tRTE_SET_USED(items_counter);\n+\tRTE_SET_USED(src_ipv4);\n+}\ndiff --git a/app/test-flow-perf/items_gen.h b/app/test-flow-perf/items_gen.h\nnew file mode 100644\nindex 0000000..65ef410\n--- /dev/null\n+++ b/app/test-flow-perf/items_gen.h\n@@ -0,0 +1,16 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ * This file contains the items related methods\n+ *\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+\n+#define MAX_ITEMS_NUM\t8\n+\n+static inline void\n+add_ether(struct rte_flow_item items[MAX_ITEMS_NUM],\n+\tuint8_t items_counter);\n+\n+static inline void\n+add_ipv4(struct rte_flow_item items[MAX_ITEMS_NUM],\n+\tuint8_t items_counter, uint32_t src_ipv4);\ndiff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c\nnew file mode 100644\nindex 0000000..201870f\n--- /dev/null\n+++ b/app/test-flow-perf/main.c\n@@ -0,0 +1,656 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ * This file contain the application main file\n+ * This application provides the user the ability to test the\n+ * insertion rate for specific rte_flow rule under stress state ~4M rule/\n+ *\n+ * Then it will also provide packet per second measurement after installing\n+ * all rules, the user may send traffic to test the PPS that match the rules\n+ * after all rules are installed, to check performance or functionality after\n+ * the stress.\n+ *\n+ * The flows insertion will go for all ports first, then it will print the\n+ * results, after that the application will go into forwarding packets mode\n+ * it will start receiving traffic if any and then forwarding it back and\n+ * gives packet per second measurement.\n+ *\n+ * Copyright 2020 Mellanox Technologies, Ltd\n+ */\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <stdint.h>\n+#include <inttypes.h>\n+#include <sys/types.h>\n+#include <sys/queue.h>\n+#include <netinet/in.h>\n+#include <setjmp.h>\n+#include <stdarg.h>\n+#include <ctype.h>\n+#include <errno.h>\n+#include <getopt.h>\n+#include <signal.h>\n+#include <stdbool.h>\n+#include <assert.h>\n+#include <unistd.h>\n+#include <fcntl.h>\n+#include <sys/time.h>\n+\n+\n+#include <rte_eal.h>\n+#include <rte_common.h>\n+#include <rte_malloc.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev.h>\n+#include <rte_mempool.h>\n+#include <rte_mbuf.h>\n+#include <rte_net.h>\n+#include <rte_flow.h>\n+#include <rte_cycles.h>\n+#include <rte_memory.h>\n+\n+#include \"flow_gen.h\"\n+#include \"flow_gen.c\"\n+\n+#define MAX_PKT_BURST 32\n+#define LCORE_MODE_PKT 1\n+#define LCORE_MODE_STATS 2\n+#define MAX_STREAMS 64\n+#define MAX_LCORES 64\n+\n+/* User Parameters */\n+#define FLOWS_COUNT 4000000\n+#define ITER_COUNT  100000\n+#define MAX_ITER    100\n+#define RXQs 8\n+#define TXQs 8\n+#define FLOW_TABLE 1\n+#define TOTAL_MBUF_NUM 32000\n+#define MBUF_SIZE 2048\n+#define MBUF_CACHE_SIZE 512\n+#define NR_RXD\t256\n+#define NR_TXD\t256\n+\n+\n+struct rte_flow *flow;\n+\n+static uint16_t flow_items;\n+static uint16_t flow_actions;\n+static uint8_t flow_attrs;\n+static volatile bool force_quit;\n+static struct rte_mempool *mbuf_mp;\n+static uint32_t nb_lcores;\n+\n+struct stream {\n+\tint tx_port;\n+\tint tx_queue;\n+\tint rx_port;\n+\tint rx_queue;\n+};\n+\n+struct lcore_info {\n+\tint mode;\n+\tint streams_nb;\n+\tstruct stream streams[MAX_STREAMS];\n+\t/* stats */\n+\tuint64_t tx_pkts;\n+\tuint64_t tx_drops;\n+\tuint64_t rx_pkts;\n+\tstruct rte_mbuf *pkts[MAX_PKT_BURST];\n+} __attribute__((__aligned__(64))); /* let it be cacheline aligned */\n+\n+\n+static struct lcore_info lcore_infos[MAX_LCORES];\n+static void usage(char *progname)\n+{\n+\tRTE_SET_USED(progname);\n+\tprintf(\"usage: Help will be implemented here :)\");\n+}\n+\n+static void\n+args_parse(int argc, char **argv)\n+{\n+\tchar **argvopt;\n+\tint opt;\n+\tint opt_idx;\n+\tstatic struct option lgopts[] = {\n+\t\t{ \"help\",                       0, 0, 0 },\n+\t\t{ \"ingress\",                    0, 0, 0 },\n+\t\t{ \"egress\",                     0, 0, 0 },\n+\t\t{ \"transfer\",                   0, 0, 0 },\n+\t\t{ \"ether\",                      0, 0, 0 },\n+\t\t{ \"ipv4\",                       0, 0, 0 },\n+\t\t{ \"queue\",                      0, 0, 0 },\n+\t};\n+\n+\tflow_items = 0;\n+\tflow_actions = 0;\n+\tflow_attrs = 0;\n+\n+\tprintf(\":: Flow -> \");\n+\targvopt = argv;\n+\twhile ((opt = getopt_long(argc, argvopt, \"\",\n+\t\t\t\tlgopts, &opt_idx)) != EOF) {\n+\t\tswitch (opt) {\n+\t\tcase 0:\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"help\")) {\n+\t\t\t\tusage(argv[0]);\n+\t\t\t\trte_exit(EXIT_SUCCESS, \"Displayed help\\n\");\n+\t\t\t}\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"ingress\")) {\n+\t\t\t\tflow_attrs |= INGRESS;\n+\t\t\t\tprintf(\"ingress \");\n+\t\t\t}\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"egress\")) {\n+\t\t\t\tflow_attrs |= EGRESS;\n+\t\t\t\tprintf(\"egress \");\n+\t\t\t}\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"transfer\")) {\n+\t\t\t\tflow_attrs |= TRANSFER;\n+\t\t\t\tprintf(\"transfer \");\n+\t\t\t}\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"ether\")) {\n+\t\t\t\tflow_items |= ETH_ITEM;\n+\t\t\t\tprintf(\"ether / \");\n+\t\t\t}\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"ipv4\")) {\n+\t\t\t\tflow_items |= IPV4_ITEM;\n+\t\t\t\tprintf(\"ipv4 / \");\n+\t\t\t}\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"queue\")) {\n+\t\t\t\tflow_actions |= QUEUE_ACTION;\n+\t\t\t\tprintf(\"queue / \");\n+\t\t\t}\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tusage(argv[0]);\n+\t\t\tprintf(\"Invalid option: %s\\n\", argv[optind]);\n+\t\t\trte_exit(EXIT_SUCCESS, \"Invalid option\\n\");\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\tprintf(\"end_flow\\n\");\n+}\n+\n+static void\n+print_flow_error(struct rte_flow_error error)\n+{\n+\tprintf(\"Flow can't be created %d message: %s\\n\",\n+\t\t\terror.type,\n+\t\t\terror.message ? error.message : \"(no stated reason)\");\n+}\n+\n+static inline void\n+flows_creator(void)\n+{\n+\tstruct rte_flow_error error;\n+\tclock_t start, end, start_iter, end_iter;\n+\tdouble cpu_time_used, flows_rate;\n+\tdouble cpu_time_per_iter[MAX_ITER];\n+\tdouble delta;\n+\tuint16_t nr_ports;\n+\tuint32_t i;\n+\tuint32_t eagin_counter = 0;\n+\tint port_id;\n+\n+\tnr_ports = rte_eth_dev_count_avail();\n+\n+\tfor (i = 0; i < MAX_ITER; i++)\n+\t\tcpu_time_per_iter[i] = -1;\n+\n+\tprintf(\":: Flows Count per port: %d\\n\", FLOWS_COUNT);\n+\n+\tfor (port_id = 0; port_id < nr_ports; port_id++) {\n+\t\t/* Insertion Rate */\n+\t\tprintf(\"Flows insertion on port = %d\\n\", port_id);\n+\t\tstart = clock();\n+\t\tstart_iter = clock();\n+\t\tfor (i = 0; i < FLOWS_COUNT; i++) {\n+\t\t\tdo {\n+\t\t\t\trte_errno = 0;\n+\t\t\t\tflow = generate_flow(port_id, flow_items,\n+\t\t\t\t\tflow_actions, flow_attrs, FLOW_TABLE,\n+\t\t\t\t\tRXQs, i, &error);\n+\t\t\t\tif (!flow)\n+\t\t\t\t\teagin_counter++;\n+\t\t\t} while (rte_errno == EAGAIN);\n+\n+\t\t\tif (force_quit)\n+\t\t\t\ti = FLOWS_COUNT;\n+\n+\t\t\tif (!flow) {\n+\t\t\t\tprint_flow_error(error);\n+\t\t\t\trte_exit(EXIT_FAILURE, \"error in creating flow\");\n+\t\t\t}\n+\n+\t\t\tif (i && !((i + 1) % ITER_COUNT)) {\n+\t\t\t\t/* Save the insertion rate of each iter */\n+\t\t\t\tend_iter = clock();\n+\t\t\t\tdelta = (double) (end_iter - start_iter);\n+\t\t\t\tcpu_time_per_iter[((i + 1) / ITER_COUNT) - 1] =\n+\t\t\t\t\tdelta / CLOCKS_PER_SEC;\n+\t\t\t\tstart_iter = clock();\n+\t\t\t}\n+\t\t}\n+\t\tend = clock();\n+\t\tcpu_time_used = ((double) (end - start)) / CLOCKS_PER_SEC;\n+\n+\t\t/* Iteration rate per iteration */\n+\t\tfor (i = 0; i < MAX_ITER; i++) {\n+\t\t\tif (cpu_time_per_iter[i] == -1)\n+\t\t\t\tcontinue;\n+\t\t\tdelta = (double) (ITER_COUNT / cpu_time_per_iter[i]);\n+\t\t\tflows_rate = delta / 1000;\n+\t\t\tprintf(\":: Iteration #%d: %d flows in %f sec[ Rate = %f K/Sec ]\\n\",\n+\t\t\ti, ITER_COUNT, cpu_time_per_iter[i], flows_rate);\n+\t\t}\n+\n+\t\t/* Insertion rate for all flows */\n+\t\tflows_rate = ((double) (FLOWS_COUNT / cpu_time_used) / 1000);\n+\t\tprintf(\"\\n:: Total flow insertion rate -> %f K/Sec\\n\",\n+\t\t\t\t\t\tflows_rate);\n+\t\tprintf(\":: The time for creating %d in flows %f seconds\\n\",\n+\t\t\t\t\t\tFLOWS_COUNT, cpu_time_used);\n+\t\tprintf(\":: EAGIN counter = %d\\n\", eagin_counter);\n+\t}\n+}\n+\n+static void\n+signal_handler(int signum)\n+{\n+\tif (signum == SIGINT || signum == SIGTERM) {\n+\t\tprintf(\"\\n\\nSignal %d received, preparing to exit...\\n\",\n+\t\t\t\t\tsignum);\n+\t\tprintf(\"Error: Stats are wrong due to sudden signal!\\n\\n\");\n+\t\tforce_quit = true;\n+\t}\n+}\n+\n+static inline uint16_t\n+do_rx(struct lcore_info *li, uint16_t rx_port, uint16_t rx_queue)\n+{\n+\tuint16_t cnt = 0;\n+\tcnt = rte_eth_rx_burst(rx_port, rx_queue, li->pkts, MAX_PKT_BURST);\n+\tli->rx_pkts += cnt;\n+\treturn cnt;\n+}\n+\n+static inline void\n+do_tx(struct lcore_info *li, uint16_t cnt, uint16_t tx_port,\n+\t\t\tuint16_t tx_queue)\n+{\n+\tuint16_t nr_tx = 0;\n+\tuint16_t i;\n+\n+\tnr_tx = rte_eth_tx_burst(tx_port, tx_queue, li->pkts, cnt);\n+\tli->tx_pkts  += nr_tx;\n+\tli->tx_drops += cnt - nr_tx;\n+\n+\tfor (i = nr_tx; i < cnt; i++)\n+\t\trte_pktmbuf_free(li->pkts[i]);\n+}\n+\n+/*\n+ * Here we convert numbers into pretty numbers that easy to\n+ * read. The design here is to add comma after each three\n+ * digits and set all of this inside buffer.\n+ *\n+ * For example if n = 1799321, the output will be\n+ * 1,799,321 after this method which is easier to read.\n+ */\n+static char *\n+pretty_number(uint64_t n, char *buf)\n+{\n+\tchar p[6][4];\n+\tint i = 0;\n+\tint off = 0;\n+\n+\twhile (n > 1000) {\n+\t\tsprintf(p[i], \"%03d\", (int)(n % 1000));\n+\t\tn /= 1000;\n+\t\ti += 1;\n+\t}\n+\n+\tsprintf(p[i++], \"%d\", (int)n);\n+\n+\twhile (i--)\n+\t\toff += sprintf(buf + off, \"%s,\", p[i]);\n+\tbuf[strlen(buf) - 1] = '\\0';\n+\n+\treturn buf;\n+}\n+\n+static void\n+packet_per_second_stats(void)\n+{\n+\tstruct lcore_info old[MAX_LCORES];\n+\tstruct lcore_info *li, *oli;\n+\tint nr_lines = 0;\n+\tint i;\n+\n+\tmemcpy(old, lcore_infos,\n+\t\tsizeof(struct lcore_info) * MAX_LCORES);\n+\n+\twhile (!force_quit) {\n+\t\tuint64_t total_tx_pkts = 0;\n+\t\tuint64_t total_rx_pkts = 0;\n+\t\tuint64_t total_tx_drops = 0;\n+\t\tuint64_t tx_delta, rx_delta, drops_delta;\n+\t\tchar buf[3][32];\n+\t\tint nr_valid_core = 0;\n+\n+\t\tsleep(1);\n+\n+\t\tif (nr_lines) {\n+\t\t\tchar go_up_nr_lines[16];\n+\n+\t\t\tsprintf(go_up_nr_lines, \"%c[%dA\\r\", 27, nr_lines);\n+\t\t\tprintf(\"%s\\r\", go_up_nr_lines);\n+\t\t}\n+\n+\t\tprintf(\"\\n%16s %16s %16s %16s\\n\", \"core\", \"tx\", \"tx drops\", \"rx\");\n+\t\tprintf(\"%16s %16s %16s %16s\\n\", \"------\",\n+\t\t\t\"----------------\", \"----------------\", \"----------------\");\n+\t\tnr_lines = 3;\n+\t\tfor (i = 0; i < MAX_LCORES; i++) {\n+\t\t\tli  = &lcore_infos[i];\n+\t\t\toli = &old[i];\n+\t\t\tif (li->mode != LCORE_MODE_PKT)\n+\t\t\t\tcontinue;\n+\n+\t\t\ttx_delta    = li->tx_pkts  - oli->tx_pkts;\n+\t\t\trx_delta    = li->rx_pkts  - oli->rx_pkts;\n+\t\t\tdrops_delta = li->tx_drops - oli->tx_drops;\n+\t\t\tprintf(\"%6d %16s %16s %16s\\n\", i,\n+\t\t\t\tpretty_number(tx_delta,    buf[0]),\n+\t\t\t\tpretty_number(drops_delta, buf[1]),\n+\t\t\t\tpretty_number(rx_delta,    buf[2]));\n+\n+\t\t\ttotal_tx_pkts  += tx_delta;\n+\t\t\ttotal_rx_pkts  += rx_delta;\n+\t\t\ttotal_tx_drops += drops_delta;\n+\n+\t\t\tnr_valid_core++;\n+\t\t\tnr_lines += 1;\n+\t\t}\n+\n+\t\tif (nr_valid_core > 1) {\n+\t\t\tprintf(\"%6s %16s %16s %16s\\n\", \"total\",\n+\t\t\t\tpretty_number(total_tx_pkts,  buf[0]),\n+\t\t\t\tpretty_number(total_tx_drops, buf[1]),\n+\t\t\t\tpretty_number(total_rx_pkts,  buf[2]));\n+\t\t\tnr_lines += 1;\n+\t\t}\n+\n+\t\tmemcpy(old, lcore_infos,\n+\t\t\tsizeof(struct lcore_info) * MAX_LCORES);\n+\t}\n+}\n+\n+static int\n+start_forwarding(void *data __rte_unused)\n+{\n+\tint lcore = rte_lcore_id();\n+\tint stream_id;\n+\tuint16_t cnt;\n+\tstruct lcore_info *li = &lcore_infos[lcore];\n+\n+\tif (!li->mode)\n+\t\treturn 0;\n+\n+\tif (li->mode == LCORE_MODE_STATS) {\n+\t\tprintf(\":: started stats on lcore %u\\n\", lcore);\n+\t\tpacket_per_second_stats();\n+\t\treturn 0;\n+\t}\n+\n+\twhile (!force_quit)\n+\t\tfor (stream_id = 0; stream_id < MAX_STREAMS; stream_id++) {\n+\t\t\tif (li->streams[stream_id].rx_port == -1)\n+\t\t\t\tcontinue;\n+\n+\t\t\tcnt = do_rx(li,\n+\t\t\t\t\tli->streams[stream_id].rx_port,\n+\t\t\t\t\tli->streams[stream_id].rx_queue);\n+\t\t\tif (cnt)\n+\t\t\t\tdo_tx(li, cnt,\n+\t\t\t\t\tli->streams[stream_id].tx_port,\n+\t\t\t\t\tli->streams[stream_id].tx_queue);\n+\t\t}\n+\treturn 0;\n+}\n+\n+static void\n+init_lcore_info(void)\n+{\n+\tint i, j;\n+\tunsigned int lcore;\n+\tuint16_t nr_port;\n+\tuint16_t queue;\n+\tint port;\n+\tint stream_id = 0;\n+\tint streams_per_core;\n+\tint unassigned_streams;\n+\tint nb_fwd_streams;\n+\tnr_port = rte_eth_dev_count_avail();\n+\n+\t/** First logical core is reserved for stats printing **/\n+\tlcore = rte_get_next_lcore(-1, 0, 0);\n+\tlcore_infos[lcore].mode = LCORE_MODE_STATS;\n+\n+\t/*\n+\t * Initialize all cores\n+\t * All cores at first must have -1 value in all streams\n+\t * This means that this stream is not used, or not set\n+\t * yet.\n+\t */\n+\tfor (i = 0; i < MAX_LCORES; i++)\n+\t\tfor (j = 0; j < MAX_STREAMS; j++) {\n+\t\t\tlcore_infos[i].streams[j].tx_port = -1;\n+\t\t\tlcore_infos[i].streams[j].rx_port = -1;\n+\t\t\tlcore_infos[i].streams[j].tx_queue = -1;\n+\t\t\tlcore_infos[i].streams[j].rx_queue = -1;\n+\t\t\tlcore_infos[i].streams_nb = 0;\n+\t\t}\n+\n+\t/*\n+\t * Calculate the total streams count.\n+\t * Also distribute those streams count between the available\n+\t * logical cores except first core, since it's reserved for\n+\t * stats prints.\n+\t */\n+\tnb_fwd_streams = nr_port * RXQs;\n+\tif ((int)(nb_lcores - 1) >= nb_fwd_streams)\n+\t\tfor (i = 0; i < (int)(nb_lcores - 1); i++) {\n+\t\t\tlcore = rte_get_next_lcore(lcore, 0, 0);\n+\t\t\tlcore_infos[lcore].streams_nb = 1;\n+\t\t}\n+\telse {\n+\t\tstreams_per_core = nb_fwd_streams / (nb_lcores - 1);\n+\t\tunassigned_streams = nb_fwd_streams % (nb_lcores - 1);\n+\t\tfor (i = 0; i < (int)(nb_lcores - 1); i++) {\n+\t\t\tlcore = rte_get_next_lcore(lcore, 0, 0);\n+\t\t\tlcore_infos[lcore].streams_nb = streams_per_core;\n+\t\t\tif (unassigned_streams) {\n+\t\t\t\tlcore_infos[lcore].streams_nb++;\n+\t\t\t\tunassigned_streams--;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\t/*\n+\t * Set the streams for the cores according to each logical\n+\t * core stream count.\n+\t * The streams is built on the design of what received should\n+\t * forward as well, this means that if you received packets on\n+\t * port 0 queue 0 then the same queue should forward the\n+\t * packets, using the same logical core.\n+\t */\n+\tlcore = rte_get_next_lcore(-1, 0, 0);\n+\tfor (port = 0; port < nr_port; port++) {\n+\t\tfor (queue = 0; queue < RXQs; queue++) {\n+\t\t\tif (!lcore_infos[lcore].streams_nb ||\n+\t\t\t\t!(stream_id % lcore_infos[lcore].streams_nb)) {\n+\t\t\t\tlcore = rte_get_next_lcore(lcore, 0, 0);\n+\t\t\t\tlcore_infos[lcore].mode = LCORE_MODE_PKT;\n+\t\t\t\tstream_id = 0;\n+\t\t\t}\n+\t\t\tlcore_infos[lcore].streams[stream_id].rx_queue = queue;\n+\t\t\tlcore_infos[lcore].streams[stream_id].tx_queue = queue;\n+\t\t\tlcore_infos[lcore].streams[stream_id].rx_port = port;\n+\t\t\tlcore_infos[lcore].streams[stream_id].tx_port = port;\n+\t\t\tstream_id++;\n+\t\t}\n+\t}\n+\n+\t/** Print all streams **/\n+\tprintf(\":: Stream -> core id[N]: (rx_port, rx_queue)->(tx_port, tx_queue)\\n\");\n+\tfor (i = 0; i < MAX_LCORES; i++)\n+\t\tfor (j = 0; j < MAX_STREAMS; j++) {\n+\t\t\t/** No streams for this core **/\n+\t\t\tif (lcore_infos[i].streams[j].tx_port == -1)\n+\t\t\t\tbreak;\n+\t\t\tprintf(\"Stream -> core id[%d]: (%d,%d)->(%d,%d)\\n\",\n+\t\t\t\ti,\n+\t\t\t\tlcore_infos[i].streams[j].rx_port,\n+\t\t\t\tlcore_infos[i].streams[j].rx_queue,\n+\t\t\t\tlcore_infos[i].streams[j].tx_port,\n+\t\t\t\tlcore_infos[i].streams[j].tx_queue);\n+\t\t}\n+}\n+\n+static void\n+init_port(void)\n+{\n+\tint ret;\n+\tuint16_t i;\n+\tuint16_t port_id;\n+\tuint16_t nr_ports = rte_eth_dev_count_avail();\n+\tstruct rte_eth_conf port_conf = {\n+\t\t.rxmode = {\n+\t\t\t.split_hdr_size = 0,\n+\t\t},\n+\t\t.rx_adv_conf = {\n+\t\t\t.rss_conf.rss_hf =\n+\t\t\t\t\tETH_RSS_IP  |\n+\t\t\t\t\tETH_RSS_UDP |\n+\t\t\t\t\tETH_RSS_TCP,\n+\t\t},\n+\t};\n+\tstruct rte_eth_txconf txq_conf;\n+\tstruct rte_eth_rxconf rxq_conf;\n+\tstruct rte_eth_dev_info dev_info;\n+\n+\tif (nr_ports == 0)\n+\t\trte_exit(EXIT_FAILURE, \"Error: no port detected\\n\");\n+\tmbuf_mp = rte_pktmbuf_pool_create(\"mbuf_pool\",\n+\t\t\t\t\tTOTAL_MBUF_NUM, MBUF_CACHE_SIZE,\n+\t\t\t\t\t0, MBUF_SIZE,\n+\t\t\t\t\trte_socket_id());\n+\n+\tif (mbuf_mp == NULL)\n+\t\trte_exit(EXIT_FAILURE, \"Error: can't init mbuf pool\\n\");\n+\n+\tfor (port_id = 0; port_id < nr_ports; port_id++) {\n+\t\tret = rte_eth_dev_info_get(port_id, &dev_info);\n+\t\tif (ret != 0)\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\"Error during getting device (port %u) info: %s\\n\",\n+\t\t\t\t\tport_id, strerror(-ret));\n+\n+\t\tprintf(\":: initializing port: %d\\n\", port_id);\n+\t\tret = rte_eth_dev_configure(port_id, RXQs, TXQs, &port_conf);\n+\t\tif (ret < 0) {\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\":: cannot configure device: err=%d, port=%u\\n\",\n+\t\t\t\t\tret, port_id);\n+\t\t\t}\n+\n+\t\trxq_conf = dev_info.default_rxconf;\n+\t\trxq_conf.offloads = port_conf.rxmode.offloads;\n+\t\tfor (i = 0; i < RXQs; i++) {\n+\t\t\tret = rte_eth_rx_queue_setup(port_id, i, NR_RXD,\n+\t\t\t\t\t\trte_eth_dev_socket_id(port_id),\n+\t\t\t\t\t\t&rxq_conf,\n+\t\t\t\t\t\tmbuf_mp);\n+\t\t\tif (ret < 0) {\n+\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\t\":: Rx queue setup failed: err=%d, port=%u\\n\",\n+\t\t\t\t\t\tret, port_id);\n+\t\t\t}\n+\t\t}\n+\n+\t\ttxq_conf = dev_info.default_txconf;\n+\t\ttxq_conf.offloads = port_conf.txmode.offloads;\n+\n+\t\tfor (i = 0; i < TXQs; i++) {\n+\t\t\tret = rte_eth_tx_queue_setup(port_id, i, NR_TXD,\n+\t\t\t\t\t\trte_eth_dev_socket_id(port_id),\n+\t\t\t\t\t\t&txq_conf);\n+\t\t\tif (ret < 0) {\n+\t\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\t\":: Tx queue setup failed: err=%d, port=%u\\n\",\n+\t\t\t\t\t\tret, port_id);\n+\t\t\t}\n+\t\t}\n+\n+\t\tret = rte_eth_dev_start(port_id);\n+\t\tif (ret < 0) {\n+\t\t\trte_exit(EXIT_FAILURE,\n+\t\t\t\t\t\"rte_eth_dev_start:err=%d, port=%u\\n\",\n+\t\t\t\t\tret, port_id);\n+\t\t}\n+\n+\t\tprintf(\":: initializing port: %d done\\n\", port_id);\n+\t}\n+}\n+\n+int\n+main(int argc, char **argv)\n+{\n+\tuint16_t lcore_id;\n+\tuint16_t port;\n+\tuint16_t nr_ports;\n+\tint ret;\n+\tstruct rte_flow_error error;\n+\n+\tnr_ports = rte_eth_dev_count_avail();\n+\tret = rte_eal_init(argc, argv);\n+\tif (ret < 0)\n+\t\trte_exit(EXIT_FAILURE, \"EAL init failed\\n\");\n+\n+\tforce_quit = false;\n+\tsignal(SIGINT, signal_handler);\n+\tsignal(SIGTERM, signal_handler);\n+\n+\targc -= ret;\n+\targv += ret;\n+\n+\tif (argc > 1)\n+\t\targs_parse(argc, argv);\n+\n+\tinit_port();\n+\n+\tnb_lcores = rte_lcore_count();\n+\n+\tif (nb_lcores <= 1)\n+\t\trte_exit(EXIT_FAILURE, \"This app needs at least two cores\\n\");\n+\n+\tflows_creator();\n+\n+\tinit_lcore_info();\n+\n+\trte_eal_mp_remote_launch(start_forwarding, NULL, CALL_MASTER);\n+\n+\tRTE_LCORE_FOREACH_SLAVE(lcore_id)\n+\n+\tif (rte_eal_wait_lcore(lcore_id) < 0)\n+\t\tbreak;\n+\n+\tfor (port = 0; port < nr_ports; port++) {\n+\t\trte_flow_flush(port, &error);\n+\t\trte_eth_dev_stop(port);\n+\t\trte_eth_dev_close(port);\n+\t}\n+\treturn 0;\n+}\ndiff --git a/app/test-flow-perf/meson.build b/app/test-flow-perf/meson.build\nnew file mode 100644\nindex 0000000..2326bec\n--- /dev/null\n+++ b/app/test-flow-perf/meson.build\n@@ -0,0 +1,14 @@\n+# SPDX-License-Identifier: BSD-3-Clause\n+# Copyright(c) 2020 Mellanox Technologies, Ltd\n+\n+# meson file, for building this example as part of a main DPDK build.\n+#\n+# To build this example as a standalone application with an already-installed\n+# DPDK instance, use 'make'\n+\n+sources = files(\n+\t'actions_gen.c',\n+\t'flow_gen.c',\n+\t'items_gen.c',\n+\t'main.c',\n+)\ndiff --git a/config/common_base b/config/common_base\nindex c31175f..79455bf 100644\n--- a/config/common_base\n+++ b/config/common_base\n@@ -1111,3 +1111,8 @@ CONFIG_RTE_APP_CRYPTO_PERF=y\n # Compile the eventdev application\n #\n CONFIG_RTE_APP_EVENTDEV=y\n+\n+#\n+# Compile the rte flow perf application\n+#\n+CONFIG_RTE_TEST_FLOW_PERF=y\n",
    "prefixes": [
        "RFC"
    ]
}