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 7F84FA0C4D; Wed, 13 Oct 2021 02:25:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D970E41179; Wed, 13 Oct 2021 02:24:40 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 69704410E5 for ; Wed, 13 Oct 2021 02:24:31 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.120.72]) (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 2731D7F6FE; Wed, 13 Oct 2021 03:24:31 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 2731D7F6FE DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1634084671; bh=rN/pnUr87S43+518tldY3ITRiVEaX+UjJqZvIUQ0z+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Z44zHFVDAN0ZCm5PUHT0Qf0hyc5yIOEz6AhZsyQZUMTtUKwV5AO3D+TNEpnADPWUC qnsbhGxvi3Szs+zglhKn1uAd/13cA28M3mzYYieUCd0Gy69SKs+wNe+jDIxCvFSGJF +9SdiGq65h1XuYzawVzuNFxQAIImhCJkfEBNx7Hg= From: Ivan Malov To: dev@dpdk.org Cc: Ferruh Yigit , Andrew Rybchenko Date: Wed, 13 Oct 2021 03:24:15 +0300 Message-Id: <20211013002415.24453-11-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211013002415.24453-1-ivan.malov@oktetlabs.ru> References: <20210929205730.775-1-ivan.malov@oktetlabs.ru> <20211013002415.24453-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 10/10] net/sfc: refine pattern of GROUP flows in tunnel offload 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" By design, in a GROUP flow, outer match criteria go to "ENC" fields of the action rule match specification. The current HW/FW hasn't got support for these fields (except the VXLAN VNI) yet. As a workaround, start parsing the pattern from the tunnel item. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko --- drivers/net/sfc/sfc_mae.c | 37 ++++++++++++++++++++++++++----------- drivers/net/sfc/sfc_mae.h | 1 + 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index c9139cc800..feda6c19a6 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -2121,14 +2121,21 @@ sfc_mae_rule_parse_item_tunnel(const struct rte_flow_item *item, const uint8_t *mask = NULL; int rc; - /* - * We're about to start processing inner frame items. - * Process pattern data that has been deferred so far - * and reset pattern data storage. - */ - rc = sfc_mae_rule_process_pattern_data(ctx_mae, error); - if (rc != 0) - return rc; + if (ctx_mae->ft_rule_type == SFC_FT_RULE_GROUP) { + /* + * As a workaround, pattern processing has started from + * this (tunnel) item. No pattern data to process yet. + */ + } else { + /* + * We're about to start processing inner frame items. + * Process pattern data that has been deferred so far + * and reset pattern data storage. + */ + rc = sfc_mae_rule_process_pattern_data(ctx_mae, error); + if (rc != 0) + return rc; + } memset(&ctx_mae->pattern_data, 0, sizeof(ctx_mae->pattern_data)); @@ -2447,10 +2454,10 @@ sfc_mae_rule_preparse_item_mark(const struct rte_flow_item_mark *spec, static int sfc_mae_rule_encap_parse_init(struct sfc_adapter *sa, - const struct rte_flow_item pattern[], struct sfc_mae_parse_ctx *ctx, struct rte_flow_error *error) { + const struct rte_flow_item *pattern = ctx->pattern; struct sfc_mae *mae = &sa->mae; uint8_t recirc_id = 0; int rc; @@ -2525,6 +2532,13 @@ sfc_mae_rule_encap_parse_init(struct sfc_adapter *sa, RTE_FLOW_ERROR_TYPE_ITEM, pattern, "tunnel offload: GROUP: tunnel type mismatch"); } + + /* + * The HW/FW hasn't got support for the use of "ENC" fields in + * action rules (except the VNET_ID one) yet. As a workaround, + * start parsing the pattern from the tunnel item. + */ + ctx->pattern = pattern; break; default: SFC_ASSERT(B_FALSE); @@ -2669,11 +2683,12 @@ sfc_mae_rule_parse_pattern(struct sfc_adapter *sa, ctx_mae.encap_type = EFX_TUNNEL_PROTOCOL_NONE; ctx_mae.match_spec = ctx_mae.match_spec_action; ctx_mae.field_ids_remap = field_ids_no_remap; + ctx_mae.pattern = pattern; ctx.type = SFC_FLOW_PARSE_CTX_MAE; ctx.mae = &ctx_mae; - rc = sfc_mae_rule_encap_parse_init(sa, pattern, &ctx_mae, error); + rc = sfc_mae_rule_encap_parse_init(sa, &ctx_mae, error); if (rc != 0) goto fail_encap_parse_init; @@ -2685,7 +2700,7 @@ sfc_mae_rule_parse_pattern(struct sfc_adapter *sa, spec->ft = ctx_mae.ft; rc = sfc_flow_parse_pattern(sa, sfc_flow_items, RTE_DIM(sfc_flow_items), - pattern, &ctx, error); + ctx_mae.pattern, &ctx, error); if (rc != 0) goto fail_parse_pattern; diff --git a/drivers/net/sfc/sfc_mae.h b/drivers/net/sfc/sfc_mae.h index e4aa38be44..6c1a5bfee7 100644 --- a/drivers/net/sfc/sfc_mae.h +++ b/drivers/net/sfc/sfc_mae.h @@ -332,6 +332,7 @@ struct sfc_mae_parse_ctx { enum sfc_flow_tunnel_rule_type ft_rule_type; struct sfc_mae_pattern_data pattern_data; efx_tunnel_protocol_t encap_type; + const struct rte_flow_item *pattern; unsigned int priority; struct sfc_flow_tunnel *ft; }; -- 2.20.1