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 18F1FA0C55; Wed, 13 Oct 2021 15:16:17 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE46D411F7; Wed, 13 Oct 2021 15:15:35 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 33686411CB for ; Wed, 13 Oct 2021 15:15:29 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.123.99]) (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 029057F6FC; Wed, 13 Oct 2021 16:15:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 029057F6FC DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1634130929; bh=P8J6HtArL4yslm32jvxHMt10vjUYQThZTOiQy8M1vUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Tc/stgpRuiimcnazZLWhNznXDMnsVsKtrCiOXCdCRs9uK5VKbO35/+6s6iQ9GmXSK BTS3iSWqw0zsdOg6CpALNHLToM81zbs55ZId2nuTHZf5ano0MDEpu9LkWJ3FW9kzav pprOou3jn2zjVdQRKlzOPBmdQmcMpOjLXLuWXdNQ= From: Ivan Malov To: dev@dpdk.org Cc: Ferruh Yigit , Andrew Rybchenko Date: Wed, 13 Oct 2021 16:15:10 +0300 Message-Id: <20211013131514.20376-8-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211013131514.20376-1-ivan.malov@oktetlabs.ru> References: <20210929205730.775-1-ivan.malov@oktetlabs.ru> <20211013131514.20376-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 07/10] net/sfc: override match fields in tunnel offload jump 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" The current HW/FW doesn't allow to match on MAC addresses in outer rules. One day this will change for sure, but right now a workaround is needed. Match on VLAN presence in outer rules is also unsupported. Ignore it. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko --- drivers/net/sfc/sfc_mae.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index 2515b9a80a..c972c2e3f2 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -1525,6 +1525,7 @@ sfc_mae_rule_parse_item_eth(const struct rte_flow_item *item, struct rte_flow_error *error) { struct sfc_mae_parse_ctx *ctx_mae = ctx->mae; + struct rte_flow_item_eth override_mask; struct rte_flow_item_eth supp_mask; const uint8_t *spec = NULL; const uint8_t *mask = NULL; @@ -1542,6 +1543,22 @@ sfc_mae_rule_parse_item_eth(const struct rte_flow_item *item, if (rc != 0) return rc; + if (ctx_mae->ft_rule_type == SFC_FT_RULE_JUMP && mask != NULL) { + /* + * The HW/FW hasn't got support for match on MAC addresses in + * outer rules yet (this will change). Match on VLAN presence + * isn't supported either. Ignore these match criteria. + */ + memcpy(&override_mask, mask, sizeof(override_mask)); + memset(&override_mask.hdr.dst_addr, 0, + sizeof(override_mask.hdr.dst_addr)); + memset(&override_mask.hdr.src_addr, 0, + sizeof(override_mask.hdr.src_addr)); + override_mask.has_vlan = 0; + + mask = (const uint8_t *)&override_mask; + } + if (spec != NULL) { struct sfc_mae_pattern_data *pdata = &ctx_mae->pattern_data; struct sfc_mae_ethertype *ethertypes = pdata->ethertypes; -- 2.20.1