Show a patch.

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

{
    "id": 73393,
    "url": "https://patches.dpdk.org/api/patches/73393/",
    "web_url": "https://patches.dpdk.org/patch/73393/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200707092244.12791-14-hemant.agrawal@nxp.com>",
    "date": "2020-07-07T09:22:28",
    "name": "[v2,13/29] bus/dpaa: enable link state interrupt",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "018e50ef336b4aba0df8d5adfbbeb17c20865804",
    "submitter": {
        "id": 477,
        "url": "https://patches.dpdk.org/api/people/477/",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "https://patches.dpdk.org/patch/73393/mbox/",
    "series": [
        {
            "id": 10842,
            "url": "https://patches.dpdk.org/api/series/10842/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10842",
            "date": "2020-07-07T09:22:15",
            "name": "NXP DPAAx enhancements",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/10842/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73393/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/73393/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Message-Id": "<20200707092244.12791-14-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com,\n\tRohit Raj <rohit.raj@nxp.com>",
        "X-BeenThere": "dev@dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id DE50CA00BE;\n\tTue,  7 Jul 2020 11:29:28 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4FE611DD88;\n\tTue,  7 Jul 2020 11:27:20 +0200 (CEST)",
            "from inva020.nxp.com (inva020.nxp.com [92.121.34.13])\n by dpdk.org (Postfix) with ESMTP id 09A391DCF8\n for <dev@dpdk.org>; Tue,  7 Jul 2020 11:27:07 +0200 (CEST)",
            "from inva020.nxp.com (localhost [127.0.0.1])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E20171A0A54;\n Tue,  7 Jul 2020 11:27:06 +0200 (CEST)",
            "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n [165.114.16.14])\n by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 05C1C1A0A4E;\n Tue,  7 Jul 2020 11:27:05 +0200 (CEST)",
            "from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net\n [10.232.133.63])\n by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id BD486402C8;\n Tue,  7 Jul 2020 17:27:02 +0800 (SGT)"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 13/29] bus/dpaa: enable link state interrupt",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "In-Reply-To": "<20200707092244.12791-1-hemant.agrawal@nxp.com>",
        "Precedence": "list",
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "References": "<20200527132326.1382-1-hemant.agrawal@nxp.com>\n <20200707092244.12791-1-hemant.agrawal@nxp.com>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Errors-To": "dev-bounces@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Date": "Tue,  7 Jul 2020 14:52:28 +0530",
        "X-Mailman-Version": "2.1.15",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>"
    },
    "content": "From: Rohit Raj <rohit.raj@nxp.com>\n\nEnable/disable link state interrupt and get link state api is\ndefined using IOCTL calls from kernel driver\n\nSigned-off-by: Rohit Raj <rohit.raj@nxp.com>\n---\n doc/guides/nics/features/dpaa.ini         |  1 +\n doc/guides/rel_notes/release_20_08.rst    |  1 +\n drivers/bus/dpaa/base/fman/fman.c         |  4 +-\n drivers/bus/dpaa/base/qbman/process.c     | 72 ++++++++++++++++-\n drivers/bus/dpaa/dpaa_bus.c               | 28 ++++++-\n drivers/bus/dpaa/include/fman.h           |  2 +\n drivers/bus/dpaa/include/process.h        | 20 +++++\n drivers/bus/dpaa/rte_bus_dpaa_version.map |  3 +\n drivers/bus/dpaa/rte_dpaa_bus.h           |  6 +-\n drivers/common/dpaax/compat.h             |  5 +-\n drivers/net/dpaa/dpaa_ethdev.c            | 97 ++++++++++++++++++++++-\n 11 files changed, 233 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/features/dpaa.ini b/doc/guides/nics/features/dpaa.ini\nindex b00f46a97..816a6e08e 100644\n--- a/doc/guides/nics/features/dpaa.ini\n+++ b/doc/guides/nics/features/dpaa.ini\n@@ -6,6 +6,7 @@\n [Features]\n Speed capabilities   = Y\n Link status          = Y\n+Link status event    = Y\n Jumbo frame          = Y\n MTU update           = Y\n Scattered Rx         = Y\ndiff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst\nindex b1e039d03..e5bc5cfd8 100644\n--- a/doc/guides/rel_notes/release_20_08.rst\n+++ b/doc/guides/rel_notes/release_20_08.rst\n@@ -123,6 +123,7 @@ New Features\n \n   Updated the NXP dpaa ethdev  with new features and improvements, including:\n \n+  * Added support for link status and interrupt\n   * Added support to use datapath APIs from non-EAL pthread\n \n * **Updated NXP dpaa2 ethdev PMD.**\ndiff --git a/drivers/bus/dpaa/base/fman/fman.c b/drivers/bus/dpaa/base/fman/fman.c\nindex ae26041ca..33be9e5d7 100644\n--- a/drivers/bus/dpaa/base/fman/fman.c\n+++ b/drivers/bus/dpaa/base/fman/fman.c\n@@ -1,7 +1,7 @@\n /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)\n  *\n  * Copyright 2010-2016 Freescale Semiconductor Inc.\n- * Copyright 2017-2019 NXP\n+ * Copyright 2017-2020 NXP\n  *\n  */\n \n@@ -185,6 +185,8 @@ fman_if_init(const struct device_node *dpa_node)\n \t}\n \tmemset(__if, 0, sizeof(*__if));\n \tINIT_LIST_HEAD(&__if->__if.bpool_list);\n+\tstrlcpy(__if->node_name, dpa_node->name, IF_NAME_MAX_LEN - 1);\n+\t__if->node_name[IF_NAME_MAX_LEN - 1] = '\\0';\n \tstrlcpy(__if->node_path, dpa_node->full_name, PATH_MAX - 1);\n \t__if->node_path[PATH_MAX - 1] = '\\0';\n \ndiff --git a/drivers/bus/dpaa/base/qbman/process.c b/drivers/bus/dpaa/base/qbman/process.c\nindex 2c23c98df..68b7af243 100644\n--- a/drivers/bus/dpaa/base/qbman/process.c\n+++ b/drivers/bus/dpaa/base/qbman/process.c\n@@ -1,7 +1,7 @@\n /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)\n  *\n  * Copyright 2011-2016 Freescale Semiconductor Inc.\n- * Copyright 2017 NXP\n+ * Copyright 2017,2020 NXP\n  *\n  */\n #include <assert.h>\n@@ -296,3 +296,73 @@ int bman_free_raw_portal(struct dpaa_raw_portal *portal)\n \n \treturn process_portal_free(&input);\n }\n+\n+#define DPAA_IOCTL_ENABLE_LINK_STATUS_INTERRUPT \\\n+\t_IOW(DPAA_IOCTL_MAGIC, 0x0E, struct usdpaa_ioctl_link_status)\n+\n+#define DPAA_IOCTL_DISABLE_LINK_STATUS_INTERRUPT \\\n+\t_IOW(DPAA_IOCTL_MAGIC, 0x0F, char*)\n+\n+int dpaa_intr_enable(char *if_name, int efd)\n+{\n+\tstruct usdpaa_ioctl_link_status args;\n+\n+\tint ret = check_fd();\n+\n+\tif (ret)\n+\t\treturn ret;\n+\n+\targs.efd = (uint32_t)efd;\n+\tstrcpy(args.if_name, if_name);\n+\n+\tret = ioctl(fd, DPAA_IOCTL_ENABLE_LINK_STATUS_INTERRUPT, &args);\n+\tif (ret)\n+\t\treturn errno;\n+\n+\treturn 0;\n+}\n+\n+int dpaa_intr_disable(char *if_name)\n+{\n+\tint ret = check_fd();\n+\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tret = ioctl(fd, DPAA_IOCTL_DISABLE_LINK_STATUS_INTERRUPT, &if_name);\n+\tif (ret) {\n+\t\tif (errno == EINVAL)\n+\t\t\tprintf(\"Failed to disable interrupt: Not Supported\\n\");\n+\t\telse\n+\t\t\tprintf(\"Failed to disable interrupt\\n\");\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+#define DPAA_IOCTL_GET_LINK_STATUS \\\n+\t_IOWR(DPAA_IOCTL_MAGIC, 0x10, struct usdpaa_ioctl_link_status_args)\n+\n+int dpaa_get_link_status(char *if_name)\n+{\n+\tint ret = check_fd();\n+\tstruct usdpaa_ioctl_link_status_args args;\n+\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tstrcpy(args.if_name, if_name);\n+\targs.link_status = 0;\n+\n+\tret = ioctl(fd, DPAA_IOCTL_GET_LINK_STATUS, &args);\n+\tif (ret) {\n+\t\tif (errno == EINVAL)\n+\t\t\tprintf(\"Failed to get link status: Not Supported\\n\");\n+\t\telse\n+\t\t\tprintf(\"Failed to get link status\\n\");\n+\t\treturn ret;\n+\t}\n+\n+\treturn args.link_status;\n+}\ndiff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c\nindex aa906c34e..32e872da5 100644\n--- a/drivers/bus/dpaa/dpaa_bus.c\n+++ b/drivers/bus/dpaa/dpaa_bus.c\n@@ -1,6 +1,6 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n  *\n- *   Copyright 2017-2019 NXP\n+ *   Copyright 2017-2020 NXP\n  *\n  */\n /* System headers */\n@@ -13,6 +13,7 @@\n #include <pthread.h>\n #include <sys/types.h>\n #include <sys/syscall.h>\n+#include <sys/eventfd.h>\n \n #include <rte_byteorder.h>\n #include <rte_common.h>\n@@ -542,6 +543,23 @@ rte_dpaa_bus_dev_build(void)\n \treturn 0;\n }\n \n+static int rte_dpaa_setup_intr(struct rte_intr_handle *intr_handle)\n+{\n+\tint fd;\n+\n+\tfd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);\n+\tif (fd < 0) {\n+\t\tDPAA_BUS_ERR(\"Cannot set up eventfd, error %i (%s)\",\n+\t\t\t     errno, strerror(errno));\n+\t\treturn errno;\n+\t}\n+\n+\tintr_handle->fd = fd;\n+\tintr_handle->type = RTE_INTR_HANDLE_EXT;\n+\n+\treturn 0;\n+}\n+\n static int\n rte_dpaa_bus_probe(void)\n {\n@@ -589,6 +607,14 @@ rte_dpaa_bus_probe(void)\n \t\tfclose(svr_file);\n \t}\n \n+\tTAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) {\n+\t\tif (dev->device_type == FSL_DPAA_ETH) {\n+\t\t\tret = rte_dpaa_setup_intr(&dev->intr_handle);\n+\t\t\tif (ret)\n+\t\t\t\tDPAA_BUS_ERR(\"Error setting up interrupt.\\n\");\n+\t\t}\n+\t}\n+\n \t/* And initialize the PA->VA translation table */\n \tdpaax_iova_table_populate();\n \ndiff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h\nindex b6293b61c..7a0a7d405 100644\n--- a/drivers/bus/dpaa/include/fman.h\n+++ b/drivers/bus/dpaa/include/fman.h\n@@ -2,6 +2,7 @@\n  *\n  * Copyright 2010-2012 Freescale Semiconductor, Inc.\n  * All rights reserved.\n+ * Copyright 2019-2020 NXP\n  *\n  */\n \n@@ -361,6 +362,7 @@ struct fman_if_ic_params {\n  */\n struct __fman_if {\n \tstruct fman_if __if;\n+\tchar node_name[IF_NAME_MAX_LEN];\n \tchar node_path[PATH_MAX];\n \tuint64_t regs_size;\n \tvoid *ccsr_map;\ndiff --git a/drivers/bus/dpaa/include/process.h b/drivers/bus/dpaa/include/process.h\nindex d9ec94ee2..7305762c2 100644\n--- a/drivers/bus/dpaa/include/process.h\n+++ b/drivers/bus/dpaa/include/process.h\n@@ -2,6 +2,7 @@\n  *\n  * Copyright 2010-2011 Freescale Semiconductor, Inc.\n  * All rights reserved.\n+ * Copyright 2020 NXP\n  *\n  */\n \n@@ -74,4 +75,23 @@ struct dpaa_ioctl_irq_map {\n int process_portal_irq_map(int fd,  struct dpaa_ioctl_irq_map *irq);\n int process_portal_irq_unmap(int fd);\n \n+struct usdpaa_ioctl_link_status {\n+\tchar            if_name[IF_NAME_MAX_LEN];\n+\tuint32_t        efd;\n+};\n+\n+__rte_internal\n+int dpaa_intr_enable(char *if_name, int efd);\n+\n+__rte_internal\n+int dpaa_intr_disable(char *if_name);\n+\n+struct usdpaa_ioctl_link_status_args {\n+\t/* network device node name */\n+\tchar    if_name[IF_NAME_MAX_LEN];\n+\tint     link_status;\n+};\n+__rte_internal\n+int dpaa_get_link_status(char *if_name);\n+\n #endif\t/*  __PROCESS_H */\ndiff --git a/drivers/bus/dpaa/rte_bus_dpaa_version.map b/drivers/bus/dpaa/rte_bus_dpaa_version.map\nindex 2defa7992..96662d7be 100644\n--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map\n+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map\n@@ -15,6 +15,9 @@ INTERNAL {\n \tdpaa_get_eth_port_cfg;\n \tdpaa_get_qm_channel_caam;\n \tdpaa_get_qm_channel_pool;\n+\tdpaa_get_link_status;\n+\tdpaa_intr_disable;\n+\tdpaa_intr_enable;\n \tdpaa_svr_family;\n \tfman_dealloc_bufs_mask_hi;\n \tfman_dealloc_bufs_mask_lo;\ndiff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h\nindex 25aff2d30..fdaa63a09 100644\n--- a/drivers/bus/dpaa/rte_dpaa_bus.h\n+++ b/drivers/bus/dpaa/rte_dpaa_bus.h\n@@ -1,6 +1,6 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n  *\n- *   Copyright 2017-2019 NXP\n+ *   Copyright 2017-2020 NXP\n  *\n  */\n #ifndef __RTE_DPAA_BUS_H__\n@@ -30,6 +30,9 @@\n #define SVR_LS1046A_FAMILY\t0x87070000\n #define SVR_MASK\t\t0xffff0000\n \n+/** Device driver supports link state interrupt */\n+#define RTE_DPAA_DRV_INTR_LSC  0x0008\n+\n #define RTE_DEV_TO_DPAA_CONST(ptr) \\\n \tcontainer_of(ptr, const struct rte_dpaa_device, device)\n \n@@ -86,6 +89,7 @@ struct rte_dpaa_driver {\n \tenum rte_dpaa_type drv_type;\n \trte_dpaa_probe_t probe;\n \trte_dpaa_remove_t remove;\n+\tuint32_t drv_flags;                 /**< Flags for controlling device.*/\n };\n \n /* Create storage for dqrr entries per lcore */\ndiff --git a/drivers/common/dpaax/compat.h b/drivers/common/dpaax/compat.h\nindex 90db68ce7..6793cb256 100644\n--- a/drivers/common/dpaax/compat.h\n+++ b/drivers/common/dpaax/compat.h\n@@ -2,7 +2,7 @@\n  *\n  * Copyright 2011 Freescale Semiconductor, Inc.\n  * All rights reserved.\n- * Copyright 2019 NXP\n+ * Copyright 2019-2020 NXP\n  *\n  */\n \n@@ -390,4 +390,7 @@ static inline unsigned long get_zeroed_page(gfp_t __foo __rte_unused)\n #define atomic_dec_return(v)    rte_atomic32_sub_return(v, 1)\n #define atomic_sub_and_test(i, v) (rte_atomic32_sub_return(v, i) == 0)\n \n+/* Interface name len*/\n+#define IF_NAME_MAX_LEN 16\n+\n #endif /* __COMPAT_H */\ndiff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c\nindex c9f828a7c..3f805b2b0 100644\n--- a/drivers/net/dpaa/dpaa_ethdev.c\n+++ b/drivers/net/dpaa/dpaa_ethdev.c\n@@ -45,6 +45,7 @@\n #include <fsl_qman.h>\n #include <fsl_bman.h>\n #include <fsl_fman.h>\n+#include <process.h>\n \n /* Supported Rx offloads */\n static uint64_t dev_rx_offloads_sup =\n@@ -131,6 +132,11 @@ static struct rte_dpaa_driver rte_dpaa_pmd;\n static int\n dpaa_eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info);\n \n+static int dpaa_eth_link_update(struct rte_eth_dev *dev,\n+\t\t\t\tint wait_to_complete __rte_unused);\n+\n+static void dpaa_interrupt_handler(void *param);\n+\n static inline void\n dpaa_poll_queue_default_config(struct qm_mcc_initfq *opts)\n {\n@@ -195,9 +201,19 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)\n \tstruct rte_eth_conf *eth_conf = &dev->data->dev_conf;\n \tuint64_t rx_offloads = eth_conf->rxmode.offloads;\n \tuint64_t tx_offloads = eth_conf->txmode.offloads;\n+\tstruct rte_device *rdev = dev->device;\n+\tstruct rte_dpaa_device *dpaa_dev;\n+\tstruct fman_if *fif = dev->process_private;\n+\tstruct __fman_if *__fif;\n+\tstruct rte_intr_handle *intr_handle;\n+\tint ret;\n \n \tPMD_INIT_FUNC_TRACE();\n \n+\tdpaa_dev = container_of(rdev, struct rte_dpaa_device, device);\n+\tintr_handle = &dpaa_dev->intr_handle;\n+\t__fif = container_of(fif, struct __fman_if, __if);\n+\n \t/* Rx offloads which are enabled by default */\n \tif (dev_rx_offloads_nodis & ~rx_offloads) {\n \t\tDPAA_PMD_INFO(\n@@ -241,6 +257,28 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)\n \t\tdev->data->scattered_rx = 1;\n \t}\n \n+\t/* if the interrupts were configured on this devices*/\n+\tif (intr_handle && intr_handle->fd) {\n+\t\tif (dev->data->dev_conf.intr_conf.lsc != 0)\n+\t\t\trte_intr_callback_register(intr_handle,\n+\t\t\t\t\t   dpaa_interrupt_handler,\n+\t\t\t\t\t   (void *)dev);\n+\n+\t\tret = dpaa_intr_enable(__fif->node_name, intr_handle->fd);\n+\t\tif (ret) {\n+\t\t\tif (dev->data->dev_conf.intr_conf.lsc != 0) {\n+\t\t\t\trte_intr_callback_unregister(intr_handle,\n+\t\t\t\t\tdpaa_interrupt_handler,\n+\t\t\t\t\t(void *)dev);\n+\t\t\t\tif (ret == EINVAL)\n+\t\t\t\t\tprintf(\"Failed to enable interrupt: Not Supported\\n\");\n+\t\t\t\telse\n+\t\t\t\t\tprintf(\"Failed to enable interrupt\\n\");\n+\t\t\t}\n+\t\t\tdev->data->dev_conf.intr_conf.lsc = 0;\n+\t\t\tdev->data->dev_flags &= ~RTE_ETH_DEV_INTR_LSC;\n+\t\t}\n+\t}\n \treturn 0;\n }\n \n@@ -269,6 +307,25 @@ dpaa_supported_ptypes_get(struct rte_eth_dev *dev)\n \treturn NULL;\n }\n \n+static void dpaa_interrupt_handler(void *param)\n+{\n+\tstruct rte_eth_dev *dev = param;\n+\tstruct rte_device *rdev = dev->device;\n+\tstruct rte_dpaa_device *dpaa_dev;\n+\tstruct rte_intr_handle *intr_handle;\n+\tuint64_t buf;\n+\tint bytes_read;\n+\n+\tdpaa_dev = container_of(rdev, struct rte_dpaa_device, device);\n+\tintr_handle = &dpaa_dev->intr_handle;\n+\n+\tbytes_read = read(intr_handle->fd, &buf, sizeof(uint64_t));\n+\tif (bytes_read < 0)\n+\t\tDPAA_PMD_ERR(\"Error reading eventfd\\n\");\n+\tdpaa_eth_link_update(dev, 0);\n+\t_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);\n+}\n+\n static int dpaa_eth_dev_start(struct rte_eth_dev *dev)\n {\n \tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n@@ -298,9 +355,27 @@ static void dpaa_eth_dev_stop(struct rte_eth_dev *dev)\n \n static void dpaa_eth_dev_close(struct rte_eth_dev *dev)\n {\n+\tstruct fman_if *fif = dev->process_private;\n+\tstruct __fman_if *__fif;\n+\tstruct rte_device *rdev = dev->device;\n+\tstruct rte_dpaa_device *dpaa_dev;\n+\tstruct rte_intr_handle *intr_handle;\n+\n \tPMD_INIT_FUNC_TRACE();\n \n+\tdpaa_dev = container_of(rdev, struct rte_dpaa_device, device);\n+\tintr_handle = &dpaa_dev->intr_handle;\n+\t__fif = container_of(fif, struct __fman_if, __if);\n+\n \tdpaa_eth_dev_stop(dev);\n+\n+\tif (intr_handle && intr_handle->fd &&\n+\t    dev->data->dev_conf.intr_conf.lsc != 0) {\n+\t\tdpaa_intr_disable(__fif->node_name);\n+\t\trte_intr_callback_unregister(intr_handle,\n+\t\t\t\t\t     dpaa_interrupt_handler,\n+\t\t\t\t\t     (void *)dev);\n+\t}\n }\n \n static int\n@@ -388,6 +463,8 @@ static int dpaa_eth_link_update(struct rte_eth_dev *dev,\n \tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n \tstruct rte_eth_link *link = &dev->data->dev_link;\n \tstruct fman_if *fif = dev->process_private;\n+\tstruct __fman_if *__fif = container_of(fif, struct __fman_if, __if);\n+\tint ret;\n \n \tPMD_INIT_FUNC_TRACE();\n \n@@ -401,9 +478,23 @@ static int dpaa_eth_link_update(struct rte_eth_dev *dev,\n \t\tDPAA_PMD_ERR(\"invalid link_speed: %s, %d\",\n \t\t\t     dpaa_intf->name, fif->mac_type);\n \n-\tlink->link_status = dpaa_intf->valid;\n+\tret = dpaa_get_link_status(__fif->node_name);\n+\tif (ret < 0) {\n+\t\tif (ret == -EINVAL) {\n+\t\t\tDPAA_PMD_DEBUG(\"Using default link status-No Support\");\n+\t\t\tret = 1;\n+\t\t} else {\n+\t\t\tDPAA_PMD_ERR(\"rte_dpaa_get_link_status %d\", ret);\n+\t\t\treturn ret;\n+\t\t}\n+\t}\n+\n+\tlink->link_status = ret;\n \tlink->link_duplex = ETH_LINK_FULL_DUPLEX;\n \tlink->link_autoneg = ETH_LINK_AUTONEG;\n+\n+\tDPAA_PMD_INFO(\"Port %d Link is %s\\n\", dev->data->port_id,\n+\t\t      link->link_status ? \"Up\" : \"Down\");\n \treturn 0;\n }\n \n@@ -1734,6 +1825,9 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,\n \n \tqman_ern_register_cb(dpaa_free_mbuf);\n \n+\tif (dpaa_drv->drv_flags & RTE_DPAA_DRV_INTR_LSC)\n+\t\teth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;\n+\n \t/* Invoke PMD device initialization function */\n \tdiag = dpaa_dev_init(eth_dev);\n \tif (diag == 0) {\n@@ -1761,6 +1855,7 @@ rte_dpaa_remove(struct rte_dpaa_device *dpaa_dev)\n }\n \n static struct rte_dpaa_driver rte_dpaa_pmd = {\n+\t.drv_flags = RTE_DPAA_DRV_INTR_LSC,\n \t.drv_type = FSL_DPAA_ETH,\n \t.probe = rte_dpaa_probe,\n \t.remove = rte_dpaa_remove,\n",
    "prefixes": [
        "v2",
        "13/29"
    ]
}