summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>2018-10-09 14:14:37 +0530
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-11 18:53:49 +0200
commit9ccc94919500c8ebfe39c00627ecb1bfe130f7f0 (patch)
tree7c0109ab49d0b90afc5e39f0bab22e0c2ba1cad6 /app
parent0517eea7612a34d24348d7d6f14e31cb9794ad16 (diff)
downloaddpdk-9ccc94919500c8ebfe39c00627ecb1bfe130f7f0.zip
dpdk-9ccc94919500c8ebfe39c00627ecb1bfe130f7f0.tar.gz
dpdk-9ccc94919500c8ebfe39c00627ecb1bfe130f7f0.tar.xz
ethdev: add flow API actions to modify TCP/UDP port numbers
Add actions: - SET_TP_SRC - set a new TCP/UDP source port number. - SET_TP_DST - set a new TCP/UDP destination port number. Original work by Shagun Agrawal Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com> Acked-by: Xiaoyu Min <jackmin@mellanox.com> Acked-by: Ori Kam <orika@mellanox.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Diffstat (limited to 'app')
-rw-r--r--app/test-pmd/cmdline_flow.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 1432498..a9888ca 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -251,6 +251,10 @@ enum index {
ACTION_SET_IPV6_SRC_IPV6_SRC,
ACTION_SET_IPV6_DST,
ACTION_SET_IPV6_DST_IPV6_DST,
+ ACTION_SET_TP_SRC,
+ ACTION_SET_TP_SRC_TP_SRC,
+ ACTION_SET_TP_DST,
+ ACTION_SET_TP_DST_TP_DST,
};
/** Maximum size for pattern in struct rte_flow_item_raw. */
@@ -828,6 +832,8 @@ static const enum index next_action[] = {
ACTION_SET_IPV4_DST,
ACTION_SET_IPV6_SRC,
ACTION_SET_IPV6_DST,
+ ACTION_SET_TP_SRC,
+ ACTION_SET_TP_DST,
ZERO,
};
@@ -954,6 +960,18 @@ static const enum index action_set_ipv6_dst[] = {
ZERO,
};
+static const enum index action_set_tp_src[] = {
+ ACTION_SET_TP_SRC_TP_SRC,
+ ACTION_NEXT,
+ ZERO,
+};
+
+static const enum index action_set_tp_dst[] = {
+ ACTION_SET_TP_DST_TP_DST,
+ ACTION_NEXT,
+ ZERO,
+};
+
static const enum index action_jump[] = {
ACTION_JUMP_GROUP,
ACTION_NEXT,
@@ -2574,6 +2592,40 @@ static const struct token token_list[] = {
(struct rte_flow_action_set_ipv6, ipv6_addr)),
.call = parse_vc_conf,
},
+ [ACTION_SET_TP_SRC] = {
+ .name = "set_tp_src",
+ .help = "set a new source port number in the outermost"
+ " TCP/UDP header",
+ .priv = PRIV_ACTION(SET_TP_SRC,
+ sizeof(struct rte_flow_action_set_tp)),
+ .next = NEXT(action_set_tp_src),
+ .call = parse_vc,
+ },
+ [ACTION_SET_TP_SRC_TP_SRC] = {
+ .name = "port",
+ .help = "new source port number to set",
+ .next = NEXT(action_set_tp_src, NEXT_ENTRY(UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY_HTON
+ (struct rte_flow_action_set_tp, port)),
+ .call = parse_vc_conf,
+ },
+ [ACTION_SET_TP_DST] = {
+ .name = "set_tp_dst",
+ .help = "set a new destination port number in the outermost"
+ " TCP/UDP header",
+ .priv = PRIV_ACTION(SET_TP_DST,
+ sizeof(struct rte_flow_action_set_tp)),
+ .next = NEXT(action_set_tp_dst),
+ .call = parse_vc,
+ },
+ [ACTION_SET_TP_DST_TP_DST] = {
+ .name = "port",
+ .help = "new destination port number to set",
+ .next = NEXT(action_set_tp_dst, NEXT_ENTRY(UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY_HTON
+ (struct rte_flow_action_set_tp, port)),
+ .call = parse_vc_conf,
+ },
};
/** Remove and return last entry from argument stack. */