From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30E8BA04AB; Sun, 30 Aug 2020 13:19:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C74231C0B6; Sun, 30 Aug 2020 13:16:28 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00052.outbound.protection.outlook.com [40.107.0.52]) by dpdk.org (Postfix) with ESMTP id 8E1311C0AD for ; Sun, 30 Aug 2020 13:16:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a6/LitInftCZPpvQ70AMHCu818tqv4Tz43w86qtJ5Nl36whsC4rp05Le63BkX0dzKGfdNTGPZO+eVbwu5KokKl5pkL6kjnIC8fzjSg9T8oXtIwGSe5JZkJr6ktM8MrmDqKmC5p7yF8wFgTUQKxZq6BUQFoC2MH3MTqFPzHXzsTYsSXSy97I60faqxd2n0Ka0Wa4ccWEtG9KFsE2dXGGIReAoNiU28RI1h4PsPcn4WHkJKDq8M3PBGOCcojYLOvGKbWsfty/DFcUz938T8Dc3K7ku822drarZyQD0h5ooBcOXq2qmFq8UNRUD5jZ0pFDmBuDoFVn/k2Ji/n8AAXaOSA== 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=5DtqIX8ywqdiB9eSVLrFi1FyZkoErflAXwcdutTKrB8=; b=EkhGPOXo1wmnvPFM6wo970nkN7LsGSfGhJkbC+2PBi3W9X4vTiGyZiFtnUb+SimaAGlezG9oiG9L1vXdKMwImOInQlHzI2Ca6AJnrLBLDwPyCsVX5ZvMg0cjM9BpDp9s2JJh1hbcZzbSXcnOAcXpsJ6XWJyx1UKUl1oKeLlDMf77phSM4IrUPsTSsdheyXT4kxzE9BwXWYTHIxfzqJZ0gPytmi7IzmH0uQgGrRME7QEg2L2wUVym5Yg9FjEjrOPJUwXfNoh+mHPHnitWeSiLVy5m0hNywwlbpdiF9tuiN1lEc8rgfls4xXOxe/fEe5pRGl/ZJED7Edhwwm+wmstOUw== 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=5DtqIX8ywqdiB9eSVLrFi1FyZkoErflAXwcdutTKrB8=; b=C+DKef43hubQhey0tHDLe+Xo/kw5Xv2Dsz/j1ExJuLmWcf5wfBZ55kIjCdpbzVBDgyT5ZCBxulwRQRuKKaZ3tMBOaHS/lFxfpolENaYz/1eP5smhVTTwXs177Z7KHwe2acTlxlOG4Bqcjbn2pAeupgrNVWIPgMJ+vAIAZG0dZd8= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=mellanox.com; Received: from AM0PR05MB6610.eurprd05.prod.outlook.com (2603:10a6:208:12f::18) by AM0PR0502MB3762.eurprd05.prod.outlook.com (2603:10a6:208:1b::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.21; Sun, 30 Aug 2020 11:16:25 +0000 Received: from AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::4c8a:9848:2e2a:3598]) by AM0PR05MB6610.eurprd05.prod.outlook.com ([fe80::4c8a:9848:2e2a:3598%6]) with mapi id 15.20.3326.025; Sun, 30 Aug 2020 11:16:24 +0000 From: Wisam Jaddo To: dev@dpdk.org, thomas@monjalon.net, asafp@mellanox.com, akozyrev@nvidia.com, akozyrev@mellanox.com, arybchenko@solarflare.com, jackmin@mellanox.com Date: Sun, 30 Aug 2020 11:15:34 +0000 Message-Id: <20200830111544.4190-4-wisamm@mellanox.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200830111544.4190-1-wisamm@mellanox.com> References: <20200830111544.4190-1-wisamm@mellanox.com> Content-Type: text/plain X-ClientProxiedBy: AM4PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:205::21) 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 AM4PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3326.19 via Frontend Transport; Sun, 30 Aug 2020 11:16: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: b6d660ca-7e85-4627-f237-08d84cd621bd X-MS-TrafficTypeDiagnostic: AM0PR0502MB3762: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KGdz5eQW/A2c3CMNaA0VYO5vSQ5ZghoaYQ+eZa8IoUfz7qDAv2gLMh6DBPeEAjLBmIqrl1XV5IlLyKsInTsOyKPz9QbQNM5dL6HKy/t9m+gRPrA0KWi0ck7lR1bacs2mEqFKR+Muu4aNx/bX0e4JtXltkWzgak6ap7UnHLNIg8SG2P7UgTMRJDcEfdYtOxSBdtUL8RNKkOHTySu8hTYXNFoSjh/5u8lfjJl9K1PKioFgIy3iAi1SSEoRNaf04ToYn8KSTkFsOxvjbTriVhZbO4SyIMyEOYZ7pL1heNwxORXOHTZpoCKYH8q91X7C3yBK 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; SFS:(4636009)(366004)(396003)(136003)(39860400002)(376002)(346002)(478600001)(316002)(5660300002)(8886007)(30864003)(2906002)(6636002)(86362001)(36756003)(6666004)(1076003)(55016002)(8936002)(26005)(2616005)(7696005)(66946007)(66556008)(52116002)(83380400001)(16526019)(8676002)(186003)(956004)(66476007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: ZmzI59WyJPaZ3n0HO5/P/hh56B4dvah7le8nXEnbyNH8/n8yZ8S8ksE63cO6zZwU2Mb6Cwv5I7uJyzAPPXABFJETyppT5Nt4j5kDu8jf4ZS23i4mPJMzYW0/UVPNWPzJXDE0m3KRZZsn2sOfvf1iL5qRyXyGfsHwz1V61RjiTepaUQJQsitC/j6K1azPzDkE/ycQz0UZmOa17FB3Yrlud2Bwp7TDfHSvUFjgT6WyhIwQ4TD/t7yOBlz5I1AXVAeehsjd7CrAg5pJwWtWhgGCwy+QFMeXEW3z/2j6Zw0NUgt90ox+p8hfEGKFKQUIPHdXDjLtzmgAECWpY6w17PRfl3u1a+Ym0v+PzkpYtVqzuCjhpPmmtJCGHMOQ8pMPU6BW8RUrZsWJ9T/klZYqglFJGKgY5KGw1NAKGpWivv9Gou970wfIUKiQb0OoVHNZfQ7OpXrAc5Z+7MI4tLhKZdilOlBX9CxooG4rMk37pGuyH6uD3auO2af5S81fZfyV8FrQWQ0Ck+nF1ciVKs7a7ms6GNZ3gHtoZcExOuhEEO65S97DJXoE3pwP4r8AkTa3xBeaaObLxOgs3g4UnrBak0VULyea+CwKyk0k0FmiBiRcym19JaWoDun2JeTL3sOvLc8Wo9loQjdODK4wyUz1uZcx2A== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6d660ca-7e85-4627-f237-08d84cd621bd X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6610.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2020 11:16:24.8492 (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: mAbGKG2ydzaVGaEukvYCOpXZqyJYJaFgJ6HAoWqifG2hByB0C8GdRHk2bOLPI6CU3eJMwg5n/FYvzGJ8r5ydvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3762 Subject: [dpdk-dev] [PATCH 03/13] app/flow-perf: start supporting user order 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" The old design was using the bit mask to identify items, action and attributes. So it was all based on the order of the code itself, to place the order of the actions, items & attributes inside the flows. Such design will lead into many failures when some PMD support order different than other PMD, in the end the rules will fail to create. Also sometimes the user needs to have one action before other actions and vice versa, so using new design of arrays that take user order into consideration make more sense. After this patch, we start supporting inner items and more than one instance of same action. Signed-off-by: Wisam Jaddo Acked-by: Alexander Kozyrev --- app/test-flow-perf/actions_gen.c | 26 +++--- app/test-flow-perf/actions_gen.h | 2 +- app/test-flow-perf/config.h | 1 + app/test-flow-perf/flow_gen.c | 25 +++--- app/test-flow-perf/flow_gen.h | 6 +- app/test-flow-perf/items_gen.c | 26 +++--- app/test-flow-perf/items_gen.h | 2 +- app/test-flow-perf/main.c | 106 ++++++++++++++++--------- doc/guides/rel_notes/release_20_08.rst | 8 ++ doc/guides/tools/flow-perf.rst | 12 ++- 10 files changed, 135 insertions(+), 79 deletions(-) diff --git a/app/test-flow-perf/actions_gen.c b/app/test-flow-perf/actions_gen.c index cb9316f1df..d115cdd723 100644 --- a/app/test-flow-perf/actions_gen.c +++ b/app/test-flow-perf/actions_gen.c @@ -182,14 +182,14 @@ add_count(struct rte_flow_action *actions, } void -fill_actions(struct rte_flow_action *actions, uint64_t flow_actions, +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; + uint16_t i, j; for (i = 0; i < RXQ_NUM; i++) queues[i] = i; @@ -217,7 +217,7 @@ fill_actions(struct rte_flow_action *actions, uint64_t flow_actions, uint8_t actions_counter, struct additional_para para ); - } flows_actions[] = { + } actions_list[] = { { .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_MARK), .funct = add_mark, @@ -264,13 +264,19 @@ fill_actions(struct rte_flow_action *actions, uint64_t flow_actions, }, }; - 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 - ); + for (j = 0; j < MAX_ACTIONS_NUM; j++) { + if (flow_actions[j] == 0) + break; + for (i = 0; i < RTE_DIM(actions_list); i++) { + if ((flow_actions[j] & + actions_list[i].mask) == 0) + continue; + actions_list[i].funct( + actions, actions_counter++, + additional_para_data + ); + break; + } } 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 index 0defa7c97c..d6918a53a6 100644 --- a/app/test-flow-perf/actions_gen.h +++ b/app/test-flow-perf/actions_gen.h @@ -12,7 +12,7 @@ #include "config.h" -void fill_actions(struct rte_flow_action *actions, uint64_t actions_selector, +void fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions, 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 e47d788572..439f3264b4 100644 --- a/app/test-flow-perf/config.h +++ b/app/test-flow-perf/config.h @@ -29,3 +29,4 @@ /* Flow items/acctions max size */ #define MAX_ITEMS_NUM 32 #define MAX_ACTIONS_NUM 32 +#define MAX_ATTRS_NUM 16 diff --git a/app/test-flow-perf/flow_gen.c b/app/test-flow-perf/flow_gen.c index e87276bd14..b2c828c7df 100644 --- a/app/test-flow-perf/flow_gen.c +++ b/app/test-flow-perf/flow_gen.c @@ -18,23 +18,28 @@ static void fill_attributes(struct rte_flow_attr *attr, - uint64_t flow_attrs, uint16_t group) + 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; + uint8_t i; + for (i = 0; i < MAX_ATTRS_NUM; i++) { + if (flow_attrs[i] == 0) + break; + if (flow_attrs[i] & INGRESS) + attr->ingress = 1; + else if (flow_attrs[i] & EGRESS) + attr->egress = 1; + else if (flow_attrs[i] & 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, + uint64_t *flow_attrs, + uint64_t *flow_items, + uint64_t *flow_actions, uint16_t next_table, uint32_t outer_ip_src, uint16_t hairpinq, diff --git a/app/test-flow-perf/flow_gen.h b/app/test-flow-perf/flow_gen.h index 848331e229..53469c659f 100644 --- a/app/test-flow-perf/flow_gen.h +++ b/app/test-flow-perf/flow_gen.h @@ -26,9 +26,9 @@ struct rte_flow * generate_flow(uint16_t port_id, uint16_t group, - uint64_t flow_attrs, - uint64_t flow_items, - uint64_t flow_actions, + uint64_t *flow_attrs, + uint64_t *flow_items, + uint64_t *flow_actions, uint16_t next_table, uint32_t outer_ip_src, uint16_t hairpinq, diff --git a/app/test-flow-perf/items_gen.c b/app/test-flow-perf/items_gen.c index 6a8915100c..cc031f24a5 100644 --- a/app/test-flow-perf/items_gen.c +++ b/app/test-flow-perf/items_gen.c @@ -312,10 +312,10 @@ add_meta_tag(struct rte_flow_item *items, void fill_items(struct rte_flow_item *items, - uint64_t flow_items, uint32_t outer_ip_src) + uint64_t *flow_items, uint32_t outer_ip_src) { uint8_t items_counter = 0; - uint8_t i; + uint8_t i, j; struct additional_para additional_para_data = { .src_ip = outer_ip_src, }; @@ -328,7 +328,7 @@ fill_items(struct rte_flow_item *items, uint8_t items_counter, struct additional_para para ); - } flows_items[] = { + } items_list[] = { { .mask = RTE_FLOW_ITEM_TYPE_META, .funct = add_meta_data, @@ -384,13 +384,19 @@ fill_items(struct rte_flow_item *items, }; - 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 - ); + for (j = 0; j < MAX_ITEMS_NUM; j++) { + if (flow_items[j] == 0) + break; + for (i = 0; i < RTE_DIM(items_list); i++) { + if ((flow_items[j] & + FLOW_ITEM_MASK(items_list[i].mask)) == 0) + continue; + items_list[i].funct( + items, items_counter++, + additional_para_data + ); + break; + } } 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 index 9509d0f11c..d68958e4d3 100644 --- a/app/test-flow-perf/items_gen.h +++ b/app/test-flow-perf/items_gen.h @@ -12,7 +12,7 @@ #include "config.h" -void fill_items(struct rte_flow_item *items, uint64_t flow_items, +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 3589b316f9..0ff8080aa0 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -45,9 +45,10 @@ 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 uint64_t flow_items[MAX_ITEMS_NUM]; +static uint64_t flow_actions[MAX_ACTIONS_NUM]; +static uint64_t flow_attrs[MAX_ATTRS_NUM]; +static uint8_t items_idx, actions_idx, attrs_idx; static volatile bool force_quit; static bool dump_iterations; @@ -150,132 +151,159 @@ args_parse(int argc, char **argv) static const struct option_dict { const char *str; const uint64_t mask; - uint64_t *bitmap; + uint64_t *map; + uint8_t *map_idx; + } flow_options[] = { { .str = "ether", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_ETH), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "ipv4", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_IPV4), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "ipv6", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_IPV6), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "vlan", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_VLAN), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "tcp", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_TCP), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "udp", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_UDP), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "vxlan", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_VXLAN), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "vxlan-gpe", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_VXLAN_GPE), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "gre", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_GRE), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "geneve", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_GENEVE), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "gtp", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_GTP), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "meta", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_META), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "tag", .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_TAG), - .bitmap = &flow_items + .map = &flow_items[0], + .map_idx = &items_idx }, { .str = "ingress", .mask = INGRESS, - .bitmap = &flow_attrs + .map = &flow_attrs[0], + .map_idx = &attrs_idx }, { .str = "egress", .mask = EGRESS, - .bitmap = &flow_attrs + .map = &flow_attrs[0], + .map_idx = &attrs_idx }, { .str = "transfer", .mask = TRANSFER, - .bitmap = &flow_attrs + .map = &flow_attrs[0], + .map_idx = &attrs_idx }, { .str = "port-id", .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_PORT_ID), - .bitmap = &flow_actions + .map = &flow_actions[0], + .map_idx = &actions_idx }, { .str = "rss", .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_RSS), - .bitmap = &flow_actions + .map = &flow_actions[0], + .map_idx = &actions_idx }, { .str = "queue", .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_QUEUE), - .bitmap = &flow_actions + .map = &flow_actions[0], + .map_idx = &actions_idx }, { .str = "jump", .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_JUMP), - .bitmap = &flow_actions + .map = &flow_actions[0], + .map_idx = &actions_idx }, { .str = "mark", .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_MARK), - .bitmap = &flow_actions + .map = &flow_actions[0], + .map_idx = &actions_idx }, { .str = "count", .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_COUNT), - .bitmap = &flow_actions + .map = &flow_actions[0], + .map_idx = &actions_idx }, { .str = "set-meta", .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_SET_META), - .bitmap = &flow_actions + .map = &flow_actions[0], + .map_idx = &actions_idx }, { .str = "set-tag", .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_SET_TAG), - .bitmap = &flow_actions + .map = &flow_actions[0], + .map_idx = &actions_idx }, { .str = "drop", .mask = FLOW_ACTION_MASK(RTE_FLOW_ACTION_TYPE_DROP), - .bitmap = &flow_actions + .map = &flow_actions[0], + .map_idx = &actions_idx } }; @@ -320,9 +348,6 @@ args_parse(int argc, char **argv) { "hairpin-rss", 1, 0, 0 }, }; - flow_items = 0; - flow_actions = 0; - flow_attrs = 0; hairpin_queues_num = 0; argvopt = argv; @@ -349,7 +374,8 @@ args_parse(int argc, char **argv) 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].map[ + (*flow_options[i].map_idx)++] = flow_options[i].mask; printf("%s / ", flow_options[i].str); } @@ -363,7 +389,8 @@ args_parse(int argc, char **argv) rte_exit(EXIT_SUCCESS, "Hairpin queues should be > 0\n"); - flow_actions |= HAIRPIN_RSS_ACTION; + flow_actions[actions_idx++] = + HAIRPIN_RSS_ACTION; printf("hairpin-rss / "); } if (strcmp(lgopts[opt_idx].name, @@ -375,7 +402,8 @@ args_parse(int argc, char **argv) rte_exit(EXIT_SUCCESS, "Hairpin queues should be > 0\n"); - flow_actions |= HAIRPIN_QUEUE_ACTION; + flow_actions[actions_idx++] = + HAIRPIN_QUEUE_ACTION; printf("hairpin-queue / "); } @@ -558,6 +586,11 @@ flows_handler(void) int port_id; int iter_id; uint32_t flow_index; + uint64_t global_items[MAX_ITEMS_NUM] = { 0 }; + uint64_t global_actions[MAX_ACTIONS_NUM] = { 0 }; + + global_items[0] = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_ETH); + global_actions[0] = FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_JUMP); nr_ports = rte_eth_dev_count_avail(); @@ -587,8 +620,7 @@ flows_handler(void) * */ flow = generate_flow(port_id, 0, flow_attrs, - FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_ETH), - FLOW_ITEM_MASK(RTE_FLOW_ACTION_TYPE_JUMP), + global_items, global_actions, flow_group, 0, 0, &error); if (flow == NULL) { diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst index a19ec6db2b..d3ba4cd1d0 100644 --- a/doc/guides/rel_notes/release_20_08.rst +++ b/doc/guides/rel_notes/release_20_08.rst @@ -272,6 +272,14 @@ New Features of ingress packets to specific NIC queues. See the :doc:`../sample_app_ug/ipsec_secgw` for more details. +* **Add more support for flow-perf application.** + + * Start supporting user order instead of bit mask: + Now the user can create any structure of rte_flow + using flow performance application with any order, + moreover the app also now starts to support inner + items matching as well. + Removed Items ------------- diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst index ca551aee6e..6941155fee 100644 --- a/doc/guides/tools/flow-perf.rst +++ b/doc/guides/tools/flow-perf.rst @@ -16,20 +16,18 @@ 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 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. + 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. - -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 -- 2.17.1