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 08/13] app/flow-perf: add VXLAN encap/decap actions support
Date: Sun, 30 Aug 2020 11:15:39 +0000 [thread overview]
Message-ID: <20200830111544.4190-9-wisamm@mellanox.com> (raw)
In-Reply-To: <20200830111544.4190-1-wisamm@mellanox.com>
Introduce vxlan-encap and vxlan-decap actions.
vxlan-encap have fixed pattern and values for
encap data.
Usage example:
--vxlan-encap
--vxlan-decap
Signed-off-by: Wisam Jaddo <wisamm@mellanox.com>
Acked-by: Alexander Kozyrev <akozyrev@nvidia.com>
---
app/test-flow-perf/actions_gen.c | 64 ++++++++++++++++++++++++++
app/test-flow-perf/main.c | 22 +++++++++
doc/guides/rel_notes/release_20_08.rst | 1 +
doc/guides/tools/flow-perf.rst | 8 ++++
4 files changed, 95 insertions(+)
diff --git a/app/test-flow-perf/actions_gen.c b/app/test-flow-perf/actions_gen.c
index 3ae6059fb1..10ddef4deb 100644
--- a/app/test-flow-perf/actions_gen.c
+++ b/app/test-flow-perf/actions_gen.c
@@ -17,6 +17,7 @@
#include "flow_gen.h"
#include "config.h"
+
/* Storage for additional parameters for actions */
struct additional_para {
uint16_t queue;
@@ -750,6 +751,57 @@ add_raw_decap(struct rte_flow_action *actions,
actions[actions_counter].conf = &action_decap_data->conf;
}
+static void
+add_vxlan_encap(struct rte_flow_action *actions,
+ uint8_t actions_counter,
+ __rte_unused struct additional_para para)
+{
+ static struct rte_flow_action_vxlan_encap vxlan_encap;
+ static struct rte_flow_item items[5];
+ static struct rte_flow_item_eth item_eth;
+ static struct rte_flow_item_ipv4 item_ipv4;
+ static struct rte_flow_item_udp item_udp;
+ static struct rte_flow_item_vxlan item_vxlan;
+
+ items[0].spec = &item_eth;
+ items[0].mask = &item_eth;
+ items[0].type = RTE_FLOW_ITEM_TYPE_ETH;
+
+ item_ipv4.hdr.src_addr = RTE_IPV4(127, 0, 0, 1);
+ item_ipv4.hdr.dst_addr = RTE_IPV4(255, 255, 255, 255);
+ item_ipv4.hdr.version_ihl = RTE_IPV4_VHL_DEF;
+ items[1].spec = &item_ipv4;
+ items[1].mask = &item_ipv4;
+ items[1].type = RTE_FLOW_ITEM_TYPE_IPV4;
+
+
+ item_udp.hdr.dst_port = RTE_BE16(RTE_VXLAN_DEFAULT_PORT);
+ items[2].spec = &item_udp;
+ items[2].mask = &item_udp;
+ items[2].type = RTE_FLOW_ITEM_TYPE_UDP;
+
+
+ item_vxlan.vni[2] = 1;
+ items[3].spec = &item_vxlan;
+ items[3].mask = &item_vxlan;
+ items[3].type = RTE_FLOW_ITEM_TYPE_VXLAN;
+
+ items[4].type = RTE_FLOW_ITEM_TYPE_END;
+
+ vxlan_encap.definition = items;
+
+ actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP;
+ actions[actions_counter].conf = &vxlan_encap;
+}
+
+static void
+add_vxlan_decap(struct rte_flow_action *actions,
+ uint8_t actions_counter,
+ __rte_unused struct additional_para para)
+{
+ actions[actions_counter].type = RTE_FLOW_ACTION_TYPE_VXLAN_DECAP;
+}
+
void
fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions,
uint32_t counter, uint16_t next_table, uint16_t hairpinq,
@@ -949,6 +1001,18 @@ fill_actions(struct rte_flow_action *actions, uint64_t *flow_actions,
),
.funct = add_raw_decap,
},
+ {
+ .mask = FLOW_ACTION_MASK(
+ RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP
+ ),
+ .funct = add_vxlan_encap,
+ },
+ {
+ .mask = FLOW_ACTION_MASK(
+ RTE_FLOW_ACTION_TYPE_VXLAN_DECAP
+ ),
+ .funct = add_vxlan_decap,
+ },
};
for (j = 0; j < MAX_ACTIONS_NUM; j++) {
diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index 1b456e6922..0a030a462c 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -180,6 +180,10 @@ usage(char *progname)
printf(" --raw-decap=<data>: add raw decap action to flow actions\n"
"Data is the data needed to be decaped\n"
"Example: raw-decap=ether,ipv4,udp,vxlan\n");
+ printf(" --vxlan-encap: add vxlan-encap action to flow actions\n"
+ "Encapped data is fixed with pattern: ether,ipv4,udp,vxlan\n"
+ "With fixed values\n");
+ printf(" --vxlan-decap: add vxlan_decap action to flow actions\n");
}
static void
@@ -484,6 +488,22 @@ args_parse(int argc, char **argv)
.map = &flow_actions[0],
.map_idx = &actions_idx
},
+ {
+ .str = "vxlan-encap",
+ .mask = FLOW_ACTION_MASK(
+ RTE_FLOW_ACTION_TYPE_VXLAN_ENCAP
+ ),
+ .map = &flow_actions[0],
+ .map_idx = &actions_idx
+ },
+ {
+ .str = "vxlan-decap",
+ .mask = FLOW_ACTION_MASK(
+ RTE_FLOW_ACTION_TYPE_VXLAN_DECAP
+ ),
+ .map = &flow_actions[0],
+ .map_idx = &actions_idx
+ },
};
static const struct option lgopts[] = {
@@ -544,6 +564,8 @@ args_parse(int argc, char **argv)
{ "flag", 0, 0, 0 },
{ "raw-encap", 1, 0, 0 },
{ "raw-decap", 1, 0, 0 },
+ { "vxlan-encap", 0, 0, 0 },
+ { "vxlan-decap", 0, 0, 0 },
};
hairpin_queues_num = 0;
diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst
index 5a94eacded..c0f7ab6293 100644
--- a/doc/guides/rel_notes/release_20_08.rst
+++ b/doc/guides/rel_notes/release_20_08.rst
@@ -283,6 +283,7 @@ New Features
* Start supporting header modify actions.
* Start supporting flag action.
* Start supporting raw-encap and raw-decap actions.
+ * Start supporting vxlan-encap and vxlan-decap actions.
Removed Items
diff --git a/doc/guides/tools/flow-perf.rst b/doc/guides/tools/flow-perf.rst
index 10c0c422e4..15b4273cc0 100644
--- a/doc/guides/tools/flow-perf.rst
+++ b/doc/guides/tools/flow-perf.rst
@@ -316,3 +316,11 @@ Actions:
Add raw decap action to all flows actions.
Data is the data needed to be decaped, with fixed values.
Example: raw-decap=ether,ipv4,gre
+
+* ``--vxlan-encap``
+ Add vxlan encap action to all flows actions.
+ Data to encap is fixed with pattern: ether,ipv4,udp,vxlan,
+ all encapped items have fixed values.
+
+* ``--vxlan-decap``
+ Add vxlan decap action to all flows actions.
--
2.17.1
next prev parent reply other threads:[~2020-08-30 11:22 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 ` Wisam Jaddo [this message]
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 ` [dpdk-dev] [PATCH 12/13] app/flow-perf: add icmp matching support Wisam Jaddo
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-9-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).