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 BAC0D42D46 for ; Sun, 25 Jun 2023 08:39:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E76440ED8; Sun, 25 Jun 2023 08:39:36 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2065.outbound.protection.outlook.com [40.107.94.65]) by mails.dpdk.org (Postfix) with ESMTP id 9451640A7F for ; Sun, 25 Jun 2023 08:39:35 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZvisUyJgT0BUypaJMlkjkAZ2jx/cFV5kgil1nHNkxCJW3W49pkfJr/Y4SPT14nGD3ZF9t1EbGi2MiEJ16qqCq1/OrTbMhB/d8k3MpzD/1Wl1B+gkIEl804WqHt6r5iy1HOKGtiXNUEoIiiuskUVP1cp6N/TyzArjvtJ50rUVwxbVPVtCjvvINBJSuDS45IbBoORYa4ShKWfNZV32KWP0awXacHg1yD2L1T7MAhNYvk8ZgZSyByE4KVRylkpeGDk3NZriIFMu92tof1LvySEDCqcKND9cupZoLu07X0jYlaF7w/7tmYaXuWxvgki8xJ5RZvZVz8P75k9HgEuB3wn5dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1REr67u5leywzDnkMHvHRfq07l3Hanx2TTM9tcKDHRA=; b=cxrpWQhGTGRHH/R4aw2kYkD3fCuxYpxQG69E3spqDkDqnuYe8GNXxWF7+OXExzQt2dUOqowg5P/XvtMcYE9pPmLiSwav51KXCPAlvnd/q4jX4Guv6BiP+lE+3AqSjwLrqtD+6n/+4GzIY8zXhNyeCeiNNkF/7550IoYBCdc+dczBE7eHg+9fdXYDOUDhQ7AGzG4dEHIN0AT8WNNh1v1iaw2VR94El42e1/fsdHKVV3sOU66d7+4jmWJCEXx+MWxm7JJBTj9pvUA2l/EpfeWSpxlWn5S4CU2+hDcP6+NH4V0wEQzpnGvxhmKUboR8vTaEeYsxIYUg4KYSQIbJzu91IQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=arknetworks.am smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1REr67u5leywzDnkMHvHRfq07l3Hanx2TTM9tcKDHRA=; b=E6hP3EVSlc8NgpAHLgxC1FavAsXeUzESYi2XXVJyfoy+wN8qaoLRhEFf+M+XobpfUTp5UiP0gwJWaETrpZDNthSg2SBfr4qhn+dJb6uzTJ0J0T7Jabnecb60tx41sxv7CushrepjyMJFTmCkydfyygn+kqi8MJWOObYnuhgqCFKGPkVH/kPCdPLOjMw/0TkRNDS71gCjRpa7vEEbQ52UcZY+ReHVoksgYufDIOUivINJg1wdbN/bPQGg++aqaBuqjiX99yERc93/W+GdERjqtKhEMwfjiFjm12TAUi577RV2XYoXbY72xr5s3TACe4yS+Ao+p/dC85DK9VYdI8cPcQ== Received: from DM6PR17CA0004.namprd17.prod.outlook.com (2603:10b6:5:1b3::17) by SN7PR12MB8148.namprd12.prod.outlook.com (2603:10b6:806:351::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.23; Sun, 25 Jun 2023 06:39:33 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1b3:cafe::fa) by DM6PR17CA0004.outlook.office365.com (2603:10b6:5:1b3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.32 via Frontend Transport; Sun, 25 Jun 2023 06:39:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6500.47 via Frontend Transport; Sun, 25 Jun 2023 06:39:32 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sat, 24 Jun 2023 23:39:15 -0700 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sat, 24 Jun 2023 23:39:13 -0700 From: Xueming Li 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 22.11.3 Date: Sun, 25 Jun 2023 14:34:17 +0800 Message-ID: <20230625063544.11183-40-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230625063544.11183-1-xuemingl@nvidia.com> References: <20230625063544.11183-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT024:EE_|SN7PR12MB8148:EE_ X-MS-Office365-Filtering-Correlation-Id: 2399ae8c-4eee-422b-1e0e-08db7546ef47 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qxYlvLFoKSLcBc2ht508oxJ2JrwpS3r6YgPSrjIV70xwkaSv95pMlqhBihnTy70nBlWIEV5Oq8FLUiLUmGTUqzDPh8ta+wbbKB9z3otnzJGbC8nxcDsBjhLivnj8uIAvez4OZ2EGZKydgqybUsRvHw0Fexl9AmlEUDDFeYtZnu2NfUYSc8hZ8GettuB1U8unpLJxVmCKFTjpPMk1QHuVvls6gKpYtidkeGnkcuUNfdDAXBUR2qiTUn0aOfpaO2u6qw0Vbs80JIhSlH/rjtvTYGtEl2NfTTgY4GuPkAeHULJt/najKa+8C6pFEiCsktgd0v0PEj7DRzATE2gjXxPnqdo3uIJAi25UEfYfv5NbV2pQ5X5ho+4Z9Ir/JwuFMLdxzbkdJq09iu2VVaowoJ7qL/CJlFPQUa/JYuOMCTm/pvcW30hIAIvr7zcXBajzz6ydLztSQ+3SJIYIg0gNFoyV0NO7l+E9qfLrR21+59AaIPKUpIWRdAboZ75vVQbjMQn+ci/cpdf3luvf7KnKDhiNs0CmA72r3/J0Qh/0/d6oEQ8Y86UFZp5/xg9fnmNs9Smc4GrJ9PO+1k0UrYsGWOZ42P/A4ND1uHDxSLuUxAZM4nKeZ5JhlJdQh3iU5asN0kY4aXdVf0lA+7Pab22ZtHDf5iid1gF4bWtR0/OvoQIhenO2okjbpTV3Wl5V++At0NtMLmdM0U7oH1D6G8bAR7uIH5JK5I6uguIJbk99t1fdhxV5xH7ak9uVSMO05XDzkjaAJTP6RzYbm7aj7ijDWqavGg== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(346002)(136003)(376002)(39860400002)(396003)(451199021)(40470700004)(36840700001)(46966006)(40460700003)(70586007)(70206006)(2616005)(6286002)(356005)(966005)(7636003)(6916009)(86362001)(53546011)(82310400005)(36860700001)(82740400003)(16526019)(1076003)(336012)(26005)(47076005)(4326008)(186003)(83380400001)(54906003)(426003)(478600001)(36756003)(7696005)(55016003)(40480700001)(2906002)(8936002)(8676002)(5660300002)(316002)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2023 06:39:32.4070 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2399ae8c-4eee-422b-1e0e-08db7546ef47 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8148 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 22.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 06/27/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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=88cf99ed018ef7ea2e7fdd29687835af71032806 Thanks. Xueming Li --- >From 88cf99ed018ef7ea2e7fdd29687835af71032806 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 Cc: Xueming Li [ 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 8d8c19d582..73f729c4c6 100644 --- a/.mailmap +++ b/.mailmap @@ -298,6 +298,7 @@ Deepak Khandelwal Deepak Kumar Jain Deirdre O'Connor Dekel Peled +Denis Pryazhennikov Dennis Marinus Derek Chickles Des O Dea diff --git a/drivers/common/sfc_efx/base/efx.h b/drivers/common/sfc_efx/base/efx.h index f4fa88f169..49e29dcc1c 100644 --- a/drivers/common/sfc_efx/base/efx.h +++ b/drivers/common/sfc_efx/base/efx.h @@ -4748,6 +4748,20 @@ efx_mae_action_set_fill_in_counter_id( __in efx_mae_actions_t *spec, __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 { uint32_t id; diff --git a/drivers/common/sfc_efx/base/efx_impl.h b/drivers/common/sfc_efx/base/efx_impl.h index 9a5d465fa0..45e99d01c5 100644 --- a/drivers/common/sfc_efx/base/efx_impl.h +++ b/drivers/common/sfc_efx/base/efx_impl.h @@ -1800,6 +1800,10 @@ typedef struct efx_mae_action_vlan_push_s { uint16_t emavp_tci_be; } 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; efx_mae_mac_id_t emar_src_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 @@ -1394,10 +1394,7 @@ efx_mae_action_set_spec_init( goto fail1; } - 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); /* * Helpers which populate v2 actions must reject them when v2 is not @@ -3027,6 +3024,16 @@ fail1: return (rc); } + 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( __in efx_nic_t *enp, diff --git a/drivers/common/sfc_efx/version.map b/drivers/common/sfc_efx/version.map index aabc354118..d9b04a611d 100644 --- a/drivers/common/sfc_efx/version.map +++ b/drivers/common/sfc_efx/version.map @@ -89,6 +89,7 @@ INTERNAL { efx_mae_action_rule_insert; 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; efx_mae_action_set_fill_in_eh_id; diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c index 29b8bb9e25..c7d28eae71 100644 --- a/drivers/net/sfc/sfc_mae.c +++ b/drivers/net/sfc/sfc_mae.c @@ -1180,6 +1180,8 @@ 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) { sfc_dbg(sa, "disabled action_set=%p with AS_ID=0x%08x", -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-06-25 14:31:59.571234300 +0800 +++ 0039-net-sfc-invalidate-dangling-MAE-flow-action-FW-resou.patch 2023-06-25 14:31:58.345773900 +0800 @@ -1 +1 @@ -From cf1e1a8e869b49ac9e2e097bbd272e94cc4f2c74 Mon Sep 17 00:00:00 2001 +From 88cf99ed018ef7ea2e7fdd29687835af71032806 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit cf1e1a8e869b49ac9e2e097bbd272e94cc4f2c74 ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org @@ -28 +30 @@ -index 034fb27843..863dbecdb0 100644 +index 8d8c19d582..73f729c4c6 100644 @@ -31 +33 @@ -@@ -301,6 +301,7 @@ Deepak Khandelwal +@@ -298,6 +298,7 @@ Deepak Khandelwal @@ -125 +127 @@ -index e5e9257998..60b9fdc290 100644 +index 29b8bb9e25..c7d28eae71 100644