From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AA663A0567; Wed, 10 Mar 2021 14:56:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B185522A69E; Wed, 10 Mar 2021 14:56:07 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2080.outbound.protection.outlook.com [40.107.237.80]) by mails.dpdk.org (Postfix) with ESMTP id 49AF722A69E for ; Wed, 10 Mar 2021 14:56:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LeqLq7ibNICoHASCn9K29mUkc9V/DP88dgiDhqu83BorgILPEGEqLUdk5LzAWGd8ipKp2S5na2/36xjPzLlJO7DPNAw1O2Ezp9K6FmrBq40RPUu/t0iyRqTISrJCI51Aj4J+Bmx5I5sVU6f/WdnB526VpIA2puxvFi+N5xC25Tci7rg8AkW1qqdhNV9Uvfj8Pt8AwDX5KRPOfev0ZfkUnUIYaDZ6EOJyH5i3A4rewWNZUJFs7gFoFP9RsFc8AHGXgLJRJ5yVt98uUMxKu9chNJdhLKTZpzkep58wtBbTRYWBnQMbchV9Ihodl+ujlBp2U8ZhUF4+VcWsvs20TC9xnw== 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=AvHZdkx0AHYe/mPdwjRY52oSvUNf/gicMEY/xL0naQA=; b=YyrAil4gn8vAlZADDe+GQKwndD613Eew59EEwX90zKtP4G2ib/0xjILMtIYt1u9tvg+yHIZp/W4qB7tVLrBk2yhTWVaMsGcnWNSy0QDLPTpt/bfAiHOPC9pDiLfHcdySOOcwoW+zGlxmKeQJbpGK3LA5a/WI9LHx6nwbY2TPSV3xr6NPvXwO7iNKOOt6jnASrxA6rJvKacpnR2y0HY6oEl8pI5MFbTSn8AYmIhD06g7dZxIzQUQaOwo3ENdFxXi/1Mvr6rrT0lL9aksEjWtCAjQt3IUwmGu6fhQdS+jEWz5Hb99NURjXhKStEINhpnEvEgaqo/e4xy+buN5bGqE2Pg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AvHZdkx0AHYe/mPdwjRY52oSvUNf/gicMEY/xL0naQA=; b=IcRVQkRyxEYR/dK1Fu/em8F3oKAgsPzrknOTPzjA5POyxlac47tPO+PuRr+T3WGuDkcTrfFius23jFVY84VpRVoEONJ2o5BrjZ8gYbQGemyegNmxk6/yvRYh4WKHXYRUnR31GFR0sDvETUdN7IfhrNKzECBJjX2eAB0npld10Zr/vhDnQANRAegsGKZoHUb2oyOkCBzmIa12dVNcBbczTB+LT6J9xgt7/t5Cmfda9jKmH+7jLGS7Tdq/TuQSVnbp9CHvktf+A1pNRBZgRH0xJCZNraaM5TNSJtSLvUBmjh9ppeZdfp3s1oJJaTmalNvTSLrb6aO9boFA3Ds/4n5QZA== Received: from BN6PR1101CA0022.namprd11.prod.outlook.com (2603:10b6:405:4a::32) by BN8PR12MB3588.namprd12.prod.outlook.com (2603:10b6:408:41::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.30; Wed, 10 Mar 2021 13:56:04 +0000 Received: from BN8NAM11FT028.eop-nam11.prod.protection.outlook.com (2603:10b6:405:4a:cafe::93) by BN6PR1101CA0022.outlook.office365.com (2603:10b6:405:4a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Wed, 10 Mar 2021 13:56:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT028.mail.protection.outlook.com (10.13.176.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.3933.31 via Frontend Transport; Wed, 10 Mar 2021 13:56:04 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 10 Mar 2021 13:56:01 +0000 From: Wisam Jaddo To: , , , , Date: Wed, 10 Mar 2021 15:55:41 +0200 Message-ID: <20210310135546.8680-3-wisamm@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210310135546.8680-1-wisamm@nvidia.com> References: <20210310134858.8104-2-wisamm@nvidia.com> <20210310135546.8680-1-wisamm@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2090385-e39d-434b-e7a7-08d8e3cc3f09 X-MS-TrafficTypeDiagnostic: BN8PR12MB3588: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:321; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y4yPCrzgw6IYaSECa8mJaa7ikj7SI+hzDK2UK8KyULH/n8C0lqQDpkWvupIWFVv985ZY4NWGDFsughD/Cc2ads0IUO4QIt90jFImLWnhOzt7FiazqqXvONIyIfi0gQ8NVZZXuSk4AJ2qIyx5syVYH1iYQdRyuLbqLmsBOaIz+BbMbmpJI+R81+aNMG73hR8IQMYq2yioMmUyTMe1grau4JGcR4rlT7fYozx/OMbF0vJlYWXFN/XGoS14QlFquB0YDwKqTJwV5p3DiJR3nWlv2TnNi5DA3Oxm4Ic21DOXtJJcqTah1V9aWGHwlEMOENHjNho5wQkAgqux2yiNULOgMcHa1t/v1AM3zFyZ2M2oZ4SGKKbOtd7Vl+EHT9hZxUSmbEn+hh/axwD6nLI4+WkIvM5jmyd3qOUC3V+Chxgcf0WzA8/oQ9i0XWcoMowoA7aWPhSNDUTczVcylIY35S7b8pCKM5pJG/LGEcXCyRsQOfD6K6NTFMoN0ZBUve+e2FswS9BsdsWnoi7nYd5/TkDRWJIleEGx7IL1GjtC43ulRdRLXiethXlKW08ISajp8ve3n530RDzHuDs6NHqT5BXTpWXdCAx1XQWu6m7NgcYwA6fj2aOURy7KFEON+2J4f6HeO6xMrEE/ELQiAM27U6JJaBcqnRXV/t7S4g1LH+RXVd5Im68E3o5DbgqTgIBho/UT X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(136003)(396003)(346002)(376002)(39860400002)(46966006)(36840700001)(356005)(70586007)(478600001)(8936002)(186003)(7636003)(16526019)(82740400003)(70206006)(6666004)(26005)(47076005)(36860700001)(8676002)(110136005)(83380400001)(1076003)(36906005)(30864003)(316002)(5660300002)(2906002)(7696005)(6286002)(426003)(36756003)(86362001)(336012)(2616005)(82310400003)(34020700004)(55016002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2021 13:56:04.0444 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d2090385-e39d-434b-e7a7-08d8e3cc3f09 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT028.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3588 Subject: [dpdk-dev] [PATCH v3 2/7] app/flow-perf: add new option to use unique data on the fly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Current support for unique data is to compile with config.h var as FIXED_VALUES as 0, and this is only supported on compilation time, as a result the user may use only single mode for each compilation. Starting with this commit the user will have the ability to use this feature on the fly by using this new option: --unique-data Example of unique data usage: Insert many rules with different encap data for a flows that have encap action in it. Signed-off-by: Wisam Jaddo --- app/test-flow-perf/actions_gen.c | 77 +++++++++++++++++--------------- app/test-flow-perf/actions_gen.h | 3 +- app/test-flow-perf/config.h | 8 +--- app/test-flow-perf/flow_gen.c | 4 +- app/test-flow-perf/flow_gen.h | 1 + app/test-flow-perf/main.c | 13 ++++-- doc/guides/tools/flow-perf.rst | 5 +++ 7 files changed, 62 insertions(+), 49 deletions(-) diff --git a/app/test-flow-perf/actions_gen.c b/app/test-flow-perf/actions_gen.c index 1f5c64fde9..82cddfc676 100644 --- a/app/test-flow-perf/actions_gen.c +++ b/app/test-flow-perf/actions_gen.c @@ -30,6 +30,7 @@ struct additional_para { uint64_t encap_data; uint64_t decap_data; uint8_t core_idx; + bool unique_data; }; /* Storage for struct rte_flow_action_raw_encap including external data. */ @@ -202,14 +203,14 @@ add_count(struct rte_flow_action *actions, static void add_set_src_mac(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static struct rte_flow_action_set_mac set_macs[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t mac = para.counter; uint16_t i; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) mac = 1; /* Mac address to be set is random each time */ @@ -225,14 +226,14 @@ add_set_src_mac(struct rte_flow_action *actions, static void add_set_dst_mac(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static struct rte_flow_action_set_mac set_macs[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t mac = para.counter; uint16_t i; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) mac = 1; /* Mac address to be set is random each time */ @@ -248,13 +249,13 @@ add_set_dst_mac(struct rte_flow_action *actions, static void add_set_src_ipv4(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static struct rte_flow_action_set_ipv4 set_ipv4[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t ip = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) ip = 1; /* IPv4 value to be set is random each time */ @@ -267,13 +268,13 @@ add_set_src_ipv4(struct rte_flow_action *actions, static void add_set_dst_ipv4(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static struct rte_flow_action_set_ipv4 set_ipv4[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t ip = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) ip = 1; /* IPv4 value to be set is random each time */ @@ -286,14 +287,14 @@ add_set_dst_ipv4(struct rte_flow_action *actions, static void add_set_src_ipv6(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static struct rte_flow_action_set_ipv6 set_ipv6[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t ipv6 = para.counter; uint8_t i; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) ipv6 = 1; /* IPv6 value to set is random each time */ @@ -309,14 +310,14 @@ add_set_src_ipv6(struct rte_flow_action *actions, static void add_set_dst_ipv6(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static struct rte_flow_action_set_ipv6 set_ipv6[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t ipv6 = para.counter; uint8_t i; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) ipv6 = 1; /* IPv6 value to set is random each time */ @@ -332,13 +333,13 @@ add_set_dst_ipv6(struct rte_flow_action *actions, static void add_set_src_tp(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static struct rte_flow_action_set_tp set_tp[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t tp = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) tp = 100; /* TP src port is random each time */ @@ -353,13 +354,13 @@ add_set_src_tp(struct rte_flow_action *actions, static void add_set_dst_tp(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static struct rte_flow_action_set_tp set_tp[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t tp = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) tp = 100; /* TP src port is random each time */ @@ -375,13 +376,13 @@ add_set_dst_tp(struct rte_flow_action *actions, static void add_inc_tcp_ack(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static rte_be32_t value[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t ack_value = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) ack_value = 1; value[para.core_idx] = RTE_BE32(ack_value); @@ -393,13 +394,13 @@ add_inc_tcp_ack(struct rte_flow_action *actions, static void add_dec_tcp_ack(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static rte_be32_t value[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t ack_value = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) ack_value = 1; value[para.core_idx] = RTE_BE32(ack_value); @@ -411,13 +412,13 @@ add_dec_tcp_ack(struct rte_flow_action *actions, static void add_inc_tcp_seq(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static rte_be32_t value[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t seq_value = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) seq_value = 1; value[para.core_idx] = RTE_BE32(seq_value); @@ -429,13 +430,13 @@ add_inc_tcp_seq(struct rte_flow_action *actions, static void add_dec_tcp_seq(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static rte_be32_t value[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t seq_value = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) seq_value = 1; value[para.core_idx] = RTE_BE32(seq_value); @@ -447,13 +448,13 @@ add_dec_tcp_seq(struct rte_flow_action *actions, static void add_set_ttl(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static struct rte_flow_action_set_ttl set_ttl[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t ttl_value = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) ttl_value = 1; /* Set ttl to random value each time */ @@ -476,13 +477,13 @@ add_dec_ttl(struct rte_flow_action *actions, static void add_set_ipv4_dscp(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static struct rte_flow_action_set_dscp set_dscp[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t dscp_value = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) dscp_value = 1; /* Set dscp to random value each time */ @@ -497,13 +498,13 @@ add_set_ipv4_dscp(struct rte_flow_action *actions, static void add_set_ipv6_dscp(struct rte_flow_action *actions, uint8_t actions_counter, - __rte_unused struct additional_para para) + struct additional_para para) { static struct rte_flow_action_set_dscp set_dscp[RTE_MAX_LCORE] __rte_cache_aligned; uint32_t dscp_value = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) dscp_value = 1; /* Set dscp to random value each time */ @@ -577,7 +578,7 @@ add_ipv4_header(uint8_t **header, uint64_t data, return; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) ip_dst = 1; memset(&ipv4_hdr, 0, sizeof(struct rte_ipv4_hdr)); @@ -643,7 +644,7 @@ add_vxlan_header(uint8_t **header, uint64_t data, return; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) vni_value = 1; memset(&vxlan_hdr, 0, sizeof(struct rte_vxlan_hdr)); @@ -666,7 +667,7 @@ add_vxlan_gpe_header(uint8_t **header, uint64_t data, return; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) vni_value = 1; memset(&vxlan_gpe_hdr, 0, sizeof(struct rte_vxlan_gpe_hdr)); @@ -707,7 +708,7 @@ add_geneve_header(uint8_t **header, uint64_t data, return; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) vni_value = 1; memset(&geneve_hdr, 0, sizeof(struct rte_geneve_hdr)); @@ -730,7 +731,7 @@ add_gtp_header(uint8_t **header, uint64_t data, return; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) teid_value = 1; memset(>p_hdr, 0, sizeof(struct rte_flow_item_gtp)); @@ -849,7 +850,7 @@ add_vxlan_encap(struct rte_flow_action *actions, uint32_t ip_dst = para.counter; /* Fixed value */ - if (FIXED_VALUES) + if (!para.unique_data) ip_dst = 1; items[0].spec = &item_eth; @@ -907,7 +908,8 @@ add_meter(struct rte_flow_action *actions, void fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions, uint32_t counter, uint16_t next_table, uint16_t hairpinq, - uint64_t encap_data, uint64_t decap_data, uint8_t core_idx) + uint64_t encap_data, uint64_t decap_data, uint8_t core_idx, + bool unique_data) { struct additional_para additional_para_data; uint8_t actions_counter = 0; @@ -930,6 +932,7 @@ fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions, .encap_data = encap_data, .decap_data = decap_data, .core_idx = core_idx, + .unique_data = unique_data, }; if (hairpinq != 0) { diff --git a/app/test-flow-perf/actions_gen.h b/app/test-flow-perf/actions_gen.h index 77353cfe09..6f2f833496 100644 --- a/app/test-flow-perf/actions_gen.h +++ b/app/test-flow-perf/actions_gen.h @@ -19,6 +19,7 @@ void fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions, uint32_t counter, uint16_t next_table, uint16_t hairpinq, - uint64_t encap_data, uint64_t decap_data, uint8_t core_idx); + uint64_t encap_data, uint64_t decap_data, uint8_t core_idx, + bool unique_data); #endif /* FLOW_PERF_ACTION_GEN */ diff --git a/app/test-flow-perf/config.h b/app/test-flow-perf/config.h index 3d4696d61a..a14d4e05e1 100644 --- a/app/test-flow-perf/config.h +++ b/app/test-flow-perf/config.h @@ -5,7 +5,7 @@ #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) +#define GET_RSS_HF() (ETH_RSS_IP) /* Configuration */ #define RXQ_NUM 4 @@ -19,12 +19,6 @@ #define METER_CIR 1250000 #define DEFAULT_METER_PROF_ID 100 -/* This is used for encap/decap & header modify actions. - * When it's 1: it means all actions have fixed values. - * When it's 0: it means all actions will have different values. - */ -#define FIXED_VALUES 1 - /* Items/Actions parameters */ #define JUMP_ACTION_TABLE 2 #define VLAN_VALUE 1 diff --git a/app/test-flow-perf/flow_gen.c b/app/test-flow-perf/flow_gen.c index df4af16de8..8f87fac5f6 100644 --- a/app/test-flow-perf/flow_gen.c +++ b/app/test-flow-perf/flow_gen.c @@ -46,6 +46,7 @@ generate_flow(uint16_t port_id, uint64_t encap_data, uint64_t decap_data, uint8_t core_idx, + bool unique_data, struct rte_flow_error *error) { struct rte_flow_attr attr; @@ -61,7 +62,8 @@ generate_flow(uint16_t port_id, fill_actions(actions, flow_actions, outer_ip_src, next_table, hairpinq, - encap_data, decap_data, core_idx); + encap_data, decap_data, core_idx, + unique_data); fill_items(items, flow_items, outer_ip_src, core_idx); diff --git a/app/test-flow-perf/flow_gen.h b/app/test-flow-perf/flow_gen.h index f1d0999af1..dc887fceae 100644 --- a/app/test-flow-perf/flow_gen.h +++ b/app/test-flow-perf/flow_gen.h @@ -35,6 +35,7 @@ generate_flow(uint16_t port_id, uint64_t encap_data, uint64_t decap_data, uint8_t core_idx, + bool unique_data, struct rte_flow_error *error); #endif /* FLOW_PERF_FLOW_GEN */ diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 8b5a11c15e..4054178273 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -61,6 +61,7 @@ static bool dump_iterations; static bool delete_flag; static bool dump_socket_mem_flag; static bool enable_fwd; +static bool unique_data; static struct rte_mempool *mbuf_mp; static uint32_t nb_lcores; @@ -131,6 +132,8 @@ usage(char *progname) printf(" --enable-fwd: To enable packets forwarding" " after insertion\n"); printf(" --portmask=N: hexadecimal bitmask of ports used\n"); + printf(" --unique-data: flag to set using unique data for all" + " actions that support data, such as header modify and encap actions\n"); printf("To set flow attributes:\n"); printf(" --ingress: set ingress attribute in flows\n"); @@ -567,6 +570,7 @@ args_parse(int argc, char **argv) { "deletion-rate", 0, 0, 0 }, { "dump-socket-mem", 0, 0, 0 }, { "enable-fwd", 0, 0, 0 }, + { "unique-data", 0, 0, 0 }, { "portmask", 1, 0, 0 }, { "cores", 1, 0, 0 }, /* Attributes */ @@ -765,6 +769,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, + "unique-data") == 0) + unique_data = true; if (strcmp(lgopts[opt_idx].name, "deletion-rate") == 0) delete_flag = true; @@ -1176,7 +1183,7 @@ insert_flows(int port_id, uint8_t core_id) */ flow = generate_flow(port_id, 0, flow_attrs, global_items, global_actions, - flow_group, 0, 0, 0, 0, core_id, &error); + flow_group, 0, 0, 0, 0, core_id, unique_data, &error); if (flow == NULL) { print_flow_error(error); @@ -1192,7 +1199,7 @@ insert_flows(int port_id, uint8_t core_id) JUMP_ACTION_TABLE, counter, hairpin_queues_num, encap_data, decap_data, - core_id, &error); + core_id, unique_data, &error); if (force_quit) counter = end_counter; @@ -1863,6 +1870,7 @@ main(int argc, char **argv) delete_flag = false; dump_socket_mem_flag = false; flow_group = DEFAULT_GROUP; + unique_data = false; signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); @@ -1878,7 +1886,6 @@ main(int argc, char **argv) if (nb_lcores <= 1) rte_exit(EXIT_FAILURE, "This app needs at least two cores\n"); - printf(":: Flows Count per port: %d\n\n", rules_count); if (has_meter()) diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst index 017e200222..280bf7e0e0 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -100,6 +100,11 @@ The command line options are: Set the number of needed cores to insert/delete rte_flow rules. Default cores count is 1. +* ``--unique-data`` + Flag to set using unique data for all actions that support data, + Such as header modify and encap actions. Default is using fixed + data for any action that support data for all flows. + Attributes: * ``--ingress`` -- 2.17.1