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 DD2BF43BA7; Thu, 7 Mar 2024 11:20:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E0AC042EEB; Thu, 7 Mar 2024 11:20:02 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2064.outbound.protection.outlook.com [40.107.212.64]) by mails.dpdk.org (Postfix) with ESMTP id 57DD042EDC; Thu, 7 Mar 2024 11:20:00 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=heZm4mWy1Zg8Ps5vPcOaug5jTqpcx1H/dln1XG8XqeC3F/Sxrw+YIZXUwLPgkR9OcCQe7kmKvAcJe3Y0AX/t8MS1L2iFehOWxRoHU2AoON+3az0g7RAtmsFNpmw3/h5qwrcl5s9Q1SPPdlFhrges+j1MLYM7iy0o0GCtTEk4u6WP5kXF/qZkDNYXOx6N1Neh6ufCwlQ0Y1mwRom19qyiQ8dhm01i5hqRVcFMBHA6IWCSBSlGX3zA0/oVVl6jWaoglXCmSczLpqTampKZKh3CWwfo4BtuiZmHi5AeOvC8I3uF82D7z05Ze4Mmaa44HOmgkpb4QpJuizpTxBQZKOAgRw== 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=PSWdCgDkWgCQJ3c8j5GWoj0qjmrPuQmyaXN3TbUxnfc=; b=oD8rSVxb8kPyMbn82yB2Riue6BFeFA38WlXOSp869yrYQHupaXdnA2ZjOf94a4cO/YYM568P3ocSNIZo/nkaPj48ZIX3Oh/Gaq6bvPj9U7xCS+k6jqshEEgLrE/Em8GFdup3t7LURLkCeCVcNEZ5pFUrIcjlBRMPayAUGu3oHD39pZwaZeor5Kt/JgBT+aRAgM52aJkRBq0vF0597hds/SV9TSlC2mUx0TXubn1eSiP4FU47tCQPyGcp1r148vg5R6LbNomrEjz/qSwZCD7E+8hfx7op7dQmwiQYu9qgj6Rom6gEvNnKKinSEc+5HeLpvRG+y11ceL+bJbUTd0HoWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org 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 (0) 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=PSWdCgDkWgCQJ3c8j5GWoj0qjmrPuQmyaXN3TbUxnfc=; b=oXBlfz2zx6n9qxVDlTxrhzGkJXHiArGZggKddM4o0bcG7yq4JLY1rGk6oYWGe4hbppkq/Fuu7wpYEgMc3t931X9IO8lAkRR7f+8tECuL6Ka+TaQV1L0WXa0Dld04smiTGVbjVa6vNXG0tHGGS3TDwhtWkdO2v8DNhE1+vTT1x+YfWO6B899ghfkDGuCzRGjN4+ItGciI8y+/icA/vnRcMXbOt4xnOiF9U1bPFwvaAZ2RY6R5yUXZCueObe+L9bTwaNgOT3GBT/VvvtRA5ruSfzUdsXe6CH+uOHnbOEJjY6uOcEW3CLQmFzpFxAHyLDfGd00At/HgDqTz7lvKSJ5T1Q== Received: from BN9PR03CA0062.namprd03.prod.outlook.com (2603:10b6:408:fc::7) by PH7PR12MB8780.namprd12.prod.outlook.com (2603:10b6:510:26b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.26; Thu, 7 Mar 2024 10:19:56 +0000 Received: from BN2PEPF000044AA.namprd04.prod.outlook.com (2603:10b6:408:fc:cafe::be) by BN9PR03CA0062.outlook.office365.com (2603:10b6:408:fc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.27 via Frontend Transport; Thu, 7 Mar 2024 10:19:56 +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 BN2PEPF000044AA.mail.protection.outlook.com (10.167.243.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Thu, 7 Mar 2024 10:19:56 +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.41; Thu, 7 Mar 2024 02:19:37 -0800 Received: from nvidia.com (10.126.231.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.1258.12; Thu, 7 Mar 2024 02:19:34 -0800 From: Gregory Etelson To: CC: , , , , Dariusz Sosnowski , "Viacheslav Ovsiienko" , Ori Kam , Suanming Mou , Matan Azrad Subject: [PATCH v2 3/3] net/mlx5: fix indirect action async job initialization Date: Thu, 7 Mar 2024 12:19:10 +0200 Message-ID: <20240307101910.1135720-4-getelson@nvidia.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307101910.1135720-1-getelson@nvidia.com> References: <20240229105614.593391-1-getelson@nvidia.com> <20240307101910.1135720-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.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: BN2PEPF000044AA:EE_|PH7PR12MB8780:EE_ X-MS-Office365-Filtering-Correlation-Id: 1eeaf681-67b4-4119-7dbb-08dc3e9022ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JrbK44DVyeiPMt1Nl641t0XWOmZRpigPDG+P+y+HOCY3k/7+hkiRj7ljCYu+/R15rbQ7bqTl05WaBPcVFkjlCsx2PF7qf+M2+OjU2aEadaqyF11VQf8pKUxKZFQQU8xoRTMsfn6WFgeFPnwfxeRQC0TGyaH8BvWV3GDuEF7kEFmefxq3LpUlF81IxPUVt0WBCFzT0YpRIuykQS0Dk1fN0UHFhIftsMKubqWwGaUNntEhtFM/5A8ShSdKuTXMT44KwhU557YQMcRFHmgNulrwwpdLHD1lKBhCHDitl44iV68lTLwjdyr1+fzWDxiyjS+hFwZKRHVMif2wLn19fz3i8p1bIIPbV/bLfwk6AVpwgCfemwcSlUfTTvBPpWtyWwmeDk5tSbekf9aQhYQoKZ/2Eww2YDZxxs1+egkUDtxmm2+ou+sL4WDEXP+yVGps+1ZtAD+qAMjLZN1/RVRyXLWEkSb6CIdxlbFLjV4QKRvW4PLbGqGD/YyXVyWrsVipjpQ2xs+VrarOf4zq0UYM5Mlws+qI5IvSs3Xep8YiM73VLBmVRwxrjIzEh7YqHCU3/Hr3pd9J3EBnYPnNPutnQBztytGk49JkWdduwMhgj8G7Irz0X/zjUTzWo7YTkTUelUx+H154XKRl8A5CLul/01J1c7NiwD7rFsdL9K1G+DIkvty1ruj5+CnMiCq5VVIFUba2Df9OpiBaCu8nf+iTaMNPnZbAR4/TrKoNWFtuDDM59qR7QoZXjCpmIr5YmPNlloyI 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:(13230031)(376005)(36860700004)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2024 10:19:56.0004 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1eeaf681-67b4-4119-7dbb-08dc3e9022ee 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: BN2PEPF000044AA.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8780 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 MLX5 PMD driver supports 2 types of indirect actions: legacy INDIRECT and INDIRECT_LIST. PMD has different handlers for each of indirection actions types. Therefore PMD marks async `job::indirect_type` with relevant value. PMD set the type only during indirect action creation. Legacy INDIRECT query could have get a job object used previously by INDIRECT_LIST action. In that case such job object was handled as INDIRECT_LIST because the `job::indirect_type` was not re-assigned. The patch sets `job::indirect_type` during the job initialization according to operation type. Fixes: 59155721936e ("net/mlx5: fix indirect flow completion processing") Cc: stable@dpdk.org Signed-off-by: Gregory Etelson Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow_hw.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index 8f004b5435..b9ba05f695 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -188,6 +188,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue, const struct rte_flow_action_handle *handle, void *user_data, void *query_data, enum mlx5_hw_job_type type, + enum mlx5_hw_indirect_type indirect_type, struct rte_flow_error *error); static int mlx5_tbl_multi_pattern_process(struct rte_eth_dev *dev, @@ -1692,7 +1693,8 @@ flow_hw_meter_mark_compile(struct rte_eth_dev *dev, struct mlx5_aso_mtr *aso_mtr; struct mlx5_hw_q_job *job = flow_hw_action_job_init(priv, queue, NULL, NULL, NULL, - MLX5_HW_Q_JOB_TYPE_CREATE, NULL); + MLX5_HW_Q_JOB_TYPE_CREATE, + MLX5_HW_INDIRECT_TYPE_LEGACY, NULL); if (!job) return -1; @@ -10998,6 +11000,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue, const struct rte_flow_action_handle *handle, void *user_data, void *query_data, enum mlx5_hw_job_type type, + enum mlx5_hw_indirect_type indirect_type, struct rte_flow_error *error) { struct mlx5_hw_q_job *job; @@ -11015,6 +11018,7 @@ flow_hw_action_job_init(struct mlx5_priv *priv, uint32_t queue, job->action = handle; job->user_data = user_data; job->query.user = query_data; + job->indirect_type = indirect_type; return job; } @@ -11026,7 +11030,7 @@ mlx5_flow_action_job_init(struct mlx5_priv *priv, uint32_t queue, struct rte_flow_error *error) { return flow_hw_action_job_init(priv, queue, handle, user_data, query_data, - type, error); + type, MLX5_HW_INDIRECT_TYPE_LEGACY, error); } static __rte_always_inline void @@ -11096,7 +11100,7 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue, if (attr || force_job) { job = flow_hw_action_job_init(priv, queue, NULL, user_data, NULL, MLX5_HW_Q_JOB_TYPE_CREATE, - error); + MLX5_HW_INDIRECT_TYPE_LEGACY, error); if (!job) return NULL; } @@ -11165,7 +11169,6 @@ flow_hw_action_handle_create(struct rte_eth_dev *dev, uint32_t queue, } if (job && !force_job) { job->action = handle; - job->indirect_type = MLX5_HW_INDIRECT_TYPE_LEGACY; flow_hw_action_finalize(dev, queue, job, push, aso, handle != NULL); } @@ -11257,7 +11260,7 @@ flow_hw_action_handle_update(struct rte_eth_dev *dev, uint32_t queue, if (attr || force_job) { job = flow_hw_action_job_init(priv, queue, handle, user_data, NULL, MLX5_HW_Q_JOB_TYPE_UPDATE, - error); + MLX5_HW_INDIRECT_TYPE_LEGACY, error); if (!job) return -rte_errno; } @@ -11339,7 +11342,7 @@ flow_hw_action_handle_destroy(struct rte_eth_dev *dev, uint32_t queue, if (attr || force_job) { job = flow_hw_action_job_init(priv, queue, handle, user_data, NULL, MLX5_HW_Q_JOB_TYPE_DESTROY, - error); + MLX5_HW_INDIRECT_TYPE_LEGACY, error); if (!job) return -rte_errno; } @@ -11663,7 +11666,7 @@ flow_hw_action_handle_query(struct rte_eth_dev *dev, uint32_t queue, if (attr) { job = flow_hw_action_job_init(priv, queue, handle, user_data, data, MLX5_HW_Q_JOB_TYPE_QUERY, - error); + MLX5_HW_INDIRECT_TYPE_LEGACY, error); if (!job) return -rte_errno; } @@ -11717,7 +11720,7 @@ flow_hw_async_action_handle_query_update job = flow_hw_action_job_init(priv, queue, handle, user_data, query, MLX5_HW_Q_JOB_TYPE_UPDATE_QUERY, - error); + MLX5_HW_INDIRECT_TYPE_LEGACY, error); if (!job) return -rte_errno; } @@ -12397,7 +12400,7 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue, if (attr) { job = flow_hw_action_job_init(priv, queue, NULL, user_data, NULL, MLX5_HW_Q_JOB_TYPE_CREATE, - error); + MLX5_HW_INDIRECT_TYPE_LIST, error); if (!job) return NULL; } @@ -12417,7 +12420,6 @@ flow_hw_async_action_list_handle_create(struct rte_eth_dev *dev, uint32_t queue, } if (job) { job->action = handle; - job->indirect_type = MLX5_HW_INDIRECT_TYPE_LIST; flow_hw_action_finalize(dev, queue, job, push, false, handle != NULL); } @@ -12462,7 +12464,7 @@ flow_hw_async_action_list_handle_destroy if (attr) { job = flow_hw_action_job_init(priv, queue, NULL, user_data, NULL, MLX5_HW_Q_JOB_TYPE_DESTROY, - error); + MLX5_HW_INDIRECT_TYPE_LIST, error); if (!job) return rte_errno; } -- 2.39.2