From e7de2bcbe81612c156eedc365b6a9bae10cc8f73 Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Tue, 20 Oct 2020 10:13:13 +0100 Subject: [PATCH] net/sfc: support flow action mark in MAE backend The action handler will use MAE action MARK. Signed-off-by: Ivan Malov Signed-off-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- doc/guides/nics/sfc_efx.rst | 2 ++ drivers/net/sfc/sfc_mae.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/doc/guides/nics/sfc_efx.rst b/doc/guides/nics/sfc_efx.rst index e185c951b1..c9ef02e5b1 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); -- 2.20.1