From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 54FE9A0547; Fri, 12 Mar 2021 10:32:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A861160898; Fri, 12 Mar 2021 10:32:01 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 6331E16084A for ; Fri, 12 Mar 2021 10:31:51 +0100 (CET) Received: from localhost.localdomain (unknown [188.242.7.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 1FC467F5BC; Fri, 12 Mar 2021 12:31:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 1FC467F5BC DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1615541511; bh=4c20trM6g6UkeMkSRDEWVIquTZQ2m13BCyNZBDc4rcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rcRA4dx4Ka+Nba/tjLHUeUlRGfZ/9Ryk8KZm/2TkVKjIQEbY9vtqKUn4TMOF9q2Jz MLzVPsz3ii1QcDt5L3N0375N2OpKH3LJEeaKv+aX1r6vjgZ+/3spiPGRp2fl1HfhGA 4alRdHYVGDYa2rUVeb7cvwiWt1C1tnrNZs25fy8g= From: Ivan Malov To: dev@dpdk.org Cc: Andrew Rybchenko , Andy Moreton Date: Fri, 12 Mar 2021 12:31:43 +0300 Message-Id: <20210312093143.28186-10-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210312093143.28186-1-ivan.malov@oktetlabs.ru> References: <20210312093143.28186-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 10/10] net/sfc: support action VXLAN DECAP in transfer rules X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If there is no VXLAN among pattern items, the action will be turned down. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc_mae.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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; } -- 2.20.1