From: Kiran Kumar K <kirankum...@marvell.com> Add support for the following OpenFlow-defined action.
RTE_FLOW_ACTION_TYPE_OF_POP_ETAG: Pop E-tag from the packet. Signed-off-by: Kiran Kumar K <kirankum...@marvell.com> --- app/test-pmd/cmdline_flow.c | 9 +++++++++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 10 +++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 998527590f..c4359e965d 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -652,6 +652,7 @@ enum index { ACTION_METER_STATE, ACTION_OF_DEC_NW_TTL, ACTION_OF_POP_VLAN, + ACTION_OF_POP_ETAG, ACTION_OF_PUSH_VLAN, ACTION_OF_PUSH_VLAN_ETHERTYPE, ACTION_OF_SET_VLAN_VID, @@ -2275,6 +2276,7 @@ static const enum index next_action[] = { ACTION_METER_MARK_CONF, ACTION_OF_DEC_NW_TTL, ACTION_OF_POP_VLAN, + ACTION_OF_POP_ETAG, ACTION_OF_PUSH_VLAN, ACTION_OF_SET_VLAN_VID, ACTION_OF_SET_VLAN_PCP, @@ -6932,6 +6934,13 @@ static const struct token token_list[] = { .next = NEXT(NEXT_ENTRY(ACTION_NEXT)), .call = parse_vc, }, + [ACTION_OF_POP_ETAG] = { + .name = "of_pop_etag", + .help = "OpenFlow's OFPAT_POP_ETAG", + .priv = PRIV_ACTION(OF_POP_ETAG, 0), + .next = NEXT(NEXT_ENTRY(ACTION_NEXT)), + .call = parse_vc, + }, [ACTION_OF_PUSH_VLAN] = { .name = "of_push_vlan", .help = "OpenFlow's OFPAT_PUSH_VLAN", diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 9f8d8f3dc2..765a8b3dbb 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -213,6 +213,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = { MK_FLOW_ACTION(SECURITY, sizeof(struct rte_flow_action_security)), MK_FLOW_ACTION(OF_DEC_NW_TTL, 0), MK_FLOW_ACTION(OF_POP_VLAN, 0), + MK_FLOW_ACTION(OF_POP_ETAG, 0), MK_FLOW_ACTION(OF_PUSH_VLAN, sizeof(struct rte_flow_action_of_push_vlan)), MK_FLOW_ACTION(OF_SET_VLAN_VID, diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 3d2ccdeb92..fb4f4bf9b7 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -3201,7 +3201,7 @@ enum rte_flow_action_type { * @see struct rte_flow_query_quota * @see struct rte_flow_update_quota */ - RTE_FLOW_ACTION_TYPE_QUOTA, + RTE_FLOW_ACTION_TYPE_QUOTA, /** * Skip congestion management configuration. @@ -3263,6 +3263,14 @@ enum rte_flow_action_type { * @see struct rte_flow_action_jump_to_table_index. */ RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX, + + /** + * Implements POP_ETAG ("pop the outer 802.1BR Etag") as defined + * by the OpenFlow Switch Specification. + * + * No associated configuration structure. + */ + RTE_FLOW_ACTION_TYPE_OF_POP_ETAG, }; /** -- 2.48.1