From: Roman Zhukov Date: Fri, 1 Dec 2017 10:43:16 +0000 (+0000) Subject: app/testpmd: support GENEVE pattern item in flow rules X-Git-Tag: spdx-start~594 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0f4203fe9d18339a3dc75c606481e005670c4ad4;p=dpdk.git app/testpmd: support GENEVE pattern item in flow rules Add the ability to match VNI and protocol fields of GENEVE protocol header. Signed-off-by: Roman Zhukov Signed-off-by: Andrew Rybchenko Acked-by: Adrien Mazarguil --- diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index df16d2ab90..561e0579a5 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -175,6 +175,9 @@ enum index { ITEM_GTP_TEID, ITEM_GTPC, ITEM_GTPU, + ITEM_GENEVE, + ITEM_GENEVE_VNI, + ITEM_GENEVE_PROTO, /* Validate/create actions. */ ACTIONS, @@ -460,6 +463,7 @@ static const enum index next_item[] = { ITEM_GTP, ITEM_GTPC, ITEM_GTPU, + ITEM_GENEVE, ZERO, }; @@ -603,6 +607,13 @@ static const enum index item_gtp[] = { ZERO, }; +static const enum index item_geneve[] = { + ITEM_GENEVE_VNI, + ITEM_GENEVE_PROTO, + ITEM_NEXT, + ZERO, +}; + static const enum index next_action[] = { ACTION_END, ACTION_VOID, @@ -1470,6 +1481,26 @@ static const struct token token_list[] = { .next = NEXT(item_gtp), .call = parse_vc, }, + [ITEM_GENEVE] = { + .name = "geneve", + .help = "match GENEVE header", + .priv = PRIV_ITEM(GENEVE, sizeof(struct rte_flow_item_geneve)), + .next = NEXT(item_geneve), + .call = parse_vc, + }, + [ITEM_GENEVE_VNI] = { + .name = "vni", + .help = "virtual network identifier", + .next = NEXT(item_geneve, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve, vni)), + }, + [ITEM_GENEVE_PROTO] = { + .name = "protocol", + .help = "GENEVE protocol type", + .next = NEXT(item_geneve, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_geneve, + protocol)), + }, /* Validate/create actions. */ [ACTIONS] = { diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index bae2f5a2a2..46119bb750 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1005,6 +1005,7 @@ static const struct { MK_FLOW_ITEM(GTP, sizeof(struct rte_flow_item_gtp)), MK_FLOW_ITEM(GTPC, sizeof(struct rte_flow_item_gtp)), MK_FLOW_ITEM(GTPU, sizeof(struct rte_flow_item_gtp)), + MK_FLOW_ITEM(GENEVE, sizeof(struct rte_flow_item_geneve)), }; /** Compute storage space needed by item specification. */ diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 478c6555b1..8721a68ced 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3278,6 +3278,11 @@ This section lists supported pattern items and their attributes, if any. - ``teid {unsigned}``: tunnel endpoint identifier. +- ``geneve``: match GENEVE header. + + - ``vni {unsigned}``: virtual network identifier. + - ``protocol {unsigned}``: protocol type. + Actions list ^^^^^^^^^^^^