From: Bernard Iremonger Date: Thu, 16 Jan 2020 12:44:48 +0000 (+0000) Subject: app/testpmd: parse flow command line for ESP X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6a42e7ef9dd86a554e060fcef0be03aa9ddd394c;p=dpdk.git app/testpmd: parse flow command line for ESP add ITEM_ESP add ITEM_ESP_SPI update release notes for testpmd changes add sample ESP rules in testpmd guide Signed-off-by: Bernard Iremonger Acked-by: Ori Kam --- diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 33ba1d7bb0..f7e0a62203 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -215,6 +215,8 @@ enum index { ITEM_TAG_INDEX, ITEM_L2TPV3OIP, ITEM_L2TPV3OIP_SESSION_ID, + ITEM_ESP, + ITEM_ESP_SPI, /* Validate/create actions. */ ACTIONS, @@ -753,6 +755,7 @@ static const enum index next_item[] = { ITEM_HIGIG2, ITEM_TAG, ITEM_L2TPV3OIP, + ITEM_ESP, END_SET, ZERO, }; @@ -1024,6 +1027,12 @@ static const enum index item_higig2[] = { ZERO, }; +static const enum index item_esp[] = { + ITEM_ESP_SPI, + ITEM_NEXT, + ZERO, +}; + static const enum index next_set_raw[] = { SET_RAW_INDEX, ITEM_ETH, @@ -2635,7 +2644,20 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_l2tpv3oip, session_id)), }, - + [ITEM_ESP] = { + .name = "esp", + .help = "match ESP header", + .priv = PRIV_ITEM(ESP, sizeof(struct rte_flow_item_esp)), + .next = NEXT(item_esp), + .call = parse_vc, + }, + [ITEM_ESP_SPI] = { + .name = "spi", + .help = "security policy index", + .next = NEXT(item_esp, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_esp, + hdr.spi)), + }, /* Validate/create actions. */ [ACTIONS] = { .name = "actions", @@ -6305,9 +6327,6 @@ flow_item_default_mask(const struct rte_flow_item *item) case RTE_FLOW_ITEM_TYPE_GTP: mask = &rte_flow_item_gtp_mask; break; - case RTE_FLOW_ITEM_TYPE_ESP: - mask = &rte_flow_item_esp_mask; - break; case RTE_FLOW_ITEM_TYPE_GTP_PSC: mask = &rte_flow_item_gtp_psc_mask; break; @@ -6320,6 +6339,9 @@ flow_item_default_mask(const struct rte_flow_item *item) case RTE_FLOW_ITEM_TYPE_L2TPV3OIP: mask = &rte_flow_item_l2tpv3oip_mask; break; + case RTE_FLOW_ITEM_TYPE_ESP: + mask = &rte_flow_item_esp_mask; + break; default: break; } @@ -6413,6 +6435,10 @@ cmd_set_raw_parsed(const struct buffer *in) size = sizeof(struct rte_flow_item_l2tpv3oip); proto = 0x73; break; + case RTE_FLOW_ITEM_TYPE_ESP: + size = sizeof(struct rte_flow_item_esp); + proto = 0x32; + break; default: printf("Error - Not supported item\n"); *total_size = 0; diff --git a/doc/guides/rel_notes/release_20_02.rst b/doc/guides/rel_notes/release_20_02.rst index f26f278f66..17b8cdc452 100644 --- a/doc/guides/rel_notes/release_20_02.rst +++ b/doc/guides/rel_notes/release_20_02.rst @@ -83,9 +83,9 @@ New Features * Added support for RSS using L3/L4 source/destination only. -* **Updated testpmd to support L2TPv3 over IP flows.** +* **Updated testpmd application.** - Added support for L2TPv3 over IP rte_flow patterns to the testpmd + Added support for ESP and L2TPv3 over IP rte_flow patterns to the testpmd application. * **Added algorithms to cryptodev API.** diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 4e56e075f1..7f4564cf10 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -4778,6 +4778,20 @@ Decapsulating VxLAN:: testpmd> flow create 0 ingress pattern eth / ipv4 / udp / vxlan / eth / ipv4 / end actions raw_decap / queue index 0 / end +Sample ESP rules +~~~~~~~~~~~~~~~~ + +ESP rules can be created by the following commands:: + + testpmd> flow create 0 ingress pattern eth / ipv4 / esp spi is 1 / end actions + queue index 3 / end + testpmd> flow create 0 ingress pattern eth / ipv4 / udp / esp spi is 1 / end + actions queue index 3 / end + testpmd> flow create 0 ingress pattern eth / ipv6 / esp spi is 1 / end actions + queue index 3 / end + testpmd> flow create 0 ingress pattern eth / ipv6 / udp / esp spi is 1 / end + actions queue index 3 / end + BPF Functions --------------