net/sfc: support flow action mark in MAE backend
authorIvan Malov <ivan.malov@oktetlabs.ru>
Tue, 20 Oct 2020 09:13:13 +0000 (10:13 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:24:25 +0000 (23:24 +0100)
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
drivers/net/sfc/sfc_mae.c

index e185c95..c9ef02e 100644 (file)
@@ -206,6 +206,8 @@ Supported actions (***transfer*** rules):
 
 - FLAG
 
+- MARK
+
 - PHY_PORT
 
 Validating flow rules depends on the firmware variant.
index af961ce..1e7a368 100644 (file)
@@ -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);