From: Ivan Malov <ivan.malov@oktetlabs.ru>
To: dev@dpdk.org
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: [dpdk-dev] [PATCH 10/10] net/sfc: refine pattern of GROUP flows in tunnel offload
Date: Wed, 29 Sep 2021 23:57:30 +0300 [thread overview]
Message-ID: <20210929205730.775-11-ivan.malov@oktetlabs.ru> (raw)
In-Reply-To: <20210929205730.775-1-ivan.malov@oktetlabs.ru>
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 <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
---
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 73fb40a02d..eb2133f167 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -1991,14 +1991,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));
@@ -2317,10 +2324,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;
@@ -2395,6 +2402,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);
@@ -2539,11 +2553,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;
@@ -2555,7 +2570,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 b2a62fc10b..53959d568f 100644
--- a/drivers/net/sfc/sfc_mae.h
+++ b/drivers/net/sfc/sfc_mae.h
@@ -297,6 +297,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
next prev parent reply other threads:[~2021-09-29 20:58 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-29 20:57 [dpdk-dev] [PATCH 00/10] net/sfc: add support for " Ivan Malov
2021-09-29 20:57 ` [dpdk-dev] [PATCH 01/10] net/sfc: fence off 8 bits in Rx mark " Ivan Malov
2021-09-29 20:57 ` [dpdk-dev] [PATCH 02/10] common/sfc_efx/base: add API to set RECIRC ID in outer rules Ivan Malov
2021-09-30 9:53 ` Kinsella, Ray
2021-09-29 20:57 ` [dpdk-dev] [PATCH 03/10] net/sfc: support JUMP flows in tunnel offload Ivan Malov
2021-09-29 20:57 ` [dpdk-dev] [PATCH 04/10] common/sfc_efx/base: add RECIRC ID match in action rules API Ivan Malov
2021-09-29 20:57 ` [dpdk-dev] [PATCH 05/10] net/sfc: support GROUP flows in tunnel offload Ivan Malov
2021-09-29 20:57 ` [dpdk-dev] [PATCH 06/10] net/sfc: implement control path operations " Ivan Malov
2021-09-29 20:57 ` [dpdk-dev] [PATCH 07/10] net/sfc: override match on ETH in tunnel offload JUMP rules Ivan Malov
2021-09-29 20:57 ` [dpdk-dev] [PATCH 08/10] net/sfc: use action rules " Ivan Malov
2021-09-29 20:57 ` [dpdk-dev] [PATCH 09/10] net/sfc: support counters " Ivan Malov
2021-09-29 20:57 ` Ivan Malov [this message]
2021-10-04 23:55 ` [dpdk-dev] [PATCH v2 00/10] net/sfc: add support for tunnel offload Ivan Malov
2021-10-04 23:55 ` [dpdk-dev] [PATCH v2 01/10] net/sfc: fence off 8 bits in Rx mark " Ivan Malov
2021-10-04 23:55 ` [dpdk-dev] [PATCH v2 02/10] common/sfc_efx/base: add API to set RECIRC ID in outer rules Ivan Malov
2021-10-04 23:55 ` [dpdk-dev] [PATCH v2 03/10] net/sfc: support JUMP flows in tunnel offload Ivan Malov
2021-10-04 23:55 ` [dpdk-dev] [PATCH v2 04/10] common/sfc_efx/base: add RECIRC ID match in action rules API Ivan Malov
2021-10-04 23:55 ` [dpdk-dev] [PATCH v2 05/10] net/sfc: support GROUP flows in tunnel offload Ivan Malov
2021-10-04 23:55 ` [dpdk-dev] [PATCH v2 06/10] net/sfc: implement control path operations " Ivan Malov
2021-10-04 23:55 ` [dpdk-dev] [PATCH v2 07/10] net/sfc: override match on ETH in tunnel offload JUMP rules Ivan Malov
2021-10-04 23:55 ` [dpdk-dev] [PATCH v2 08/10] net/sfc: use action rules " Ivan Malov
2021-10-04 23:55 ` [dpdk-dev] [PATCH v2 09/10] net/sfc: support counters " Ivan Malov
2021-10-04 23:55 ` [dpdk-dev] [PATCH v2 10/10] net/sfc: refine pattern of GROUP flows in tunnel offload Ivan Malov
2021-10-12 23:46 ` [dpdk-dev] [PATCH v2 00/10] net/sfc: add support for " Ferruh Yigit
2021-10-13 0:28 ` Ivan Malov
2021-10-13 0:24 ` [dpdk-dev] [PATCH v3 " Ivan Malov
2021-10-13 0:24 ` [dpdk-dev] [PATCH v3 01/10] net/sfc: fence off 8 bits in Rx mark " Ivan Malov
2021-10-13 0:24 ` [dpdk-dev] [PATCH v3 02/10] common/sfc_efx/base: add API to set RECIRC ID in outer rules Ivan Malov
2021-10-13 0:24 ` [dpdk-dev] [PATCH v3 03/10] net/sfc: support JUMP flows in tunnel offload Ivan Malov
2021-10-13 0:24 ` [dpdk-dev] [PATCH v3 04/10] common/sfc_efx/base: add RECIRC ID match in action rules API Ivan Malov
2021-10-13 8:41 ` Kinsella, Ray
2021-10-13 0:24 ` [dpdk-dev] [PATCH v3 05/10] net/sfc: support GROUP flows in tunnel offload Ivan Malov
2021-10-13 0:24 ` [dpdk-dev] [PATCH v3 06/10] net/sfc: implement control path operations " Ivan Malov
2021-10-13 0:24 ` [dpdk-dev] [PATCH v3 07/10] net/sfc: override match on ETH in tunnel offload JUMP rules Ivan Malov
2021-10-13 0:24 ` [dpdk-dev] [PATCH v3 08/10] net/sfc: use action rules " Ivan Malov
2021-10-13 0:24 ` [dpdk-dev] [PATCH v3 09/10] net/sfc: support counters " Ivan Malov
2021-10-13 0:24 ` [dpdk-dev] [PATCH v3 10/10] net/sfc: refine pattern of GROUP flows in tunnel offload Ivan Malov
2021-10-13 10:42 ` [dpdk-dev] [PATCH v3 00/10] net/sfc: add support for " Ferruh Yigit
2021-10-13 10:45 ` Ferruh Yigit
2021-10-13 10:55 ` Thomas Monjalon
2021-10-13 13:15 ` [dpdk-dev] [PATCH v4 " Ivan Malov
2021-10-13 13:15 ` [dpdk-dev] [PATCH v4 01/10] net/sfc: fence off 8 bits in Rx mark " Ivan Malov
2021-10-13 13:15 ` [dpdk-dev] [PATCH v4 02/10] common/sfc_efx/base: support recirculation ID in outer rules Ivan Malov
2021-10-13 13:15 ` [dpdk-dev] [PATCH v4 03/10] net/sfc: support jump flows in tunnel offload Ivan Malov
2021-10-13 13:15 ` [dpdk-dev] [PATCH v4 04/10] common/sfc_efx/base: match on recirc. ID in action rules Ivan Malov
2021-10-13 13:15 ` [dpdk-dev] [PATCH v4 05/10] net/sfc: support group flows in tunnel offload Ivan Malov
2021-10-13 13:15 ` [dpdk-dev] [PATCH v4 06/10] net/sfc: implement control path operations " Ivan Malov
2021-10-13 13:15 ` [dpdk-dev] [PATCH v4 07/10] net/sfc: override match fields in tunnel offload jump rules Ivan Malov
2021-10-13 13:15 ` [dpdk-dev] [PATCH v4 08/10] net/sfc: use action rules " Ivan Malov
2021-10-13 13:15 ` [dpdk-dev] [PATCH v4 09/10] net/sfc: support counters " Ivan Malov
2021-10-13 13:15 ` [dpdk-dev] [PATCH v4 10/10] net/sfc: refine pattern of group flows in tunnel offload Ivan Malov
2021-10-13 14:40 ` [dpdk-dev] [PATCH v4 00/10] net/sfc: add support for " Ferruh Yigit
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210929205730.775-11-ivan.malov@oktetlabs.ru \
--to=ivan.malov@oktetlabs.ru \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).