From: Wisam Jaddo <wisamm@mellanox.com>
To: dev@dpdk.org, thomas@monjalon.net, asafp@mellanox.com,
akozyrev@nvidia.com, akozyrev@mellanox.com,
arybchenko@solarflare.com, jackmin@mellanox.com
Subject: [dpdk-dev] [PATCH 12/13] app/flow-perf: add icmp matching support
Date: Sun, 30 Aug 2020 11:15:43 +0000 [thread overview]
Message-ID: <20200830111544.4190-13-wisamm@mellanox.com> (raw)
In-Reply-To: <20200830111544.4190-1-wisamm@mellanox.com>
Start support matching on icmpv4 and icmpv6.
Usage:
--icmpv4: add icmp item to match on.
--icmpv6: add icmpv6 item to match on.
Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
app/test-flow-perf/items_gen.c | 41 +++++++++++++++++++++++++-
app/test-flow-perf/main.c | 16 ++++++++++
doc/guides/rel_notes/release_20_08.rst | 2 ++
doc/guides/tools/flow-perf.rst | 6 ++++
4 files changed, 64 insertions(+), 1 deletion(-)
diff --git a/app/test-flow-perf/items_gen.c b/app/test-flow-perf/items_gen.c
index 8277ac70da..2b1ab41467 100644
--- a/app/test-flow-perf/items_gen.c
+++ b/app/test-flow-perf/items_gen.c
@@ -310,6 +310,38 @@ add_meta_tag(struct rte_flow_item *items,
items[items_counter].mask = &tag_mask;
}
+static void
+add_icmpv4(struct rte_flow_item *items,
+ uint8_t items_counter,
+ __rte_unused struct additional_para para)
+{
+ static struct rte_flow_item_icmp icmpv4_spec;
+ static struct rte_flow_item_icmp icmpv4_mask;
+
+ memset(&icmpv4_spec, 0, sizeof(struct rte_flow_item_icmp));
+ memset(&icmpv4_mask, 0, sizeof(struct rte_flow_item_icmp));
+
+ items[items_counter].type = RTE_FLOW_ITEM_TYPE_ICMP;
+ items[items_counter].spec = &icmpv4_spec;
+ items[items_counter].mask = &icmpv4_mask;
+}
+
+static void
+add_icmpv6(struct rte_flow_item *items,
+ uint8_t items_counter,
+ __rte_unused struct additional_para para)
+{
+ static struct rte_flow_item_icmp6 icmpv6_spec;
+ static struct rte_flow_item_icmp6 icmpv6_mask;
+
+ memset(&icmpv6_spec, 0, sizeof(struct rte_flow_item_icmp6));
+ memset(&icmpv6_mask, 0, sizeof(struct rte_flow_item_icmp6));
+
+ items[items_counter].type = RTE_FLOW_ITEM_TYPE_ICMP6;
+ items[items_counter].spec = &icmpv6_spec;
+ items[items_counter].mask = &icmpv6_mask;
+}
+
void
fill_items(struct rte_flow_item *items,
uint64_t *flow_items, uint32_t outer_ip_src)
@@ -381,7 +413,14 @@ fill_items(struct rte_flow_item *items,
.mask = RTE_FLOW_ITEM_TYPE_GTP,
.funct = add_gtp,
},
-
+ {
+ .mask = RTE_FLOW_ITEM_TYPE_ICMP,
+ .funct = add_icmpv4,
+ },
+ {
+ .mask = RTE_FLOW_ITEM_TYPE_ICMP6,
+ .funct = add_icmpv6,
+ },
};
for (j = 0; j < MAX_ITEMS_NUM; j++) {
diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 18199c6e2e..c420da6a57 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -130,6 +130,8 @@ usage(char *progname)
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(" --icmpv4: add icmpv4 layer in flow items\n");
+ printf(" --icmpv6: add icmpv6 layer in flow items\n");
printf("To set flow actions:\n");
printf(" --port-id: add port-id action in flow actions\n");
@@ -284,6 +286,18 @@ args_parse(int argc, char **argv)
.map = &flow_items[0],
.map_idx = &items_idx
},
+ {
+ .str = "icmpv4",
+ .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_ICMP),
+ .map = &flow_items[0],
+ .map_idx = &items_idx
+ },
+ {
+ .str = "icmpv6",
+ .mask = FLOW_ITEM_MASK(RTE_FLOW_ITEM_TYPE_ICMP6),
+ .map = &flow_items[0],
+ .map_idx = &items_idx
+ },
{
.str = "ingress",
.mask = INGRESS,
@@ -538,6 +552,8 @@ args_parse(int argc, char **argv)
{ "gtp", 0, 0, 0 },
{ "meta", 0, 0, 0 },
{ "tag", 0, 0, 0 },
+ { "icmpv4", 0, 0, 0 },
+ { "icmpv6", 0, 0, 0 },
/* Actions */
{ "port-id", 0, 0, 0 },
{ "rss", 0, 0, 0 },
diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst
index b21f0bfb03..03eb4948e0 100644
--- a/doc/guides/rel_notes/release_20_08.rst
+++ b/doc/guides/rel_notes/release_20_08.rst
@@ -287,6 +287,8 @@ New Features
* Add new option to set portmask for insertion/deletion:
``--portmask=N`` Where N represent the hexadecimal
bitmask of ports used.
+ * Start supporting icmp and icmp6 matching items.
+
Removed Items
-------------
diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst
index bbefc978c6..7e5dc0c54b 100644
--- a/doc/guides/tools/flow-perf.rst
+++ b/doc/guides/tools/flow-perf.rst
@@ -175,6 +175,12 @@ Items:
under ``TAG_INDEX`` with full mask, default value = 0.
Other fields are open mask.
+* ``--icmpv4``
+ Add icmpv4 item to all flows items, This item have open mask.
+
+* ``--icmpv6``
+ Add icmpv6 item to all flows items, This item have open mask.
+
Actions:
--
2.17.1
next prev parent reply other threads:[~2020-08-30 11:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-30 11:15 [dpdk-dev] [PATCH 00/13] app/flow-perf: add support for new items/actions Wisam Jaddo
2020-08-30 11:15 ` [dpdk-dev] [PATCH 01/13] app/flow-perf: fix actions mask macro usage Wisam Jaddo
2020-08-30 11:15 ` [dpdk-dev] [PATCH 02/13] doc/flow-perf: fix app sections Wisam Jaddo
2020-08-30 11:15 ` [dpdk-dev] [PATCH 03/13] app/flow-perf: start supporting user order Wisam Jaddo
2020-08-30 11:15 ` [dpdk-dev] [PATCH 04/13] app/flow-perf: add header modify actions support Wisam Jaddo
2020-08-30 11:15 ` [dpdk-dev] [PATCH 05/13] app/flow-perf: add flag action support Wisam Jaddo
2020-08-30 11:15 ` [dpdk-dev] [PATCH 06/13] app/flow-perf: fix memory leak from RSS action Wisam Jaddo
2020-08-30 11:15 ` [dpdk-dev] [PATCH 07/13] app/flow-perf: add raw encap/decap actions support Wisam Jaddo
2020-08-30 11:15 ` [dpdk-dev] [PATCH 08/13] app/flow-perf: add VXLAN " Wisam Jaddo
2020-08-30 11:15 ` [dpdk-dev] [PATCH 09/13] app/flow-perf: fix source ipv4 matching Wisam Jaddo
2020-08-30 11:15 ` [dpdk-dev] [PATCH 10/13] app/flow-perf: add random mark id values Wisam Jaddo
2020-08-30 11:15 ` [dpdk-dev] [PATCH 11/13] app/flow-perf: add set port mask to options Wisam Jaddo
2020-08-30 11:15 ` Wisam Jaddo [this message]
2020-08-30 11:15 ` [dpdk-dev] [PATCH 13/13] app/flow-perf: allow fixed values for actions Wisam Jaddo
2020-09-14 18:15 ` [dpdk-dev] [PATCH 00/13] app/flow-perf: add support for new items/actions Ferruh Yigit
2020-09-21 21:36 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200830111544.4190-13-wisamm@mellanox.com \
--to=wisamm@mellanox.com \
--cc=akozyrev@mellanox.com \
--cc=akozyrev@nvidia.com \
--cc=arybchenko@solarflare.com \
--cc=asafp@mellanox.com \
--cc=dev@dpdk.org \
--cc=jackmin@mellanox.com \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).