get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/117298/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 117298,
    "url": "http://patches.dpdk.org/api/patches/117298/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221004095132.198777-5-david.marchand@redhat.com/",
    "project": {
        "id": 1,
        "url": "http://patches.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": "<20221004095132.198777-5-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221004095132.198777-5-david.marchand@redhat.com",
    "date": "2022-10-04T09:51:32",
    "name": "[v2,4/4] crypto/ccp: fix PCI probing",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "6a2c002da0f595d28766fb662444fc9bdf0ff6f2",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 6690,
        "url": "http://patches.dpdk.org/api/users/6690/?format=api",
        "username": "akhil",
        "first_name": "akhil",
        "last_name": "goyal",
        "email": "gakhil@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221004095132.198777-5-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 24961,
            "url": "http://patches.dpdk.org/api/series/24961/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24961",
            "date": "2022-10-04T09:51:28",
            "name": "crypto/ccp cleanup",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/24961/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/117298/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/117298/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 E1D6AA0543;\n\tTue,  4 Oct 2022 11:52:11 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 14DE042847;\n\tTue,  4 Oct 2022 11:52:01 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 7820240DDC\n for <dev@dpdk.org>; Tue,  4 Oct 2022 11:52:00 +0200 (CEST)",
            "from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com\n [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-548-JvVWZ2RlP0-hMmCDekzkLg-1; Tue, 04 Oct 2022 05:51:57 -0400",
            "from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com\n [10.11.54.5])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 948843C0D189;\n Tue,  4 Oct 2022 09:51:56 +0000 (UTC)",
            "from localhost.localdomain (unknown [10.40.195.42])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 56A1139DB3;\n Tue,  4 Oct 2022 09:51:55 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1664877120;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=W+WQ0Ym4ZPpyGk48cXwLy+OxHGPukEznQYv3uy+dgJQ=;\n b=gEmN1mR/xS2zxgFptfLJR5zoyY17Bbw5R6VXZUxQGrTbTuTNvhW8cmGE90F7DlmDu8nUuD\n l0YDIwGmNmUUgvdY2VEJ4e94rPmhyHFehSq7TiWss/C3Ez8rywSLF/FEGdekZmCdSWrfI9\n 5t2S0nWRdUo5Ha/kSUN+PnH2dCJhZ/k=",
        "X-MC-Unique": "JvVWZ2RlP0-hMmCDekzkLg-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "gakhil@marvell.com, sunilprakashrao.uttarwar@amd.com, stable@dpdk.org,\n Amaranath Somalapuram <asomalap@amd.com>",
        "Subject": "[PATCH v2 4/4] crypto/ccp: fix PCI probing",
        "Date": "Tue,  4 Oct 2022 11:51:32 +0200",
        "Message-Id": "<20221004095132.198777-5-david.marchand@redhat.com>",
        "In-Reply-To": "<20221004095132.198777-1-david.marchand@redhat.com>",
        "References": "<20220909150411.3702860-1-david.marchand@redhat.com>\n <20221004095132.198777-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.5",
        "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": "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"
    },
    "content": "This driver has been converted from a vdev driver to a pci driver some\ntime ago.  This conversion is buggy as it tries to probe any pci devices\npresent on a system for *each* probe request from the PCI bus.\n\nRely on the passed pci device and only probe what is requested.\n\nWhile at it:\n- stop copying the pci device object content into a local private copy,\n- rely on the PCI identifier and remove internal ccp_device_version\n  identifier,\n- ccp_list can be made static,\n\nWith this done, all the code parsing Linux sysfs can be dropped.\n\nFixes: 889317b7ecb3 (\"crypto/ccp: convert driver from vdev to PCI\")\nCc: stable@dpdk.org\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n drivers/crypto/ccp/ccp_crypto.c  |   1 -\n drivers/crypto/ccp/ccp_dev.c     |  89 ++-----------\n drivers/crypto/ccp/ccp_dev.h     |  31 ++---\n drivers/crypto/ccp/ccp_pci.c     | 207 -------------------------------\n drivers/crypto/ccp/ccp_pci.h     |  24 ----\n drivers/crypto/ccp/meson.build   |   1 -\n drivers/crypto/ccp/rte_ccp_pmd.c |  18 +--\n 7 files changed, 26 insertions(+), 345 deletions(-)\n delete mode 100644 drivers/crypto/ccp/ccp_pci.c\n delete mode 100644 drivers/crypto/ccp/ccp_pci.h",
    "diff": "diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c\nindex 351d8ac63e..461f18ca2e 100644\n--- a/drivers/crypto/ccp/ccp_crypto.c\n+++ b/drivers/crypto/ccp/ccp_crypto.c\n@@ -26,7 +26,6 @@\n \n #include \"ccp_dev.h\"\n #include \"ccp_crypto.h\"\n-#include \"ccp_pci.h\"\n #include \"ccp_pmd_private.h\"\n \n #include <openssl/conf.h>\ndiff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c\nindex 14c54929c4..ee30f5ac30 100644\n--- a/drivers/crypto/ccp/ccp_dev.c\n+++ b/drivers/crypto/ccp/ccp_dev.c\n@@ -20,10 +20,9 @@\n #include <rte_string_fns.h>\n \n #include \"ccp_dev.h\"\n-#include \"ccp_pci.h\"\n #include \"ccp_pmd_private.h\"\n \n-struct ccp_list ccp_list = TAILQ_HEAD_INITIALIZER(ccp_list);\n+static TAILQ_HEAD(, ccp_device) ccp_list = TAILQ_HEAD_INITIALIZER(ccp_list);\n static int ccp_dev_id;\n \n int\n@@ -68,7 +67,7 @@ ccp_read_hwrng(uint32_t *value)\n \tstruct ccp_device *dev;\n \n \tTAILQ_FOREACH(dev, &ccp_list, next) {\n-\t\tvoid *vaddr = (void *)(dev->pci.mem_resource[2].addr);\n+\t\tvoid *vaddr = (void *)(dev->pci->mem_resource[2].addr);\n \n \t\twhile (dev->hwrng_retries++ < CCP_MAX_TRNG_RETRIES) {\n \t\t\t*value = CCP_READ_REG(vaddr, TRNG_OUT_REG);\n@@ -480,7 +479,7 @@ ccp_assign_lsbs(struct ccp_device *ccp)\n }\n \n static int\n-ccp_add_device(struct ccp_device *dev, int type)\n+ccp_add_device(struct ccp_device *dev)\n {\n \tint i;\n \tuint32_t qmr, status_lo, status_hi, dma_addr_lo, dma_addr_hi;\n@@ -494,9 +493,9 @@ ccp_add_device(struct ccp_device *dev, int type)\n \n \tdev->id = ccp_dev_id++;\n \tdev->qidx = 0;\n-\tvaddr = (void *)(dev->pci.mem_resource[2].addr);\n+\tvaddr = (void *)(dev->pci->mem_resource[2].addr);\n \n-\tif (type == CCP_VERSION_5B) {\n+\tif (dev->pci->id.device_id == AMD_PCI_CCP_5B) {\n \t\tCCP_WRITE_REG(vaddr, CMD_TRNG_CTL_OFFSET, 0x00012D57);\n \t\tCCP_WRITE_REG(vaddr, CMD_CONFIG_0_OFFSET, 0x00000003);\n \t\tfor (i = 0; i < 12; i++) {\n@@ -615,41 +614,8 @@ ccp_remove_device(struct ccp_device *dev)\n \tTAILQ_REMOVE(&ccp_list, dev, next);\n }\n \n-static int\n-is_ccp_device(const char *dirname,\n-\t      const struct rte_pci_id *ccp_id,\n-\t      int *type)\n-{\n-\tchar filename[PATH_MAX];\n-\tconst struct rte_pci_id *id;\n-\tuint16_t vendor, device_id;\n-\tint i;\n-\tunsigned long tmp;\n-\n-\t/* get vendor id */\n-\tsnprintf(filename, sizeof(filename), \"%s/vendor\", dirname);\n-\tif (ccp_pci_parse_sysfs_value(filename, &tmp) < 0)\n-\t\treturn 0;\n-\tvendor = (uint16_t)tmp;\n-\n-\t/* get device id */\n-\tsnprintf(filename, sizeof(filename), \"%s/device\", dirname);\n-\tif (ccp_pci_parse_sysfs_value(filename, &tmp) < 0)\n-\t\treturn 0;\n-\tdevice_id = (uint16_t)tmp;\n-\n-\tfor (id = ccp_id, i = 0; id->vendor_id != 0; id++, i++) {\n-\t\tif (vendor == id->vendor_id &&\n-\t\t    device_id == id->device_id) {\n-\t\t\t*type = i;\n-\t\t\treturn 1; /* Matched device */\n-\t\t}\n-\t}\n-\treturn 0;\n-}\n-\n-static int\n-ccp_probe_device(int ccp_type, struct rte_pci_device *pci_dev)\n+int\n+ccp_probe_device(struct rte_pci_device *pci_dev)\n {\n \tstruct ccp_device *ccp_dev;\n \n@@ -658,10 +624,10 @@ ccp_probe_device(int ccp_type, struct rte_pci_device *pci_dev)\n \tif (ccp_dev == NULL)\n \t\tgoto fail;\n \n-\tccp_dev->pci = *pci_dev;\n+\tccp_dev->pci = pci_dev;\n \n \t/* device is valid, add in list */\n-\tif (ccp_add_device(ccp_dev, ccp_type)) {\n+\tif (ccp_add_device(ccp_dev)) {\n \t\tccp_remove_device(ccp_dev);\n \t\tgoto fail;\n \t}\n@@ -672,40 +638,3 @@ ccp_probe_device(int ccp_type, struct rte_pci_device *pci_dev)\n \trte_free(ccp_dev);\n \treturn -1;\n }\n-\n-int\n-ccp_probe_devices(struct rte_pci_device *pci_dev,\n-\t\tconst struct rte_pci_id *ccp_id)\n-{\n-\tint dev_cnt = 0;\n-\tint ccp_type = 0;\n-\tstruct dirent *d;\n-\tDIR *dir;\n-\tint ret = 0;\n-\tuint16_t domain;\n-\tuint8_t bus, devid, function;\n-\tchar dirname[PATH_MAX];\n-\n-\tTAILQ_INIT(&ccp_list);\n-\tdir = opendir(SYSFS_PCI_DEVICES);\n-\tif (dir == NULL)\n-\t\treturn -1;\n-\twhile ((d = readdir(dir)) != NULL) {\n-\t\tif (d->d_name[0] == '.')\n-\t\t\tcontinue;\n-\t\tif (ccp_parse_pci_addr_format(d->d_name, sizeof(d->d_name),\n-\t\t\t\t\t&domain, &bus, &devid, &function) != 0)\n-\t\t\tcontinue;\n-\t\tsnprintf(dirname, sizeof(dirname), \"%s/%s\",\n-\t\t\t     SYSFS_PCI_DEVICES, d->d_name);\n-\t\tif (is_ccp_device(dirname, ccp_id, &ccp_type)) {\n-\t\t\tCCP_LOG_DBG(\"CCP : Detected CCP device with ID = 0x%x\\n\",\n-\t\t\t       ccp_id[ccp_type].device_id);\n-\t\t\tret = ccp_probe_device(ccp_type, pci_dev);\n-\t\t\tif (ret == 0)\n-\t\t\t\tdev_cnt++;\n-\t\t}\n-\t}\n-\tclosedir(dir);\n-\treturn dev_cnt;\n-}\ndiff --git a/drivers/crypto/ccp/ccp_dev.h b/drivers/crypto/ccp/ccp_dev.h\nindex 9deaae7980..e3ec481dd3 100644\n--- a/drivers/crypto/ccp/ccp_dev.h\n+++ b/drivers/crypto/ccp/ccp_dev.h\n@@ -19,6 +19,12 @@\n #include <rte_crypto_sym.h>\n #include <cryptodev_pmd.h>\n \n+/* CCP PCI device identifiers */\n+#define AMD_PCI_VENDOR_ID 0x1022\n+#define AMD_PCI_CCP_5A 0x1456\n+#define AMD_PCI_CCP_5B 0x1468\n+#define AMD_PCI_CCP_RV 0x15df\n+\n /**< CCP specific */\n #define MAX_HW_QUEUES                   5\n #define CCP_MAX_TRNG_RETRIES\t\t10\n@@ -169,18 +175,6 @@ static inline uint32_t ccp_pci_reg_read(void *base, int offset)\n #define CCP_WRITE_REG(hw_addr, reg_offset, value) \\\n \tccp_pci_reg_write(hw_addr, reg_offset, value)\n \n-TAILQ_HEAD(ccp_list, ccp_device);\n-\n-extern struct ccp_list ccp_list;\n-\n-/**\n- * CCP device version\n- */\n-enum ccp_device_version {\n-\tCCP_VERSION_5A = 0,\n-\tCCP_VERSION_5B,\n-};\n-\n /**\n  * A structure describing a CCP command queue.\n  */\n@@ -233,8 +227,8 @@ struct ccp_device {\n \t/**< ccp queue */\n \tint cmd_q_count;\n \t/**< no. of ccp Queues */\n-\tstruct rte_pci_device pci;\n-\t/**< ccp pci identifier */\n+\tstruct rte_pci_device *pci;\n+\t/**< ccp pci device */\n \tunsigned long lsbmap[CCP_BITMAP_SIZE(SLSB_MAP_SIZE)];\n \t/**< shared lsb mask of ccp */\n \trte_spinlock_t lsb_lock;\n@@ -468,13 +462,12 @@ high32_value(unsigned long addr)\n int ccp_dev_start(struct rte_cryptodev *dev);\n \n /**\n- * Detect ccp platform and initialize all ccp devices\n+ * Initialize one ccp device\n  *\n- * @param ccp_id rte_pci_id list for supported CCP devices\n- * @return no. of successfully initialized CCP devices\n+ * @dev rte pci device\n+ * @return 0 on success otherwise -1\n  */\n-int ccp_probe_devices(struct rte_pci_device *pci_dev,\n-\t\tconst struct rte_pci_id *ccp_id);\n+int ccp_probe_device(struct rte_pci_device *pci_dev);\n \n /**\n  * allocate a ccp command queue\ndiff --git a/drivers/crypto/ccp/ccp_pci.c b/drivers/crypto/ccp/ccp_pci.c\ndeleted file mode 100644\nindex bd1a037f76..0000000000\n--- a/drivers/crypto/ccp/ccp_pci.c\n+++ /dev/null\n@@ -1,207 +0,0 @@\n-/*   SPDX-License-Identifier: BSD-3-Clause\n- *   Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved.\n- */\n-\n-#include <dirent.h>\n-#include <fcntl.h>\n-#include <stdio.h>\n-#include <string.h>\n-#include <unistd.h>\n-\n-#include <rte_string_fns.h>\n-\n-#include \"ccp_pci.h\"\n-\n-/*\n- * split up a pci address into its constituent parts.\n- */\n-int\n-ccp_parse_pci_addr_format(const char *buf, int bufsize, uint16_t *domain,\n-\t\t\t  uint8_t *bus, uint8_t *devid, uint8_t *function)\n-{\n-\t/* first split on ':' */\n-\tunion splitaddr {\n-\t\tstruct {\n-\t\t\tchar *domain;\n-\t\t\tchar *bus;\n-\t\t\tchar *devid;\n-\t\t\tchar *function;\n-\t\t};\n-\t\tchar *str[PCI_FMT_NVAL];\n-\t\t/* last element-separator is \".\" not \":\" */\n-\t} splitaddr;\n-\n-\tchar *buf_copy = strndup(buf, bufsize);\n-\n-\tif (buf_copy == NULL)\n-\t\treturn -1;\n-\n-\tif (rte_strsplit(buf_copy, bufsize, splitaddr.str, PCI_FMT_NVAL, ':')\n-\t\t\t!= PCI_FMT_NVAL - 1)\n-\t\tgoto error;\n-\t/* final split is on '.' between devid and function */\n-\tsplitaddr.function = strchr(splitaddr.devid, '.');\n-\tif (splitaddr.function == NULL)\n-\t\tgoto error;\n-\t*splitaddr.function++ = '\\0';\n-\n-\t/* now convert to int values */\n-\terrno = 0;\n-\t*domain = (uint8_t)strtoul(splitaddr.domain, NULL, 16);\n-\t*bus = (uint8_t)strtoul(splitaddr.bus, NULL, 16);\n-\t*devid = (uint8_t)strtoul(splitaddr.devid, NULL, 16);\n-\t*function = (uint8_t)strtoul(splitaddr.function, NULL, 10);\n-\tif (errno != 0)\n-\t\tgoto error;\n-\n-\tfree(buf_copy); /* free the copy made with strdup */\n-\treturn 0;\n-error:\n-\tfree(buf_copy);\n-\treturn -1;\n-}\n-\n-int\n-ccp_pci_parse_sysfs_value(const char *filename, unsigned long *val)\n-{\n-\tFILE *f;\n-\tchar buf[BUFSIZ];\n-\tchar *end = NULL;\n-\n-\tf = fopen(filename, \"r\");\n-\tif (f == NULL)\n-\t\treturn -1;\n-\tif (fgets(buf, sizeof(buf), f) == NULL) {\n-\t\tfclose(f);\n-\t\treturn -1;\n-\t}\n-\t*val = strtoul(buf, &end, 0);\n-\tif ((buf[0] == '\\0') || (end == NULL) || (*end != '\\n')) {\n-\t\tfclose(f);\n-\t\treturn -1;\n-\t}\n-\tfclose(f);\n-\treturn 0;\n-}\n-\n-/** IO resource type: */\n-#define IORESOURCE_IO         0x00000100\n-#define IORESOURCE_MEM        0x00000200\n-\n-/* parse one line of the \"resource\" sysfs file (note that the 'line'\n- * string is modified)\n- */\n-static int\n-ccp_pci_parse_one_sysfs_resource(char *line, size_t len, uint64_t *phys_addr,\n-\t\t\t\t uint64_t *end_addr, uint64_t *flags)\n-{\n-\tunion pci_resource_info {\n-\t\tstruct {\n-\t\t\tchar *phys_addr;\n-\t\t\tchar *end_addr;\n-\t\t\tchar *flags;\n-\t\t};\n-\t\tchar *ptrs[PCI_RESOURCE_FMT_NVAL];\n-\t} res_info;\n-\n-\tif (rte_strsplit(line, len, res_info.ptrs, 3, ' ') != 3)\n-\t\treturn -1;\n-\terrno = 0;\n-\t*phys_addr = strtoull(res_info.phys_addr, NULL, 16);\n-\t*end_addr = strtoull(res_info.end_addr, NULL, 16);\n-\t*flags = strtoull(res_info.flags, NULL, 16);\n-\tif (errno != 0)\n-\t\treturn -1;\n-\n-\treturn 0;\n-}\n-\n-/* parse the \"resource\" sysfs file */\n-int\n-ccp_pci_parse_sysfs_resource(const char *filename, struct rte_pci_device *dev)\n-{\n-\tFILE *fp;\n-\tchar buf[BUFSIZ];\n-\tint i;\n-\tuint64_t phys_addr, end_addr, flags;\n-\n-\tfp = fopen(filename, \"r\");\n-\tif (fp == NULL)\n-\t\treturn -1;\n-\n-\tfor (i = 0; i < PCI_MAX_RESOURCE; i++) {\n-\t\tif (fgets(buf, sizeof(buf), fp) == NULL)\n-\t\t\tgoto error;\n-\t\tif (ccp_pci_parse_one_sysfs_resource(buf, sizeof(buf),\n-\t\t\t\t&phys_addr, &end_addr, &flags) < 0)\n-\t\t\tgoto error;\n-\n-\t\tif (flags & IORESOURCE_MEM) {\n-\t\t\tdev->mem_resource[i].phys_addr = phys_addr;\n-\t\t\tdev->mem_resource[i].len = end_addr - phys_addr + 1;\n-\t\t\t/* not mapped for now */\n-\t\t\tdev->mem_resource[i].addr = NULL;\n-\t\t}\n-\t}\n-\tfclose(fp);\n-\treturn 0;\n-\n-error:\n-\tfclose(fp);\n-\treturn -1;\n-}\n-\n-int\n-ccp_find_uio_devname(const char *dirname)\n-{\n-\n-\tDIR *dir;\n-\tstruct dirent *e;\n-\tchar dirname_uio[PATH_MAX];\n-\tunsigned int uio_num;\n-\tint ret = -1;\n-\n-\t/* depending on kernel version, uio can be located in uio/uioX\n-\t * or uio:uioX\n-\t */\n-\tsnprintf(dirname_uio, sizeof(dirname_uio), \"%s/uio\", dirname);\n-\tdir = opendir(dirname_uio);\n-\tif (dir == NULL) {\n-\t/* retry with the parent directory might be different kernel version*/\n-\t\tdir = opendir(dirname);\n-\t\tif (dir == NULL)\n-\t\t\treturn -1;\n-\t}\n-\n-\t/* take the first file starting with \"uio\" */\n-\twhile ((e = readdir(dir)) != NULL) {\n-\t\t/* format could be uio%d ...*/\n-\t\tint shortprefix_len = sizeof(\"uio\") - 1;\n-\t\t/* ... or uio:uio%d */\n-\t\tint longprefix_len = sizeof(\"uio:uio\") - 1;\n-\t\tchar *endptr;\n-\n-\t\tif (strncmp(e->d_name, \"uio\", 3) != 0)\n-\t\t\tcontinue;\n-\n-\t\t/* first try uio%d */\n-\t\terrno = 0;\n-\t\tuio_num = strtoull(e->d_name + shortprefix_len, &endptr, 10);\n-\t\tif (errno == 0 && endptr != (e->d_name + shortprefix_len)) {\n-\t\t\tret = uio_num;\n-\t\t\tbreak;\n-\t\t}\n-\n-\t\t/* then try uio:uio%d */\n-\t\terrno = 0;\n-\t\tuio_num = strtoull(e->d_name + longprefix_len, &endptr, 10);\n-\t\tif (errno == 0 && endptr != (e->d_name + longprefix_len)) {\n-\t\t\tret = uio_num;\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-\tclosedir(dir);\n-\treturn ret;\n-\n-\n-}\ndiff --git a/drivers/crypto/ccp/ccp_pci.h b/drivers/crypto/ccp/ccp_pci.h\ndeleted file mode 100644\nindex d9a8b9dcc6..0000000000\n--- a/drivers/crypto/ccp/ccp_pci.h\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-/*   SPDX-License-Identifier: BSD-3-Clause\n- *   Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved.\n- */\n-\n-#ifndef _CCP_PCI_H_\n-#define _CCP_PCI_H_\n-\n-#include <stdint.h>\n-\n-#include <bus_pci_driver.h>\n-\n-#define SYSFS_PCI_DEVICES \"/sys/bus/pci/devices\"\n-\n-int ccp_parse_pci_addr_format(const char *buf, int bufsize, uint16_t *domain,\n-\t\t\t      uint8_t *bus, uint8_t *devid, uint8_t *function);\n-\n-int ccp_pci_parse_sysfs_value(const char *filename, unsigned long *val);\n-\n-int ccp_pci_parse_sysfs_resource(const char *filename,\n-\t\t\t\t struct rte_pci_device *dev);\n-\n-int ccp_find_uio_devname(const char *dirname);\n-\n-#endif /* _CCP_PCI_H_ */\ndiff --git a/drivers/crypto/ccp/meson.build b/drivers/crypto/ccp/meson.build\nindex a4f3406009..a9abaa4da0 100644\n--- a/drivers/crypto/ccp/meson.build\n+++ b/drivers/crypto/ccp/meson.build\n@@ -18,7 +18,6 @@ sources = files(\n         'rte_ccp_pmd.c',\n         'ccp_crypto.c',\n         'ccp_dev.c',\n-        'ccp_pci.c',\n         'ccp_pmd_ops.c',\n )\n \ndiff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c\nindex 8b3a5a304b..ac05d63ade 100644\n--- a/drivers/crypto/ccp/rte_ccp_pmd.c\n+++ b/drivers/crypto/ccp/rte_ccp_pmd.c\n@@ -180,15 +180,9 @@ ccp_pmd_dequeue_burst(void *queue_pair, struct rte_crypto_op **ops,\n  * The set of PCI devices this driver supports\n  */\n static struct rte_pci_id ccp_pci_id[] = {\n-\t{\n-\t\tRTE_PCI_DEVICE(0x1022, 0x1456), /* AMD CCP-5a */\n-\t},\n-\t{\n-\t\tRTE_PCI_DEVICE(0x1022, 0x1468), /* AMD CCP-5b */\n-\t},\n-\t{\n-\t\tRTE_PCI_DEVICE(0x1022, 0x15df), /* AMD CCP RV */\n-\t},\n+\t{ RTE_PCI_DEVICE(AMD_PCI_VENDOR_ID, AMD_PCI_CCP_5A), },\n+\t{ RTE_PCI_DEVICE(AMD_PCI_VENDOR_ID, AMD_PCI_CCP_5B), },\n+\t{ RTE_PCI_DEVICE(AMD_PCI_VENDOR_ID, AMD_PCI_CCP_RV), },\n \t{.device_id = 0},\n };\n \n@@ -241,9 +235,7 @@ cryptodev_ccp_create(const char *name,\n \t\tgoto init_error;\n \t}\n \n-\tcryptodev_cnt = ccp_probe_devices(pci_dev, ccp_pci_id);\n-\n-\tif (cryptodev_cnt == 0) {\n+\tif (ccp_probe_device(pci_dev) != 0) {\n \t\tCCP_LOG_ERR(\"failed to detect CCP crypto device\");\n \t\tgoto init_error;\n \t}\n@@ -267,7 +259,7 @@ cryptodev_ccp_create(const char *name,\n \n \tinternals->max_nb_qpairs = init_params->def_p.max_nb_queue_pairs;\n \tinternals->auth_opt = init_params->auth_opt;\n-\tinternals->crypto_num_dev = cryptodev_cnt;\n+\tinternals->crypto_num_dev = 1;\n \n \trte_cryptodev_pmd_probing_finish(dev);\n \n",
    "prefixes": [
        "v2",
        "4/4"
    ]
}