[v2,10/10] net/sfc: support action VXLAN DECAP in transfer rules

Message ID 20210312110745.31721-10-ivan.malov@oktetlabs.ru (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [v2,01/10] ethdev: reuse header definition in flow pattern item ETH |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success travis build: passed
ci/github-robot success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-intel-Performance fail Performance Testing issues
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/intel-Testing success Testing PASS

Commit Message

Ivan Malov March 12, 2021, 11:07 a.m. UTC
  If there is no VXLAN among pattern items, the action will be turned down.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc_mae.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index 79a1bd91d..1d67a4be2 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -2501,6 +2501,7 @@  sfc_mae_rule_parse_action_port_id(struct sfc_adapter *sa,
 static int
 sfc_mae_rule_parse_action(struct sfc_adapter *sa,
 			  const struct rte_flow_action *action,
+			  const struct sfc_mae_outer_rule *outer_rule,
 			  struct sfc_mae_actions_bundle *bundle,
 			  efx_mae_actions_t *spec,
 			  struct rte_flow_error *error)
@@ -2509,6 +2510,15 @@  sfc_mae_rule_parse_action(struct sfc_adapter *sa,
 	int rc = 0;
 
 	switch (action->type) {
+	case RTE_FLOW_ACTION_TYPE_VXLAN_DECAP:
+		SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_VXLAN_DECAP,
+				       bundle->actions_mask);
+		if (outer_rule == NULL ||
+		    outer_rule->encap_type != EFX_TUNNEL_PROTOCOL_VXLAN)
+			rc = EINVAL;
+		else
+			rc = efx_mae_action_set_populate_decap(spec);
+		break;
 	case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN:
 		SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_OF_POP_VLAN,
 				       bundle->actions_mask);
@@ -2643,8 +2653,8 @@  sfc_mae_rule_parse_actions(struct sfc_adapter *sa,
 		if (rc != 0)
 			goto fail_rule_parse_action;
 
-		rc = sfc_mae_rule_parse_action(sa, action, &bundle, spec,
-					       error);
+		rc = sfc_mae_rule_parse_action(sa, action, spec_mae->outer_rule,
+					       &bundle, spec, error);
 		if (rc != 0)
 			goto fail_rule_parse_action;
 	}