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 B115E42ECF for ; Thu, 20 Jul 2023 17:22:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC7F542D2D; Thu, 20 Jul 2023 17:22:08 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id BC01D42C54 for ; Thu, 20 Jul 2023 17:22:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689866526; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NoGbF/R71azd5N22dusmyPCFSeGt/P0tpAxejqfYJsU=; b=a5pEQkxJJT/kFssW0KYnPrATxyPTK++9F9+2QuwrZjw8LQ10J4VzpoagAhT1mI+eZENEuA v9UTlbPZqcSJtbKMrPAlVLDBxBPUKPaPh/paFi//O177ifD+/DMjyxUJZxbllvZGNkEEq2 +R4MKoEFEi/rLG+dGv51WKBkJ/mxVT8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-651-TkKL46e4OGqabeajfuL-QQ-1; Thu, 20 Jul 2023 11:21:05 -0400 X-MC-Unique: TkKL46e4OGqabeajfuL-QQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0210088719E; Thu, 20 Jul 2023 15:20:42 +0000 (UTC) Received: from rh.redhat.com (unknown [10.39.192.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 924FC4CD0E3; Thu, 20 Jul 2023 15:20:40 +0000 (UTC) From: Kevin Traynor To: Ivan Malov Cc: Andy Moreton , Denis Pryazhennikov , Andrew Rybchenko , dpdk stable Subject: patch 'net/sfc: invalidate dangling MAE flow action FW resource IDs' has been queued to stable release 21.11.5 Date: Thu, 20 Jul 2023 16:17:41 +0100 Message-ID: <20230720151942.262154-30-ktraynor@redhat.com> In-Reply-To: <20230720151942.262154-1-ktraynor@redhat.com> References: <20230720151942.262154-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Hi, FYI, your patch has been queued to stable release 21.11.5 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/25/23. 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/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/fbfa671cbf1613e01b5fe25dd721821a9d768f7c Thanks. Kevin --- >From fbfa671cbf1613e01b5fe25dd721821a9d768f7c Mon Sep 17 00:00:00 2001 From: Ivan Malov Date: Sun, 21 May 2023 12:36:31 +0400 Subject: [PATCH] net/sfc: invalidate dangling MAE flow action FW resource IDs [ upstream commit cf1e1a8e869b49ac9e2e097bbd272e94cc4f2c74 ] When reinserting a flow (on port restart, for instance) FW resource IDs found in the action set specification need to be invalidated so that the new (reallocated) FW resource IDs can be accepted by libefx again. Fixes: 1bbd1ec2348a ("net/sfc: support action VXLAN encap in MAE backend") Signed-off-by: Ivan Malov Reviewed-by: Andy Moreton Tested-by: Denis Pryazhennikov Acked-by: Andrew Rybchenko --- .mailmap | 1 + drivers/common/sfc_efx/base/efx.h | 14 ++++++++++++++ drivers/common/sfc_efx/base/efx_impl.h | 4 ++++ drivers/common/sfc_efx/base/efx_mae.c | 15 +++++++++++---- drivers/common/sfc_efx/version.map | 1 + drivers/net/sfc/sfc_mae.c | 2 ++ 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/.mailmap b/.mailmap index 575405b454..5e85db906b 100644 --- a/.mailmap +++ b/.mailmap @@ -298,4 +298,5 @@ Deepak Kumar Jain Deirdre O'Connor Dekel Peled +Denis Pryazhennikov Dennis Marinus Derek Chickles diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index d70060c18b..398eb8dbd2 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -4702,4 +4702,18 @@ efx_mae_action_set_fill_in_counter_id( __in const efx_counter_t *counter_idp); +/* + * Clears dangling FW object IDs (counter ID, for instance) in + * the action set specification. Useful for adapter restarts, + * when all MAE objects need to be reallocated by the driver. + * + * This method only clears the IDs in the specification. + * The driver is still responsible for keeping the IDs + * separately and freeing them when stopping the port. + */ +LIBEFX_API +extern void +efx_mae_action_set_clear_fw_rsrc_ids( + __in efx_mae_actions_t *spec); + /* Action set ID */ typedef struct efx_mae_aset_id_s { diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h index ba00eeeb47..99a6a732f4 100644 --- a/drivers/common/sfc_efx/base/efx_impl.h +++ b/drivers/common/sfc_efx/base/efx_impl.h @@ -1800,4 +1800,8 @@ typedef struct efx_mae_action_vlan_push_s { } efx_mae_action_vlan_push_t; +/* + * Helper efx_mae_action_set_clear_fw_rsrc_ids() is responsible + * to initialise every field in this structure to INVALID value. + */ typedef struct efx_mae_actions_rsrc_s { efx_mae_mac_id_t emar_dst_mac_id; diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c index 7732d99992..4c33471f28 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -1395,8 +1395,5 @@ efx_mae_action_set_spec_init( } - spec->ema_rsrc.emar_dst_mac_id.id = EFX_MAE_RSRC_ID_INVALID; - spec->ema_rsrc.emar_src_mac_id.id = EFX_MAE_RSRC_ID_INVALID; - spec->ema_rsrc.emar_eh_id.id = EFX_MAE_RSRC_ID_INVALID; - spec->ema_rsrc.emar_counter_id.id = EFX_MAE_RSRC_ID_INVALID; + efx_mae_action_set_clear_fw_rsrc_ids(spec); /* @@ -3028,4 +3025,14 @@ fail1: } + void +efx_mae_action_set_clear_fw_rsrc_ids( + __in efx_mae_actions_t *spec) +{ + spec->ema_rsrc.emar_dst_mac_id.id = EFX_MAE_RSRC_ID_INVALID; + spec->ema_rsrc.emar_src_mac_id.id = EFX_MAE_RSRC_ID_INVALID; + spec->ema_rsrc.emar_eh_id.id = EFX_MAE_RSRC_ID_INVALID; + spec->ema_rsrc.emar_counter_id.id = EFX_MAE_RSRC_ID_INVALID; +} + __checkReturn efx_rc_t efx_mae_counters_alloc( diff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map index 9ce76ea6e8..9387bc6ce8 100644 --- a/drivers/common/sfc_efx/version.map +++ b/drivers/common/sfc_efx/version.map @@ -90,4 +90,5 @@ INTERNAL { efx_mae_action_rule_remove; efx_mae_action_set_alloc; + efx_mae_action_set_clear_fw_rsrc_ids; efx_mae_action_set_fill_in_counter_id; efx_mae_action_set_fill_in_dst_mac_id; diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index 733105bc6e..76b7c59ac0 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -1181,4 +1181,6 @@ sfc_mae_action_set_disable(struct sfc_adapter *sa, if (fw_rsrc->refcnt == 1) { + efx_mae_action_set_clear_fw_rsrc_ids(action_set->spec); + rc = efx_mae_action_set_free(sa->nic, &fw_rsrc->aset_id); if (rc == 0) { -- 2.41.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-07-20 16:17:58.676024334 +0100 +++ 0030-net-sfc-invalidate-dangling-MAE-flow-action-FW-resou.patch 2023-07-20 16:17:54.555750075 +0100 @@ -1 +1 @@ -From cf1e1a8e869b49ac9e2e097bbd272e94cc4f2c74 Mon Sep 17 00:00:00 2001 +From fbfa671cbf1613e01b5fe25dd721821a9d768f7c Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit cf1e1a8e869b49ac9e2e097bbd272e94cc4f2c74 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -28 +29 @@ -index 034fb27843..863dbecdb0 100644 +index 575405b454..5e85db906b 100644 @@ -31 +32 @@ -@@ -302,4 +302,5 @@ Deepak Kumar Jain +@@ -298,4 +298,5 @@ Deepak Kumar Jain @@ -38 +39 @@ -index f4fa88f169..49e29dcc1c 100644 +index d70060c18b..398eb8dbd2 100644 @@ -41 +42 @@ -@@ -4749,4 +4749,18 @@ efx_mae_action_set_fill_in_counter_id( +@@ -4702,4 +4702,18 @@ efx_mae_action_set_fill_in_counter_id( @@ -61 +62 @@ -index 9a5d465fa0..45e99d01c5 100644 +index ba00eeeb47..99a6a732f4 100644 @@ -64 +65 @@ -@@ -1801,4 +1801,8 @@ typedef struct efx_mae_action_vlan_push_s { +@@ -1800,4 +1800,8 @@ typedef struct efx_mae_action_vlan_push_s { @@ -103 +104 @@ -index aabc354118..d9b04a611d 100644 +index 9ce76ea6e8..9387bc6ce8 100644 @@ -113 +114 @@ -index e5e9257998..60b9fdc290 100644 +index 733105bc6e..76b7c59ac0 100644