[33/62] net/sfc: support flow action MARK in MAE backend

Message ID 1603183709-23420-34-git-send-email-arybchenko@solarflare.com (mailing list archive)
State Superseded, archived
Headers
Series net/sfc: support flow API transfer rules |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Oct. 20, 2020, 8:48 a.m. UTC
  From: Ivan Malov <ivan.malov@oktetlabs.ru>

The action handler will use MAE action MARK.

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 doc/guides/nics/sfc_efx.rst |  2 ++
 drivers/net/sfc/sfc_mae.c   | 12 ++++++++++++
 2 files changed, 14 insertions(+)
  

Patch

diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst
index 2ddfd0c957..ff0d094068 100644
--- a/doc/guides/nics/sfc_efx.rst
+++ b/doc/guides/nics/sfc_efx.rst
@@ -206,6 +206,8 @@  Supported actions (***transfer*** rules):
 
 - FLAG
 
+- MARK
+
 - PHY_PORT
 
 Validating flow rules depends on the firmware variant.
diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index af961ceffe..1e7a368303 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -580,6 +580,13 @@  sfc_mae_rule_parse_action_of_set_vlan_pcp(
 	bundle->vlan_push_tci |= rte_cpu_to_be_16(vlan_tci_pcp);
 }
 
+static int
+sfc_mae_rule_parse_action_mark(const struct rte_flow_action_mark *conf,
+			       efx_mae_actions_t *spec)
+{
+	return efx_mae_action_set_populate_mark(spec, conf->id);
+}
+
 static int
 sfc_mae_rule_parse_action_phy_port(struct sfc_adapter *sa,
 				   const struct rte_flow_action_phy_port *conf,
@@ -636,6 +643,11 @@  sfc_mae_rule_parse_action(struct sfc_adapter *sa,
 				       bundle->actions_mask);
 		rc = efx_mae_action_set_populate_flag(spec);
 		break;
+	case RTE_FLOW_ACTION_TYPE_MARK:
+		SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_MARK,
+				       bundle->actions_mask);
+		rc = sfc_mae_rule_parse_action_mark(action->conf, spec);
+		break;
 	case RTE_FLOW_ACTION_TYPE_PHY_PORT:
 		SFC_BUILD_SET_OVERFLOW(RTE_FLOW_ACTION_TYPE_PHY_PORT,
 				       bundle->actions_mask);