Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/96038/?format=api
http://patchwork.dpdk.org/api/patches/96038/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210719025410.15483-15-xuemingl@nvidia.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20210719025410.15483-15-xuemingl@nvidia.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210719025410.15483-15-xuemingl@nvidia.com", "date": "2021-07-19T02:54:09", "name": "[v3,14/15] compress/mlx5: migrate to common driver", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "882ea008e164f162fdd8d0114b230ac55f3d4d97", "submitter": { "id": 1904, "url": "http://patchwork.dpdk.org/api/people/1904/?format=api", "name": "Xueming Li", "email": "xuemingl@nvidia.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20210719025410.15483-15-xuemingl@nvidia.com/mbox/", "series": [ { "id": 17884, "url": "http://patchwork.dpdk.org/api/series/17884/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=17884", "date": "2021-07-19T02:53:55", "name": "net/mlx5: support Sub-Function", "version": 3, "mbox": "http://patchwork.dpdk.org/series/17884/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/96038/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/96038/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 722E5A0C46;\n\tMon, 19 Jul 2021 04:56:29 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DAD7D411C8;\n\tMon, 19 Jul 2021 04:56:04 +0200 (CEST)", "from NAM10-BN7-obe.outbound.protection.outlook.com\n (mail-bn7nam10on2057.outbound.protection.outlook.com [40.107.92.57])\n by mails.dpdk.org (Postfix) with ESMTP id 1F06E411B0\n for <dev@dpdk.org>; Mon, 19 Jul 2021 04:56:01 +0200 (CEST)", "from MW4PR03CA0091.namprd03.prod.outlook.com (2603:10b6:303:b7::6)\n by CY4PR12MB1606.namprd12.prod.outlook.com (2603:10b6:910:10::15) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.21; Mon, 19 Jul\n 2021 02:55:59 +0000", "from CO1NAM11FT060.eop-nam11.prod.protection.outlook.com\n (2603:10b6:303:b7:cafe::a2) by MW4PR03CA0091.outlook.office365.com\n (2603:10b6:303:b7::6) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.23 via Frontend\n Transport; Mon, 19 Jul 2021 02:55:59 +0000", "from mail.nvidia.com (216.228.112.34) by\n CO1NAM11FT060.mail.protection.outlook.com (10.13.175.132) with Microsoft SMTP\n Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id\n 15.20.4331.21 via Frontend Transport; Mon, 19 Jul 2021 02:55:59 +0000", "from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com\n (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 19 Jul\n 2021 02:55:56 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=nbjPPug0SeDmbPOExCs2VwYBXTyJ8GPUzlGS/63BsQhmRIXT98zLX9IKNdi1M5Q3ePwWMjRfKggcKXX6CThVzDMzBEK2ioEvAx1QAft9K/8YxmZ4fmeFA/GGKJBvxca3QJKBXqv5cM+5SyMJsa3KMdX3Dc27B7wnc4k80kFQk9GWoeeTkUtqWJh2QO+odgLKdBluO4NB/dg/5r8JDK/RIkIlmIMmYBagurIcGHuzfR2fXGfy0Qb/+HEUf3F/V/CxUB7wrN8zCM9KwwbxbcN6VuRHSRlG68JGcgt0wutgrZW1twtxR4nhziwUR/e9LcLdZhXHx4DALo7ZYXLP9nVt8A==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=yIrFe2ZOlwhlHsJ1fY7U+iesWwWW5wQ8ZdM9JXNUKcg=;\n b=oL+9XoZUdDjlw5s4D9fqRgisoPLeOY2ZpuMeZVckHg9lvMKlTjzXb2jA1OByDQhbbWHi9j1QpdxIJaA4rlwsyUbrETON7ndZZ8kozRNoKrohk24qOtVxYuOABj/S7jExweCQiJ4sYVRodtaxLSiY3AvCEwMoUiV75cP5qBKbKR77EdnCHP3Uvyz1qPlwmLmucMprG31u/tSDahHp5+t9XWwavWqQjvMyGdsQkxbM0+JVFs1Tao6HOnreZKvK3L2wtcjKuUt5WHmMh/2A5iQHfYiPSPiy2fpAYgDvUzDc4AvPHXj62RXrWa1rzY3wO4cGX+OXZD06QYmwa4C3712qVQ==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 216.228.112.34) smtp.rcpttodomain=marvell.com smtp.mailfrom=nvidia.com;\n dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com;\n dkim=none (message not signed); arc=none", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com;\n s=selector2;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=yIrFe2ZOlwhlHsJ1fY7U+iesWwWW5wQ8ZdM9JXNUKcg=;\n b=SjUAuZwSIWSydilLOWrZvdM5XIiziYeH2jkVG/Gkeo23JZliIGOqsCSjOgTf7eP0k3Xc8AIBMSdR8QKydLBZO8ebbtORKWj25TetHgzih9OMT2EHT+PPUy3p6QqrgWBF4x5OuQdzfoJTB5j+vnxR6vja/JPy4UewU1aQ3tQdXIO9dPdD3bHLuCtZ4rsvXeHvZgsXoIqPvL0obrZKoCiLTUdPYE0TLv8a0rljjHI51u6YUcg3Y5xuxiS4mCptL6LVo/nkPdVMXlbt4qw2Bt4pgLCsgNr3WV4lPNGVLytezIQPXvEbKnDkk4M0sN9T1tBlRiCSshHjE/S8Oqgn6vD9bg==", "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 216.228.112.34)\n smtp.mailfrom=nvidia.com; marvell.com; dkim=none (message not signed)\n header.d=none;marvell.com; dmarc=pass action=none header.from=nvidia.com;", "Received-SPF": "Pass (protection.outlook.com: domain of nvidia.com designates\n 216.228.112.34 as permitted sender) receiver=protection.outlook.com;\n client-ip=216.228.112.34; helo=mail.nvidia.com;", "From": "Xueming Li <xuemingl@nvidia.com>", "To": "Viacheslav Ovsiienko <viacheslavo@nvidia.com>", "CC": "<dev@dpdk.org>, <xuemingl@nvidia.com>, Matan Azrad <matan@nvidia.com>,\n Fiona Trahe <fiona.trahe@intel.com>, Ashish Gupta <ashish.gupta@marvell.com>", "Date": "Mon, 19 Jul 2021 10:54:09 +0800", "Message-ID": "<20210719025410.15483-15-xuemingl@nvidia.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210713131437.30170-2-xuemingl@nvidia.com>", "References": "<20210713131437.30170-2-xuemingl@nvidia.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Originating-IP": "[172.20.187.5]", "X-ClientProxiedBy": "HQMAIL105.nvidia.com (172.20.187.12) To\n HQMAIL107.nvidia.com (172.20.187.13)", "X-EOPAttributedMessage": "0", "X-MS-PublicTrafficType": "Email", "X-MS-Office365-Filtering-Correlation-Id": "f5d92bf2-4445-419b-e690-08d94a60bca4", "X-MS-TrafficTypeDiagnostic": "CY4PR12MB1606:", "X-Microsoft-Antispam-PRVS": "\n <CY4PR12MB1606ABDF04318A158DCD9D15A1E19@CY4PR12MB1606.namprd12.prod.outlook.com>", "X-MS-Oob-TLC-OOBClassifiers": "OLM:4303;", "X-MS-Exchange-SenderADCheck": "1", "X-MS-Exchange-AntiSpam-Relay": "0", "X-Microsoft-Antispam": "BCL:0;", "X-Microsoft-Antispam-Message-Info": "\n 6xeq/HjZx+QfSNlrX1FMcu2h632w3cAZtWW3j7m12aHAFNb8Picx5K4XrH8loaGPaKtB3WteuX4BLxCWCBUQ35wkn4DHV7PCdFuvJDbPAu1P4q4oFeWW0r4pAaGce9//LbYl1dLxKgo5VpmgMP7CMRnpHITn/+gPuGNQGiQ6rYDd0qZyjIp32TJ3/z2fHiA7ariIKB9ZQZvTiEXjjH4LIwhbDxypHJN9FQ31ucOTcbHpZjlvOY5PI8prz0SqIFZy0cIs2/MjUhUlTAH9zNR87CYR+losLynXxtmGZCD/AoexHRsaDxiG4/ozNnhRFlwOuM2C6tRnNiYEwSUVZyulT0VGOZ2iPdmj6vnSAeZvyBCr6xzGxYgYy+f24mkkVfD1GqyrXFqXA9ytbqyqE5b0fzHqGd/B0tkBMsLRUHK9fBx4wY11nYxBBynNYl0LGWLgk102lOFQXuwwBT4keHN4h2VJk4kV1HOWqbIVb/p00nQfK+vWkPodra4RVpfOKqjAyn4vhS0X1TWmJ9hXRS5OjY8G0dvoqqM6zHNDyQ9STJ1GPwM0mym0sRUA5JauDh7cD8GTxoXfoz8lSsP5cOkqo0Lf69ptLBHntz29P4cb7aWSZRJDEhs40B6frcqMV/8ecfarNUfg9dClA+Gfv38mpHy7Ysyakls5zFMb/yb8fMQOb1MjNDL2xK1Y5kH1pAaiIVFVt0jj6w48PDjUcImheg==", "X-Forefront-Antispam-Report": "CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1;\n SRV:;\n IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE;\n SFS:(4636009)(136003)(39860400002)(346002)(396003)(376002)(46966006)(36840700001)(82740400003)(2906002)(6636002)(336012)(7696005)(37006003)(55016002)(186003)(2616005)(6862004)(5660300002)(8936002)(26005)(6286002)(7636003)(6666004)(83380400001)(47076005)(4326008)(36756003)(356005)(316002)(16526019)(36906005)(426003)(36860700001)(8676002)(70206006)(82310400003)(478600001)(86362001)(54906003)(70586007)(1076003);\n DIR:OUT; SFP:1101;", "X-OriginatorOrg": "Nvidia.com", "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "19 Jul 2021 02:55:59.0785 (UTC)", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n f5d92bf2-4445-419b-e690-08d94a60bca4", "X-MS-Exchange-CrossTenant-Id": "43083d15-7273-40c1-b7db-39efd9ccc17a", "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34];\n Helo=[mail.nvidia.com]", "X-MS-Exchange-CrossTenant-AuthSource": "\n CO1NAM11FT060.eop-nam11.prod.protection.outlook.com", "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous", "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CY4PR12MB1606", "Subject": "[dpdk-dev] [PATCH v3 14/15] compress/mlx5: migrate to common driver", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "To support auxiliary bus, upgrades driver to use mlx5 common driver\nstructure.\n\nSigned-off-by: Xueming Li <xuemingl@nvidia.com>\n---\n drivers/compress/mlx5/mlx5_compress.c | 71 ++++++---------------------\n 1 file changed, 15 insertions(+), 56 deletions(-)", "diff": "diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c\nindex 80c564f10b..77f426e399 100644\n--- a/drivers/compress/mlx5/mlx5_compress.c\n+++ b/drivers/compress/mlx5/mlx5_compress.c\n@@ -5,7 +5,7 @@\n #include <rte_malloc.h>\n #include <rte_log.h>\n #include <rte_errno.h>\n-#include <rte_pci.h>\n+#include <rte_bus_pci.h>\n #include <rte_spinlock.h>\n #include <rte_comp.h>\n #include <rte_compressdev.h>\n@@ -13,7 +13,6 @@\n \n #include <mlx5_glue.h>\n #include <mlx5_common.h>\n-#include <mlx5_common_pci.h>\n #include <mlx5_devx_cmds.h>\n #include <mlx5_common_os.h>\n #include <mlx5_common_devx.h>\n@@ -37,7 +36,6 @@ struct mlx5_compress_xform {\n struct mlx5_compress_priv {\n \tTAILQ_ENTRY(mlx5_compress_priv) next;\n \tstruct ibv_context *ctx; /* Device context. */\n-\tstruct rte_pci_device *pci_dev;\n \tstruct rte_compressdev *cdev;\n \tvoid *uar;\n \tuint32_t pdn; /* Protection Domain number. */\n@@ -711,23 +709,8 @@ mlx5_compress_hw_global_prepare(struct mlx5_compress_priv *priv)\n \treturn 0;\n }\n \n-/**\n- * DPDK callback to register a PCI device.\n- *\n- * This function spawns compress device out of a given PCI device.\n- *\n- * @param[in] pci_drv\n- * PCI driver structure (mlx5_compress_driver).\n- * @param[in] pci_dev\n- * PCI device information.\n- *\n- * @return\n- * 0 on success, 1 to skip this driver, a negative errno value otherwise\n- * and rte_errno is set.\n- */\n static int\n-mlx5_compress_pci_probe(struct rte_pci_driver *pci_drv,\n-\t\t\tstruct rte_pci_device *pci_dev)\n+mlx5_compress_dev_probe(struct rte_device *dev)\n {\n \tstruct ibv_device *ibv;\n \tstruct rte_compressdev *cdev;\n@@ -736,24 +719,17 @@ mlx5_compress_pci_probe(struct rte_pci_driver *pci_drv,\n \tstruct mlx5_hca_attr att = { 0 };\n \tstruct rte_compressdev_pmd_init_params init_params = {\n \t\t.name = \"\",\n-\t\t.socket_id = pci_dev->device.numa_node,\n+\t\t.socket_id = dev->numa_node,\n \t};\n \n-\tRTE_SET_USED(pci_drv);\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n \t\tDRV_LOG(ERR, \"Non-primary process type is not supported.\");\n \t\trte_errno = ENOTSUP;\n \t\treturn -rte_errno;\n \t}\n-\tibv = mlx5_os_get_ibv_device(&pci_dev->addr);\n-\tif (ibv == NULL) {\n-\t\tDRV_LOG(ERR, \"No matching IB device for PCI slot \"\n-\t\t\tPCI_PRI_FMT \".\", pci_dev->addr.domain,\n-\t\t\tpci_dev->addr.bus, pci_dev->addr.devid,\n-\t\t\tpci_dev->addr.function);\n+\tibv = mlx5_os_get_ibv_dev(dev);\n+\tif (ibv == NULL)\n \t\treturn -rte_errno;\n-\t}\n-\tDRV_LOG(INFO, \"PCI information matches for device \\\"%s\\\".\", ibv->name);\n \tctx = mlx5_glue->dv_open_device(ibv);\n \tif (ctx == NULL) {\n \t\tDRV_LOG(ERR, \"Failed to open IB device \\\"%s\\\".\", ibv->name);\n@@ -769,7 +745,7 @@ mlx5_compress_pci_probe(struct rte_pci_driver *pci_drv,\n \t\trte_errno = ENOTSUP;\n \t\treturn -ENOTSUP;\n \t}\n-\tcdev = rte_compressdev_pmd_create(ibv->name, &pci_dev->device,\n+\tcdev = rte_compressdev_pmd_create(ibv->name, dev,\n \t\t\t\t\t sizeof(*priv), &init_params);\n \tif (cdev == NULL) {\n \t\tDRV_LOG(ERR, \"Failed to create device \\\"%s\\\".\", ibv->name);\n@@ -784,7 +760,6 @@ mlx5_compress_pci_probe(struct rte_pci_driver *pci_drv,\n \tcdev->feature_flags = RTE_COMPDEV_FF_HW_ACCELERATED;\n \tpriv = cdev->data->dev_private;\n \tpriv->ctx = ctx;\n-\tpriv->pci_dev = pci_dev;\n \tpriv->cdev = cdev;\n \tpriv->min_block_size = att.compress_min_block_size;\n \tpriv->sq_ts_format = att.sq_ts_format;\n@@ -810,25 +785,14 @@ mlx5_compress_pci_probe(struct rte_pci_driver *pci_drv,\n \treturn 0;\n }\n \n-/**\n- * DPDK callback to remove a PCI device.\n- *\n- * This function removes all compress devices belong to a given PCI device.\n- *\n- * @param[in] pci_dev\n- * Pointer to the PCI device.\n- *\n- * @return\n- * 0 on success, the function cannot fail.\n- */\n static int\n-mlx5_compress_pci_remove(struct rte_pci_device *pdev)\n+mlx5_compress_dev_remove(struct rte_device *dev)\n {\n \tstruct mlx5_compress_priv *priv = NULL;\n \n \tpthread_mutex_lock(&priv_list_lock);\n \tTAILQ_FOREACH(priv, &mlx5_compress_priv_list, next)\n-\t\tif (rte_pci_addr_cmp(&priv->pci_dev->addr, &pdev->addr) != 0)\n+\t\tif (priv->cdev->device == dev)\n \t\t\tbreak;\n \tif (priv)\n \t\tTAILQ_REMOVE(&mlx5_compress_priv_list, priv, next);\n@@ -852,24 +816,19 @@ static const struct rte_pci_id mlx5_compress_pci_id_map[] = {\n \t}\n };\n \n-static struct mlx5_pci_driver mlx5_compress_driver = {\n-\t.driver_class = MLX5_CLASS_COMPRESS,\n-\t.pci_driver = {\n-\t\t.driver = {\n-\t\t\t.name = RTE_STR(MLX5_COMPRESS_DRIVER_NAME),\n-\t\t},\n-\t\t.id_table = mlx5_compress_pci_id_map,\n-\t\t.probe = mlx5_compress_pci_probe,\n-\t\t.remove = mlx5_compress_pci_remove,\n-\t\t.drv_flags = 0,\n-\t},\n+static struct mlx5_class_driver mlx5_compress_driver = {\n+\t.drv_class = MLX5_CLASS_COMPRESS,\n+\t.name = RTE_STR(MLX5_COMPRESS_DRIVER_NAME),\n+\t.id_table = mlx5_compress_pci_id_map,\n+\t.probe = mlx5_compress_dev_probe,\n+\t.remove = mlx5_compress_dev_remove,\n };\n \n RTE_INIT(rte_mlx5_compress_init)\n {\n \tmlx5_common_init();\n \tif (mlx5_glue != NULL)\n-\t\tmlx5_pci_driver_register(&mlx5_compress_driver);\n+\t\tmlx5_class_driver_register(&mlx5_compress_driver);\n }\n \n RTE_LOG_REGISTER_DEFAULT(mlx5_compress_logtype, NOTICE)\n", "prefixes": [ "v3", "14/15" ] }{ "id": 96038, "url": "