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 145ABA054A; Fri, 23 Sep 2022 16:46:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 19DB342BEB; Fri, 23 Sep 2022 16:44:30 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2061.outbound.protection.outlook.com [40.107.223.61]) by mails.dpdk.org (Postfix) with ESMTP id BE94A42BEB for ; Fri, 23 Sep 2022 16:44:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g/2iEOhZZjBs0ndsJzZbpS4TkhiociuJ0qi4GKL7Os1VS+4ravDMCfFx5OE/pG/SEMz+bGrBI8fm09vfef83JTc+nTZ+pQHd+Imtp15+RNmu+E0wxhkqPhWq7LYmhudUt81rJaF2Vl4Ot+y5g+ReNKtUYIT4SCl1aeNJY4bmgakOOhkNnvlWVVZFE0E3qHW+3815rQogFcj3CLa/Jv6WdiUBk39RK9ewE1akmNDdjLfryvxzG4ysT0hgXrjBbWGvHep3Hje9lmY9ScQOytm8xhoSGgUh4gmnB2FHexaAYeQPuejTglXygeobOAkWtwhUrRqLdlw5/51O/jHBgxQVjQ== 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=ZcmJJEHGhhB/k29iz/tCPni/ZblgdtUYPE1vqPlnbn8=; b=NwhGle7SEBm4Wq3Q8Y5c/4SHbR3Gz9aVHE9Vjif6G13SsGgZgHGuKtrBMgxx419ay7h2W/GE+DRhzt2kVTvf3ppRnowvWWnafUmfc+Pgo2dmZud31Xyv7nBTCVb3gxV1+/IfGvZktvsSAHzbsvYAOH1EipyQI7wNuxq+iNoZAowK8GvCbiRGRX383pdeBpDKxcXSqoEtczEh17hB/jKASVDzZtzvTJTn7njdwggAFj05HeM/5cwsC8s+r/RUpgPjMlyFwNb/OwsjY9yirwrw+Az33dQv9n+0eO6yPXOw3bvxNgjzXhf70Jv0g1pC5pHMoizrdrDoPbLuP17+397ncA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) 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 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=ZcmJJEHGhhB/k29iz/tCPni/ZblgdtUYPE1vqPlnbn8=; b=aGSiguPdj3TidQPMhIWpssEvBHFM/Gd8UjR441URfGEuCaY2upP1UcSljOLPO8sLf1D+DAdrfLBPdLhqMc8W2LdufNsvNHF+t6tpeVM13viDIXtL2s48JvPmi0KCFD7lkuwmrcqU6PNwtK90MGyLBheChBF3jWxkBpcQgx+AsQ7mkIihRZXWwfkDxYD+ZTuJio2/autzKvy/Tb9DRvO5hFuTWbhS2ncn2fkS4MkwmFeeaWB9rkTcv3Ao0PIE7bU87YBzz4vEHweTeaC98luA+KMHQzTKZjbEHA7By8Da7KmAY9t7HChrQXqsVVijVvH2lIRzzSepuYAAnjZM0rYWEA== Received: from DM6PR02CA0069.namprd02.prod.outlook.com (2603:10b6:5:177::46) by MN2PR12MB4375.namprd12.prod.outlook.com (2603:10b6:208:24f::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.19; Fri, 23 Sep 2022 14:44:27 +0000 Received: from DM6NAM11FT069.eop-nam11.prod.protection.outlook.com (2603:10b6:5:177:cafe::5f) by DM6PR02CA0069.outlook.office365.com (2603:10b6:5:177::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.20 via Frontend Transport; Fri, 23 Sep 2022 14:44:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by DM6NAM11FT069.mail.protection.outlook.com (10.13.173.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Fri, 23 Sep 2022 14:44:26 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Fri, 23 Sep 2022 07:44:16 -0700 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.986.29; Fri, 23 Sep 2022 07:44:14 -0700 From: Suanming Mou To: Matan Azrad , Viacheslav Ovsiienko CC: , Xiaoyu Min Subject: [PATCH 15/27] net/mlx5: update indirect actions ops to HW variation Date: Fri, 23 Sep 2022 17:43:22 +0300 Message-ID: <20220923144334.27736-16-suanmingm@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20220923144334.27736-1-suanmingm@nvidia.com> References: <20220923144334.27736-1-suanmingm@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT069:EE_|MN2PR12MB4375:EE_ X-MS-Office365-Filtering-Correlation-Id: 407850cc-83a7-4d60-eaef-08da9d721d54 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YMomocwE7U8FdTkmiAhbHsbzLrVOYWabEUztNwPdODNmnYQKHiOqjRLoHB9h3bqbRrxMYfpzONDAugc5BMtG0RWg5pRiIZzaZbCPZtSWiotTfq6oodpCuqv0pCMIOCvsifvV0NB4hB9mx4qjkx6AWC1ASd3sY12otWhnpf5lF+R7DFmQXQHPZW4jAccRFJGKetQja1kWg5rNPLIQNPx21yH3+513Q1AUfYe5MG00zCVWiMCnkANNJTCLtKjLjmzBd7SJ/zxkFwJzKyzSJHkajtQVXZ+ByKY38hoh4ixpCHVvJFCcBiY0ZamezInagIKNBs255TxqCMsTTcjNDrQV3z+yIPOv3WXXa5PinaWQxmzx2vh4lIZ9vYjbl+R0ChYIMejWaz3/pxbnzDKPJ1sosNZSrXm09kPmQDsxqNNnHehe505XCODPZf9gJbQgfRj4sYfjqW8EuNpy8pxfIiMbwHUf4A3TJyknSd3ZtwkW/nxKtW4cSW15blezQGjXCLYnTPDFsojjD9BCcH3+XamPjvhlEVHALZcv+whxs+XdcS94kgjP/qSo/mhMt/e6NzxiSyrq3qkZtefv10Mt2l5X7sgtwU7K2bATDSlhFZZaxurjce+pp1aBoHZ6pVK1kTuNcRo126vT7MPisRgLXWqOivswc+Ze5/ujLpOKar5ODmUEVB6RbzaAeNsmtOpRqhae69mWo6bZcRlABTPlnPyX7NX6VFs3zIUhF+MVTys/uSAqoSdGJARH6WWtw1ThgVQqGRGFFPvvzytPd/ctTW+wbA== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(136003)(376002)(346002)(396003)(39860400002)(451199015)(40470700004)(36840700001)(46966006)(26005)(2616005)(6286002)(7696005)(55016003)(82740400003)(86362001)(110136005)(70586007)(8676002)(70206006)(4326008)(316002)(40460700003)(356005)(36860700001)(7636003)(1076003)(186003)(82310400005)(16526019)(36756003)(107886003)(6666004)(478600001)(54906003)(47076005)(41300700001)(5660300002)(426003)(40480700001)(2906002)(336012)(83380400001)(8936002)(15650500001)(6636002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 14:44:26.8721 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 407850cc-83a7-4d60-eaef-08da9d721d54 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.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT069.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4375 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 From: Xiaoyu Min Each flow engine should have its own callback functions for each flow's ops. Create new callback functions for indirect actions' ops which actually are wrppers of their mlx5_hw_async_* counter parts. Signed-off-by: Xiaoyu Min --- drivers/net/mlx5/mlx5_flow_hw.c | 98 +++++++++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index d828d49613..de82396a04 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -4988,6 +4988,96 @@ flow_hw_query(struct rte_eth_dev *dev, return ret; } +/** + * Create indirect action. + * + * @param[in] dev + * Pointer to the Ethernet device structure. + * @param[in] conf + * Shared action configuration. + * @param[in] action + * Action specification used to create indirect action. + * @param[out] error + * Perform verbose error reporting if not NULL. Initialized in case of + * error only. + * + * @return + * A valid shared action handle in case of success, NULL otherwise and + * rte_errno is set. + */ +static struct rte_flow_action_handle * +flow_hw_action_create(struct rte_eth_dev *dev, + const struct rte_flow_indir_action_conf *conf, + const struct rte_flow_action *action, + struct rte_flow_error *err) +{ + return flow_hw_action_handle_create(dev, UINT32_MAX, NULL, conf, action, + NULL, err); +} + +/** + * Destroy the indirect action. + * Release action related resources on the NIC and the memory. + * Lock free, (mutex should be acquired by caller). + * Dispatcher for action type specific call. + * + * @param[in] dev + * Pointer to the Ethernet device structure. + * @param[in] handle + * The indirect action object handle to be removed. + * @param[out] error + * Perform verbose error reporting if not NULL. Initialized in case of + * error only. + * + * @return + * 0 on success, otherwise negative errno value. + */ +static int +flow_hw_action_destroy(struct rte_eth_dev *dev, + struct rte_flow_action_handle *handle, + struct rte_flow_error *error) +{ + return flow_hw_action_handle_destroy(dev, UINT32_MAX, NULL, handle, + NULL, error); +} + +/** + * Updates in place shared action configuration. + * + * @param[in] dev + * Pointer to the Ethernet device structure. + * @param[in] handle + * The indirect action object handle to be updated. + * @param[in] update + * Action specification used to modify the action pointed by *handle*. + * *update* could be of same type with the action pointed by the *handle* + * handle argument, or some other structures like a wrapper, depending on + * the indirect action type. + * @param[out] error + * Perform verbose error reporting if not NULL. Initialized in case of + * error only. + * + * @return + * 0 on success, otherwise negative errno value. + */ +static int +flow_hw_action_update(struct rte_eth_dev *dev, + struct rte_flow_action_handle *handle, + const void *update, + struct rte_flow_error *err) +{ + return flow_hw_action_handle_update(dev, UINT32_MAX, NULL, handle, + update, NULL, err); +} + +static int +flow_hw_action_query(struct rte_eth_dev *dev, + const struct rte_flow_action_handle *handle, void *data, + struct rte_flow_error *error) +{ + return flow_dv_action_query(dev, handle, data, error); +} + const struct mlx5_flow_driver_ops mlx5_flow_hw_drv_ops = { .info_get = flow_hw_info_get, .configure = flow_hw_configure, @@ -5007,10 +5097,10 @@ const struct mlx5_flow_driver_ops mlx5_flow_hw_drv_ops = { .async_action_destroy = flow_hw_action_handle_destroy, .async_action_update = flow_hw_action_handle_update, .action_validate = flow_dv_action_validate, - .action_create = flow_dv_action_create, - .action_destroy = flow_dv_action_destroy, - .action_update = flow_dv_action_update, - .action_query = flow_dv_action_query, + .action_create = flow_hw_action_create, + .action_destroy = flow_hw_action_destroy, + .action_update = flow_hw_action_update, + .action_query = flow_hw_action_query, .query = flow_hw_query, }; -- 2.25.1