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 6561DA0C4C for ; Mon, 12 Jul 2021 15:13:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 606A440685; Mon, 12 Jul 2021 15:13:09 +0200 (CEST) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by mails.dpdk.org (Postfix) with ESMTP id A99674069E for ; Mon, 12 Jul 2021 15:13:08 +0200 (CEST) Received: by mail-wr1-f53.google.com with SMTP id f17so25569350wrt.6 for ; Mon, 12 Jul 2021 06:13:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4xz/Y2jHTlkAYkXuDhddTuhzF0AQaxRPniOjzDLeCn0=; b=jG6u51MXx67RsZfqfmqlIi9vP7SNvtgtG040tMtlXViEc7/iw7aIpABqZWhXg0BmOY xl91i8RQIb4bvSYMabgvhK9j5N67IzxvjdxV9gYmYEbKVDv+JYmzrSLUSB3h4pNizrTv NESzki8FoGTVVXkHXb1RKAtoguyxxNWUPf2pjznwrSB+XTqbyMjt0Kf2U12QmvOy+AUT scPwHVEKyIPJJpi8Q0BWqrQOIs3XOAaXG4Xy0WDUGQcerExq6Vdx0La1/y5JVVhuKGY8 MR6xnquG6+BvSOQtXpa6elnLVRa1J+Uhdl0nm+zHkSRqrn0MQm/YL7J+eSsLUQUFNM8K 3IIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4xz/Y2jHTlkAYkXuDhddTuhzF0AQaxRPniOjzDLeCn0=; b=E+hhy3EvOUAi8/tl9MYFByRTNKDnxqBprfUdGeLafhN1X+oHBR/oU6Nwketmk7LU8P aEvXjwJEIHv4DrGRfILEcR0swuWJFiTaa3CtEn70lCTV+hfmE8flY9fNn6lIOwfhfPr2 Ynjc3shvZmcU+oOCBNTpK9UKuyDHClIS1SsoCYdToVQfABmNU3gXIkiMXv3/vNH6uPbj q6BrLCpDvfLEhxgcaIh/6htjwWZAwv+Z6wet5WXjM/E5WJyGgdudceSqS8h+9pkBQbc9 eyxCpb2qtjwMkWkGmil37bllnPgbzDp6ROeb9p8/sNYWYiRtrMmjmvmmQGhCt+pMGiRD JcEg== X-Gm-Message-State: AOAM531AHM2ybskXhdsgy9UWy5RayWLR9YRnBIeyI3lVX2mzF8rGRZjs EjG64MjtaJF0QI6STTrfhTg= X-Google-Smtp-Source: ABdhPJxDwVZJJoKgUNS2/oLh6UVdF3jkkOBNAvCJ1c0n0a414mHX0wSrFPpfJTzrdqKdfGO1LkAodQ== X-Received: by 2002:adf:cd0e:: with SMTP id w14mr59459934wrm.237.1626095588450; Mon, 12 Jul 2021 06:13:08 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id u15sm1192wmq.1.2021.07.12.06.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 06:13:07 -0700 (PDT) From: luca.boccassi@gmail.com To: Ivan Malov Cc: Andrew Rybchenko , Andy Moreton , dpdk stable Date: Mon, 12 Jul 2021 14:04:53 +0100 Message-Id: <20210712130551.2462159-58-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210712130551.2462159-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/sfc: fix outer match in MAE backend' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/14/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/736242a19c2a59a4832307fdf0b0bf90bdab460c Thanks. Luca Boccassi --- >From 736242a19c2a59a4832307fdf0b0bf90bdab460c Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Tue, 6 Jul 2021 15:37:26 +0300 Subject: [PATCH] net/sfc: fix outer match in MAE backend [ upstream commit e52d36cf8f16f496fc21baba75057fa7fbcd2447 ] The current code doesn't use match on invalid outer rule ID in action rules of non-encap. flows. This is wrong and must be fixed. Do that and explain correct behaviour in the code. Fixes: dadff137931c ("net/sfc: support encap flow items in transfer rules") Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- drivers/net/sfc/sfc_mae.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index abeee38a2f..dc01257ace 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -1576,12 +1576,12 @@ sfc_mae_rule_process_outer(struct sfc_adapter *sa, struct sfc_mae_outer_rule **rulep, struct rte_flow_error *error) { - struct sfc_mae_outer_rule *rule; + efx_mae_rule_id_t invalid_rule_id = { .id = EFX_MAE_RSRC_ID_INVALID }; int rc; if (ctx->encap_type == EFX_TUNNEL_PROTOCOL_NONE) { *rulep = NULL; - return 0; + goto no_or_id; } SFC_ASSERT(ctx->match_spec_outer != NULL); @@ -1609,21 +1609,27 @@ sfc_mae_rule_process_outer(struct sfc_adapter *sa, /* The spec has now been tracked by the outer rule entry. */ ctx->match_spec_outer = NULL; +no_or_id: /* - * Depending on whether we reuse an existing outer rule or create a - * new one (see above), outer rule ID is either a valid value or - * EFX_MAE_RSRC_ID_INVALID. Set it in the action rule match - * specification (and the full mask, too) in order to have correct - * class comparisons of the new rule with existing ones. - * Also, action rule match specification will be validated shortly, - * and having the full mask set for outer rule ID indicates that we - * will use this field, and support for this field has to be checked. + * In MAE, lookup sequence comprises outer parse, outer rule lookup, + * inner parse (when some outer rule is hit) and action rule lookup. + * If the currently processed flow does not come with an outer rule, + * its action rule must be available only for packets which miss in + * outer rule table. Set OR_ID match field to 0xffffffff/0xffffffff + * in the action rule specification; this ensures correct behaviour. + * + * If, on the other hand, this flow does have an outer rule, its ID + * may be unknown at the moment (not yet allocated), but OR_ID mask + * has to be set to 0xffffffff anyway for correct class comparisons. + * When the outer rule has been allocated, this match field will be + * overridden by sfc_mae_outer_rule_enable() to use the right value. */ - rule = *rulep; rc = efx_mae_match_spec_outer_rule_id_set(ctx->match_spec_action, - &rule->fw_rsrc.rule_id); + &invalid_rule_id); if (rc != 0) { - sfc_mae_outer_rule_del(sa, *rulep); + if (*rulep != NULL) + sfc_mae_outer_rule_del(sa, *rulep); + *rulep = NULL; return rte_flow_error_set(error, rc, -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-12 13:41:39.661863623 +0100 +++ 0058-net-sfc-fix-outer-match-in-MAE-backend.patch 2021-07-12 13:41:36.458121944 +0100 @@ -1 +1 @@ -From e52d36cf8f16f496fc21baba75057fa7fbcd2447 Mon Sep 17 00:00:00 2001 +From 736242a19c2a59a4832307fdf0b0bf90bdab460c Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e52d36cf8f16f496fc21baba75057fa7fbcd2447 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 2ea2d63c5c..61e795db9b 100644 +index abeee38a2f..dc01257ace 100644 @@ -24 +25 @@ -@@ -1928,12 +1928,12 @@ sfc_mae_rule_process_outer(struct sfc_adapter *sa, +@@ -1576,12 +1576,12 @@ sfc_mae_rule_process_outer(struct sfc_adapter *sa, @@ -39 +40 @@ -@@ -1961,21 +1961,27 @@ sfc_mae_rule_process_outer(struct sfc_adapter *sa, +@@ -1609,21 +1609,27 @@ sfc_mae_rule_process_outer(struct sfc_adapter *sa,