summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorXiaoyu Min <jackmin@mellanox.com>2018-10-16 08:14:27 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-18 10:24:39 +0200
commit708d0bcb72c2f70432e782de754984c8f4255301 (patch)
tree360813caf450b8b59ff66a0df2ef2fa9e3bd4408 /app
parent6f1c2168bccb7b281cd7d0ddd5f9291c538f6489 (diff)
downloaddpdk-708d0bcb72c2f70432e782de754984c8f4255301.zip
dpdk-708d0bcb72c2f70432e782de754984c8f4255301.tar.gz
dpdk-708d0bcb72c2f70432e782de754984c8f4255301.tar.xz
app/testpmd: add commands to modify TTL
add commands which supports following TTL actions: - RTE_FLOW_ACTION_TYPE_DEC_TTL - RTE_FLOW_ACTION_TYPE_SET_TTL Signed-off-by: Xiaoyu Min <jackmin@mellanox.com> Acked-by: Yongseok Koh <yskoh@mellanox.com>
Diffstat (limited to 'app')
-rw-r--r--app/test-pmd/cmdline_flow.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 4a27642..3efc2d8 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -256,6 +256,9 @@ enum index {
ACTION_SET_TP_DST,
ACTION_SET_TP_DST_TP_DST,
ACTION_MAC_SWAP,
+ ACTION_DEC_TTL,
+ ACTION_SET_TTL,
+ ACTION_SET_TTL_TTL,
};
/** Maximum size for pattern in struct rte_flow_item_raw. */
@@ -836,6 +839,8 @@ static const enum index next_action[] = {
ACTION_SET_TP_SRC,
ACTION_SET_TP_DST,
ACTION_MAC_SWAP,
+ ACTION_DEC_TTL,
+ ACTION_SET_TTL,
ZERO,
};
@@ -974,6 +979,12 @@ static const enum index action_set_tp_dst[] = {
ZERO,
};
+static const enum index action_set_ttl[] = {
+ ACTION_SET_TTL_TTL,
+ ACTION_NEXT,
+ ZERO,
+};
+
static const enum index action_jump[] = {
ACTION_JUMP_GROUP,
ACTION_NEXT,
@@ -2636,6 +2647,29 @@ static const struct token token_list[] = {
.next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
.call = parse_vc,
},
+ [ACTION_DEC_TTL] = {
+ .name = "dec_ttl",
+ .help = "decrease network TTL if available",
+ .priv = PRIV_ACTION(DEC_TTL, 0),
+ .next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+ .call = parse_vc,
+ },
+ [ACTION_SET_TTL] = {
+ .name = "set_ttl",
+ .help = "set ttl value",
+ .priv = PRIV_ACTION(SET_TTL,
+ sizeof(struct rte_flow_action_set_ttl)),
+ .next = NEXT(action_set_ttl),
+ .call = parse_vc,
+ },
+ [ACTION_SET_TTL_TTL] = {
+ .name = "ttl_value",
+ .help = "new ttl value to set",
+ .next = NEXT(action_set_ttl, NEXT_ENTRY(UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY_HTON
+ (struct rte_flow_action_set_ttl, ttl_value)),
+ .call = parse_vc_conf,
+ },
};
/** Remove and return last entry from argument stack. */