get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 104937,
    "url": "http://patchwork.dpdk.org/api/patches/104937/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20211206121824.3493-10-nipun.gupta@nxp.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": "<20211206121824.3493-10-nipun.gupta@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211206121824.3493-10-nipun.gupta@nxp.com",
    "date": "2021-12-06T12:18:16",
    "name": "[09/17] bus/fslmc: add and scan dprc devices",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "bcd3b3a64105f3060ed55b1fec6a2d1464e218ab",
    "submitter": {
        "id": 471,
        "url": "http://patchwork.dpdk.org/api/people/471/?format=api",
        "name": "Nipun Gupta",
        "email": "nipun.gupta@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20211206121824.3493-10-nipun.gupta@nxp.com/mbox/",
    "series": [
        {
            "id": 20873,
            "url": "http://patchwork.dpdk.org/api/series/20873/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20873",
            "date": "2021-12-06T12:18:07",
            "name": "features and fixes on NXP eth devices",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/20873/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/104937/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/104937/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 00A84A034F;\n\tMon,  6 Dec 2021 13:19:27 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 790534274A;\n\tMon,  6 Dec 2021 13:18:40 +0100 (CET)",
            "from inva020.nxp.com (inva020.nxp.com [92.121.34.13])\n by mails.dpdk.org (Postfix) with ESMTP id 0659241186\n for <dev@dpdk.org>; Mon,  6 Dec 2021 13:18:31 +0100 (CET)",
            "from inva020.nxp.com (localhost [127.0.0.1])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id D64B01A12E9;\n Mon,  6 Dec 2021 13:18:30 +0100 (CET)",
            "from aprdc01srsp001v.ap-rdc01.nxp.com\n (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7E9ED1A036C;\n Mon,  6 Dec 2021 13:18:30 +0100 (CET)",
            "from lsv03274.swis.in-blr01.nxp.com (lsv03274.swis.in-blr01.nxp.com\n [92.120.147.114])\n by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id DC744183AD0B;\n Mon,  6 Dec 2021 20:18:29 +0800 (+08)"
        ],
        "From": "nipun.gupta@nxp.com",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com,\n Jun Yang <jun.yang@nxp.com>, Nipun Gupta <nipun.gupta@nxp.com>",
        "Subject": "[PATCH 09/17] bus/fslmc: add and scan dprc devices",
        "Date": "Mon,  6 Dec 2021 17:48:16 +0530",
        "Message-Id": "<20211206121824.3493-10-nipun.gupta@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20211206121824.3493-1-nipun.gupta@nxp.com>",
        "References": "<20211206121824.3493-1-nipun.gupta@nxp.com>",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "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": "From: Jun Yang <jun.yang@nxp.com>\n\nIn order to get connection endpoint of each objects,\nscan the dprc object.\n\nSigned-off-by: Jun Yang <jun.yang@nxp.com>\nSigned-off-by: Nipun Gupta <nipun.gupta@nxp.com>\n---\n drivers/bus/fslmc/fslmc_bus.c            |  15 ++-\n drivers/bus/fslmc/fslmc_vfio.c           |  18 +++-\n drivers/bus/fslmc/mc/dprc.c              | 129 +++++++++++++++++++++++\n drivers/bus/fslmc/mc/fsl_dprc.h          |  46 ++++++++\n drivers/bus/fslmc/mc/fsl_dprc_cmd.h      |  48 +++++++++\n drivers/bus/fslmc/meson.build            |   4 +-\n drivers/bus/fslmc/portal/dpaa2_hw_dprc.c | 100 ++++++++++++++++++\n drivers/bus/fslmc/portal/dpaa2_hw_pvt.h  |  12 +++\n drivers/bus/fslmc/rte_fslmc.h            |  10 +-\n 9 files changed, 374 insertions(+), 8 deletions(-)\n create mode 100644 drivers/bus/fslmc/mc/dprc.c\n create mode 100644 drivers/bus/fslmc/mc/fsl_dprc.h\n create mode 100644 drivers/bus/fslmc/mc/fsl_dprc_cmd.h\n create mode 100644 drivers/bus/fslmc/portal/dpaa2_hw_dprc.c",
    "diff": "diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c\nindex a0ef24cdc8..a3c0d838c4 100644\n--- a/drivers/bus/fslmc/fslmc_bus.c\n+++ b/drivers/bus/fslmc/fslmc_bus.c\n@@ -1,6 +1,6 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n  *\n- *   Copyright 2016,2018-2019 NXP\n+ *   Copyright 2016,2018-2021 NXP\n  *\n  */\n \n@@ -136,10 +136,6 @@ scan_one_fslmc_device(char *dev_name)\n \tif (!dev_name)\n \t\treturn ret;\n \n-\t/* Ignore the Container name itself */\n-\tif (!strncmp(\"dprc\", dev_name, 4))\n-\t\treturn 0;\n-\n \t/* Creating a temporary copy to perform cut-parse over string */\n \tdup_dev_name = strdup(dev_name);\n \tif (!dup_dev_name) {\n@@ -197,6 +193,8 @@ scan_one_fslmc_device(char *dev_name)\n \t\tdev->dev_type = DPAA2_MUX;\n \telse if (!strncmp(\"dprtc\", t_ptr, 5))\n \t\tdev->dev_type = DPAA2_DPRTC;\n+\telse if (!strncmp(\"dprc\", t_ptr, 4))\n+\t\tdev->dev_type = DPAA2_DPRC;\n \telse\n \t\tdev->dev_type = DPAA2_UNKNOWN;\n \n@@ -339,6 +337,13 @@ rte_fslmc_scan(void)\n \t\tgoto scan_fail;\n \t}\n \n+\t/* Scan the DPRC container object */\n+\tret = scan_one_fslmc_device(fslmc_container);\n+\tif (ret != 0) {\n+\t\t/* Error in parsing directory - exit gracefully */\n+\t\tgoto scan_fail_cleanup;\n+\t}\n+\n \twhile ((entry = readdir(dir)) != NULL) {\n \t\tif (entry->d_name[0] == '.' || entry->d_type != DT_DIR)\n \t\t\tcontinue;\ndiff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c\nindex b4704eeae4..1b89a56bbc 100644\n--- a/drivers/bus/fslmc/fslmc_vfio.c\n+++ b/drivers/bus/fslmc/fslmc_vfio.c\n@@ -1,7 +1,7 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n  *\n  *   Copyright (c) 2015-2016 Freescale Semiconductor, Inc. All rights reserved.\n- *   Copyright 2016-2019 NXP\n+ *   Copyright 2016-2021 NXP\n  *\n  */\n \n@@ -728,6 +728,7 @@ fslmc_process_iodevices(struct rte_dpaa2_device *dev)\n \tcase DPAA2_BPOOL:\n \tcase DPAA2_DPRTC:\n \tcase DPAA2_MUX:\n+\tcase DPAA2_DPRC:\n \t\tTAILQ_FOREACH(object, &dpaa2_obj_list, next) {\n \t\t\tif (dev->dev_type == object->dev_type)\n \t\t\t\tobject->create(dev_fd, &device_info,\n@@ -881,6 +882,21 @@ fslmc_vfio_process_group(void)\n \t\treturn -1;\n \t}\n \n+\t/* Search for DPRC device next as it updates endpoint of\n+\t * other devices.\n+\t */\n+\tcurrent_device = 0;\n+\tRTE_TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) {\n+\t\tif (dev->dev_type == DPAA2_DPRC) {\n+\t\t\tret = fslmc_process_iodevices(dev);\n+\t\t\tif (ret) {\n+\t\t\t\tDPAA2_BUS_ERR(\"Unable to process dprc\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tTAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next);\n+\t\t}\n+\t}\n+\n \tcurrent_device = 0;\n \tRTE_TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next,\n \t\tdev_temp) {\ndiff --git a/drivers/bus/fslmc/mc/dprc.c b/drivers/bus/fslmc/mc/dprc.c\nnew file mode 100644\nindex 0000000000..491081c7c8\n--- /dev/null\n+++ b/drivers/bus/fslmc/mc/dprc.c\n@@ -0,0 +1,129 @@\n+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)\n+ *\n+ * Copyright 2013-2016 Freescale Semiconductor Inc.\n+ * Copyright 2016-2021 NXP\n+ *\n+ */\n+#include <fsl_mc_sys.h>\n+#include <fsl_mc_cmd.h>\n+#include <fsl_dprc.h>\n+#include <fsl_dprc_cmd.h>\n+\n+/** @addtogroup dprc\n+ * @{\n+ */\n+\n+/**\n+ * dprc_open() - Open DPRC object for use\n+ * @mc_io:\t\tPointer to MC portal's I/O object\n+ * @cmd_flags:\t\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @container_id:\tContainer ID to open\n+ * @token:\t\tReturned token of DPRC object\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ *\n+ * @warning\tRequired before any operation on the object.\n+ */\n+int dprc_open(struct fsl_mc_io *mc_io,\n+\t      uint32_t cmd_flags,\n+\t      int container_id,\n+\t      uint16_t *token)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tstruct dprc_cmd_open *cmd_params;\n+\tint err;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPRC_CMDID_OPEN, cmd_flags,\n+\t\t\t\t\t  0);\n+\tcmd_params = (struct dprc_cmd_open *)cmd.params;\n+\tcmd_params->container_id = cpu_to_le32(container_id);\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\t*token = mc_cmd_hdr_read_token(&cmd);\n+\n+\treturn 0;\n+}\n+\n+/**\n+ * dprc_close() - Close the control session of the object\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPRC object\n+ *\n+ * After this function is called, no further operations are\n+ * allowed on the object without opening a new control session.\n+ *\n+ * Return:\t'0' on Success; Error code otherwise.\n+ */\n+int dprc_close(struct fsl_mc_io *mc_io,\n+\t       uint32_t cmd_flags,\n+\t       uint16_t token)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPRC_CMDID_CLOSE, cmd_flags,\n+\t\t\t\t\t  token);\n+\n+\t/* send command to mc*/\n+\treturn mc_send_command(mc_io, &cmd);\n+}\n+\n+/**\n+ * dprc_get_connection() - Get connected endpoint and link status if connection\n+ *\t\t\texists.\n+ * @mc_io:\tPointer to MC portal's I/O object\n+ * @cmd_flags:\tCommand flags; one or more of 'MC_CMD_FLAG_'\n+ * @token:\tToken of DPRC object\n+ * @endpoint1:\tEndpoint 1 configuration parameters\n+ * @endpoint2:\tReturned endpoint 2 configuration parameters\n+ * @state:\tReturned link state:\n+ *\t\t1 - link is up;\n+ *\t\t0 - link is down;\n+ *\t\t-1 - no connection (endpoint2 information is irrelevant)\n+ *\n+ * Return:     '0' on Success; -ENAVAIL if connection does not exist.\n+ */\n+int dprc_get_connection(struct fsl_mc_io *mc_io,\n+\t\t\tuint32_t cmd_flags,\n+\t\t\tuint16_t token,\n+\t\t\tconst struct dprc_endpoint *endpoint1,\n+\t\t\tstruct dprc_endpoint *endpoint2,\n+\t\t\tint *state)\n+{\n+\tstruct mc_command cmd = { 0 };\n+\tstruct dprc_cmd_get_connection *cmd_params;\n+\tstruct dprc_rsp_get_connection *rsp_params;\n+\tint err, i;\n+\n+\t/* prepare command */\n+\tcmd.header = mc_encode_cmd_header(DPRC_CMDID_GET_CONNECTION,\n+\t\t\t\t\t  cmd_flags,\n+\t\t\t\t\t  token);\n+\tcmd_params = (struct dprc_cmd_get_connection *)cmd.params;\n+\tcmd_params->ep1_id = cpu_to_le32(endpoint1->id);\n+\tcmd_params->ep1_interface_id = cpu_to_le16(endpoint1->if_id);\n+\tfor (i = 0; i < 16; i++)\n+\t\tcmd_params->ep1_type[i] = endpoint1->type[i];\n+\n+\t/* send command to mc*/\n+\terr = mc_send_command(mc_io, &cmd);\n+\tif (err)\n+\t\treturn err;\n+\n+\t/* retrieve response parameters */\n+\trsp_params = (struct dprc_rsp_get_connection *)cmd.params;\n+\tendpoint2->id = le32_to_cpu(rsp_params->ep2_id);\n+\tendpoint2->if_id = le16_to_cpu(rsp_params->ep2_interface_id);\n+\t*state = le32_to_cpu(rsp_params->state);\n+\tfor (i = 0; i < 16; i++)\n+\t\tendpoint2->type[i] = rsp_params->ep2_type[i];\n+\n+\treturn 0;\n+}\ndiff --git a/drivers/bus/fslmc/mc/fsl_dprc.h b/drivers/bus/fslmc/mc/fsl_dprc.h\nnew file mode 100644\nindex 0000000000..177210c2d4\n--- /dev/null\n+++ b/drivers/bus/fslmc/mc/fsl_dprc.h\n@@ -0,0 +1,46 @@\n+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)\n+ *\n+ * Copyright 2013-2016 Freescale Semiconductor Inc.\n+ * Copyright 2016-2021 NXP\n+ *\n+ */\n+#ifndef _FSL_DPRC_H\n+#define _FSL_DPRC_H\n+\n+/** @addtogroup dprc Data Path Resource Container API\n+ * Contains DPRC API for managing and querying DPAA resources\n+ * @{\n+ */\n+\n+struct fsl_mc_io;\n+\n+int dprc_open(struct fsl_mc_io *mc_io,\n+\t      uint32_t cmd_flags,\n+\t      int container_id,\n+\t      uint16_t *token);\n+\n+int dprc_close(struct fsl_mc_io *mc_io,\n+\t       uint32_t cmd_flags,\n+\t       uint16_t token);\n+\n+/**\n+ * struct dprc_endpoint - Endpoint description for link connect/disconnect\n+ *\t\t\toperations\n+ * @type:\tEndpoint object type: NULL terminated string\n+ * @id:\t\tEndpoint object ID\n+ * @if_id:\tInterface ID; should be set for endpoints with multiple\n+ *\t\tinterfaces (\"dpsw\", \"dpdmux\"); for others, always set to 0\n+ */\n+struct dprc_endpoint {\n+\tchar type[16];\n+\tint id;\n+\tuint16_t if_id;\n+};\n+\n+int dprc_get_connection(struct fsl_mc_io *mc_io,\n+\t\t\tuint32_t cmd_flags,\n+\t\t\tuint16_t token,\n+\t\t\tconst struct dprc_endpoint *endpoint1,\n+\t\t\tstruct dprc_endpoint *endpoint2,\n+\t\t\tint *state);\n+#endif /* _FSL_DPRC_H */\ndiff --git a/drivers/bus/fslmc/mc/fsl_dprc_cmd.h b/drivers/bus/fslmc/mc/fsl_dprc_cmd.h\nnew file mode 100644\nindex 0000000000..6efa5634d2\n--- /dev/null\n+++ b/drivers/bus/fslmc/mc/fsl_dprc_cmd.h\n@@ -0,0 +1,48 @@\n+/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)\n+ *\n+ * Copyright 2013-2016 Freescale Semiconductor Inc.\n+ * Copyright 2016-2021 NXP\n+ *\n+ */\n+\n+#ifndef _FSL_DPRC_CMD_H\n+#define _FSL_DPRC_CMD_H\n+\n+/* Minimal supported DPRC Version */\n+#define DPRC_VER_MAJOR\t\t\t6\n+#define DPRC_VER_MINOR\t\t\t6\n+\n+/* Command versioning */\n+#define DPRC_CMD_BASE_VERSION\t\t\t1\n+#define DPRC_CMD_ID_OFFSET\t\t\t4\n+\n+#define DPRC_CMD(id)\t((id << DPRC_CMD_ID_OFFSET) | DPRC_CMD_BASE_VERSION)\n+\n+/* Command IDs */\n+#define DPRC_CMDID_CLOSE                        DPRC_CMD(0x800)\n+#define DPRC_CMDID_OPEN                         DPRC_CMD(0x805)\n+#define DPRC_CMDID_GET_CONNECTION               DPRC_CMD(0x16C)\n+\n+#pragma pack(push, 1)\n+struct dprc_cmd_open {\n+\tuint32_t container_id;\n+};\n+\n+struct dprc_cmd_get_connection {\n+\tuint32_t ep1_id;\n+\tuint16_t ep1_interface_id;\n+\tuint16_t pad;\n+\n+\tuint8_t ep1_type[16];\n+};\n+\n+struct dprc_rsp_get_connection {\n+\tuint64_t pad[3];\n+\tuint32_t ep2_id;\n+\tuint16_t ep2_interface_id;\n+\tuint16_t pad1;\n+\tuint8_t ep2_type[16];\n+\tuint32_t state;\n+};\n+#pragma pack(pop)\n+#endif /* _FSL_DPRC_CMD_H */\ndiff --git a/drivers/bus/fslmc/meson.build b/drivers/bus/fslmc/meson.build\nindex 54be76f516..162ca286fe 100644\n--- a/drivers/bus/fslmc/meson.build\n+++ b/drivers/bus/fslmc/meson.build\n@@ -1,5 +1,5 @@\n # SPDX-License-Identifier: BSD-3-Clause\n-# Copyright 2018 NXP\n+# Copyright 2018,2021 NXP\n \n if not is_linux\n     build = false\n@@ -16,10 +16,12 @@ sources = files(\n         'mc/dpdmai.c',\n         'mc/dpio.c',\n         'mc/dpmng.c',\n+        'mc/dprc.c',\n         'mc/mc_sys.c',\n         'portal/dpaa2_hw_dpbp.c',\n         'portal/dpaa2_hw_dpci.c',\n         'portal/dpaa2_hw_dpio.c',\n+        'portal/dpaa2_hw_dprc.c',\n         'qbman/qbman_portal.c',\n         'qbman/qbman_debug.c',\n )\ndiff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c b/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c\nnew file mode 100644\nindex 0000000000..ca1d0304d5\n--- /dev/null\n+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c\n@@ -0,0 +1,100 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ *\n+ *   Copyright 2021 NXP\n+ *\n+ */\n+\n+#include <unistd.h>\n+#include <stdio.h>\n+#include <sys/types.h>\n+#include <errno.h>\n+\n+#include <rte_malloc.h>\n+#include <rte_dev.h>\n+\n+#include <fslmc_logs.h>\n+#include <rte_fslmc.h>\n+#include <mc/fsl_dprc.h>\n+#include \"portal/dpaa2_hw_pvt.h\"\n+\n+TAILQ_HEAD(dprc_dev_list, dpaa2_dprc_dev);\n+static struct dprc_dev_list dprc_dev_list\n+\t= TAILQ_HEAD_INITIALIZER(dprc_dev_list); /*!< DPRC device list */\n+\n+static int\n+rte_dpaa2_create_dprc_device(int vdev_fd __rte_unused,\n+\t\t\t     struct vfio_device_info *obj_info __rte_unused,\n+\t\t\t     int dprc_id)\n+{\n+\tstruct dpaa2_dprc_dev *dprc_node;\n+\tstruct dprc_endpoint endpoint1, endpoint2;\n+\tstruct rte_dpaa2_device *dev, *dev_tmp;\n+\tint ret;\n+\n+\t/* Allocate DPAA2 dprc handle */\n+\tdprc_node = rte_malloc(NULL, sizeof(struct dpaa2_dprc_dev), 0);\n+\tif (!dprc_node) {\n+\t\tDPAA2_BUS_ERR(\"Memory allocation failed for DPRC Device\");\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\t/* Open the dprc object */\n+\tdprc_node->dprc.regs = dpaa2_get_mcp_ptr(MC_PORTAL_INDEX);\n+\tdprc_node->dprc_id = dprc_id;\n+\tret = dprc_open(&dprc_node->dprc,\n+\t\t\tCMD_PRI_LOW, dprc_id, &dprc_node->token);\n+\tif (ret) {\n+\t\tDPAA2_BUS_ERR(\"Resource alloc failure with err code: %d\", ret);\n+\t\trte_free(dprc_node);\n+\t\treturn ret;\n+\t}\n+\n+\tRTE_TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_tmp) {\n+\t\tif (dev->dev_type == DPAA2_ETH) {\n+\t\t\tint link_state;\n+\n+\t\t\tmemset(&endpoint1, 0, sizeof(struct dprc_endpoint));\n+\t\t\tmemset(&endpoint2, 0, sizeof(struct dprc_endpoint));\n+\t\t\tstrcpy(endpoint1.type, \"dpni\");\n+\t\t\tendpoint1.id = dev->object_id;\n+\t\t\tret = dprc_get_connection(&dprc_node->dprc,\n+\t\t\t\t\t\tCMD_PRI_LOW,\n+\t\t\t\t\t\tdprc_node->token,\n+\t\t\t\t\t\t&endpoint1, &endpoint2,\n+\t\t\t\t\t\t&link_state);\n+\t\t\tif (ret) {\n+\t\t\t\tDPAA2_BUS_ERR(\"dpni.%d connection failed!\",\n+\t\t\t\t\tdev->object_id);\n+\t\t\t\tdprc_close(&dprc_node->dprc, CMD_PRI_LOW,\n+\t\t\t\t\t   dprc_node->token);\n+\t\t\t\trte_free(dprc_node);\n+\t\t\t\treturn ret;\n+\t\t\t}\n+\n+\t\t\tif (!strcmp(endpoint2.type, \"dpmac\"))\n+\t\t\t\tdev->ep_dev_type = DPAA2_MAC;\n+\t\t\telse if (!strcmp(endpoint2.type, \"dpni\"))\n+\t\t\t\tdev->ep_dev_type = DPAA2_ETH;\n+\t\t\telse if (!strcmp(endpoint2.type, \"dpdmux\"))\n+\t\t\t\tdev->ep_dev_type = DPAA2_MUX;\n+\t\t\telse\n+\t\t\t\tdev->ep_dev_type = DPAA2_UNKNOWN;\n+\n+\t\t\tdev->ep_object_id = endpoint2.id;\n+\t\t} else {\n+\t\t\tdev->ep_dev_type = DPAA2_UNKNOWN;\n+\t\t}\n+\t\tsprintf(dev->ep_name, \"%s.%d\", endpoint2.type, endpoint2.id);\n+\t}\n+\n+\tTAILQ_INSERT_TAIL(&dprc_dev_list, dprc_node, next);\n+\n+\treturn 0;\n+}\n+\n+static struct rte_dpaa2_object rte_dpaa2_dprc_obj = {\n+\t.dev_type = DPAA2_DPRC,\n+\t.create = rte_dpaa2_create_dprc_device,\n+};\n+\n+RTE_PMD_REGISTER_DPAA2_OBJECT(dprc, rte_dpaa2_dprc_obj);\ndiff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h\nindex b1bba1ac36..8cb4d404aa 100644\n--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h\n+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h\n@@ -187,6 +187,18 @@ struct swp_active_dqs {\n \n extern struct swp_active_dqs rte_global_active_dqs_list[NUM_MAX_SWP];\n \n+/**\n+ * A structure describing a DPAA2 container.\n+ */\n+struct dpaa2_dprc_dev {\n+\tTAILQ_ENTRY(dpaa2_dprc_dev) next;\n+\t\t/**< Pointer to Next device instance */\n+\tconst char *name;\n+\tstruct fsl_mc_io dprc;  /** handle to DPRC portal object */\n+\tuint16_t token;\n+\tuint32_t dprc_id; /*HW ID for DPRC object */\n+};\n+\n struct dpaa2_dpci_dev {\n \tTAILQ_ENTRY(dpaa2_dpci_dev) next;\n \t\t/**< Pointer to Next device instance */\ndiff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h\nindex 729f360646..12b586b13b 100644\n--- a/drivers/bus/fslmc/rte_fslmc.h\n+++ b/drivers/bus/fslmc/rte_fslmc.h\n@@ -1,6 +1,6 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n  *\n- *   Copyright 2016,2019 NXP\n+ *   Copyright 2016,2021 NXP\n  *\n  */\n \n@@ -37,6 +37,9 @@ extern \"C\" {\n \n #include <fslmc_vfio.h>\n \n+#include \"portal/dpaa2_hw_pvt.h\"\n+#include \"portal/dpaa2_hw_dpio.h\"\n+\n #define FSLMC_OBJECT_MAX_LEN 32   /**< Length of each device on bus */\n \n #define DPAA2_INVALID_MBUF_SEQN        0\n@@ -88,6 +91,8 @@ enum rte_dpaa2_dev_type {\n \tDPAA2_QDMA,     /**< DPDMAI type device */\n \tDPAA2_MUX,\t/**< DPDMUX type device */\n \tDPAA2_DPRTC,\t/**< DPRTC type device */\n+\tDPAA2_DPRC,\t/**< DPRC type device */\n+\tDPAA2_MAC,\t/**< DPMAC type device */\n \t/* Unknown device placeholder */\n \tDPAA2_UNKNOWN,\n \tDPAA2_DEVTYPE_MAX,\n@@ -122,6 +127,9 @@ struct rte_dpaa2_device {\n \t};\n \tenum rte_dpaa2_dev_type dev_type;   /**< Device Type */\n \tuint16_t object_id;                 /**< DPAA2 Object ID */\n+\tenum rte_dpaa2_dev_type ep_dev_type;   /**< Endpoint Device Type */\n+\tuint16_t ep_object_id;                 /**< Endpoint DPAA2 Object ID */\n+\tchar ep_name[RTE_DEV_NAME_MAX_LEN];\n \tstruct rte_intr_handle *intr_handle; /**< Interrupt handle */\n \tstruct rte_dpaa2_driver *driver;    /**< Associated driver */\n \tchar name[FSLMC_OBJECT_MAX_LEN];    /**< DPAA2 Object name*/\n",
    "prefixes": [
        "09/17"
    ]
}