Show a patch.

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

{
    "id": 73394,
    "url": "https://patches.dpdk.org/api/patches/73394/",
    "web_url": "https://patches.dpdk.org/patch/73394/",
    "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-15-hemant.agrawal@nxp.com>",
    "date": "2020-07-07T09:22:29",
    "name": "[v2,14/29] bus/dpaa: enable set link status",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "d282d1488b36ea496fd8ab72ca3bdea4048624ad",
    "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/73394/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/73394/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/73394/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Message-Id": "<20200707092244.12791-15-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 26C3AA00BE;\n\tTue,  7 Jul 2020 11:29:41 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A2CDD1DD92;\n\tTue,  7 Jul 2020 11:27:21 +0200 (CEST)",
            "from inva020.nxp.com (inva020.nxp.com [92.121.34.13])\n by dpdk.org (Postfix) with ESMTP id B88221DC9B\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 993421A0A4E;\n Tue,  7 Jul 2020 11:27:07 +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 A98CF1A0A46;\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 6E31240305;\n Tue,  7 Jul 2020 17:27:03 +0800 (SGT)"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 14/29] bus/dpaa: enable set link status",
        "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:29 +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\nEnabled set link status API to start/stop phy\ndevice from application.\n\nSigned-off-by: Rohit Raj <rohit.raj@nxp.com>\n---\n drivers/bus/dpaa/base/qbman/process.c     | 27 +++++++++++++++++\n drivers/bus/dpaa/include/process.h        | 11 +++++++\n drivers/bus/dpaa/rte_bus_dpaa_version.map |  1 +\n drivers/net/dpaa/dpaa_ethdev.c            | 35 ++++++++++++++++-------\n 4 files changed, 63 insertions(+), 11 deletions(-)",
    "diff": "diff --git a/drivers/bus/dpaa/base/qbman/process.c b/drivers/bus/dpaa/base/qbman/process.c\nindex 68b7af243..6f7e37957 100644\n--- a/drivers/bus/dpaa/base/qbman/process.c\n+++ b/drivers/bus/dpaa/base/qbman/process.c\n@@ -366,3 +366,30 @@ int dpaa_get_link_status(char *if_name)\n \n \treturn args.link_status;\n }\n+\n+#define DPAA_IOCTL_UPDATE_LINK_STATUS \\\n+\t_IOW(DPAA_IOCTL_MAGIC, 0x11, struct usdpaa_ioctl_update_link_status_args)\n+\n+int dpaa_update_link_status(char *if_name, int link_status)\n+{\n+\tstruct usdpaa_ioctl_update_link_status_args args;\n+\tint ret;\n+\n+\tret = check_fd();\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tstrcpy(args.if_name, if_name);\n+\targs.link_status = link_status;\n+\n+\tret = ioctl(fd, DPAA_IOCTL_UPDATE_LINK_STATUS, &args);\n+\tif (ret) {\n+\t\tif (errno == EINVAL)\n+\t\t\tprintf(\"Failed to set link status: Not Supported\\n\");\n+\t\telse\n+\t\t\tprintf(\"Failed to set link status\");\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\ndiff --git a/drivers/bus/dpaa/include/process.h b/drivers/bus/dpaa/include/process.h\nindex 7305762c2..f52ea1635 100644\n--- a/drivers/bus/dpaa/include/process.h\n+++ b/drivers/bus/dpaa/include/process.h\n@@ -91,7 +91,18 @@ struct usdpaa_ioctl_link_status_args {\n \tchar    if_name[IF_NAME_MAX_LEN];\n \tint     link_status;\n };\n+\n+struct usdpaa_ioctl_update_link_status_args {\n+\t/* network device node name */\n+\tchar    if_name[IF_NAME_MAX_LEN];\n+\t/* link status(ETH_LINK_UP/DOWN) */\n+\tint     link_status;\n+};\n+\n __rte_internal\n int dpaa_get_link_status(char *if_name);\n \n+__rte_internal\n+int dpaa_update_link_status(char *if_name, int link_status);\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 96662d7be..5dec8d9e5 100644\n--- a/drivers/bus/dpaa/rte_bus_dpaa_version.map\n+++ b/drivers/bus/dpaa/rte_bus_dpaa_version.map\n@@ -19,6 +19,7 @@ INTERNAL {\n \tdpaa_intr_disable;\n \tdpaa_intr_enable;\n \tdpaa_svr_family;\n+\tdpaa_update_link_status;\n \tfman_dealloc_bufs_mask_hi;\n \tfman_dealloc_bufs_mask_lo;\n \tfman_if_add_mac_addr;\ndiff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c\nindex 3f805b2b0..3a5b319d4 100644\n--- a/drivers/net/dpaa/dpaa_ethdev.c\n+++ b/drivers/net/dpaa/dpaa_ethdev.c\n@@ -478,18 +478,15 @@ 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-\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+\tif (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC) {\n+\t\tret = dpaa_get_link_status(__fif->node_name);\n+\t\tif (ret < 0)\n \t\t\treturn ret;\n-\t\t}\n+\t\tlink->link_status = ret;\n+\t} else {\n+\t\tlink->link_status = dpaa_intf->valid;\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@@ -985,17 +982,33 @@ dpaa_dev_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \n static int dpaa_link_down(struct rte_eth_dev *dev)\n {\n+\tstruct fman_if *fif = dev->process_private;\n+\tstruct __fman_if *__fif;\n+\n \tPMD_INIT_FUNC_TRACE();\n \n-\tdpaa_eth_dev_stop(dev);\n+\t__fif = container_of(fif, struct __fman_if, __if);\n+\n+\tif (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)\n+\t\tdpaa_update_link_status(__fif->node_name, ETH_LINK_DOWN);\n+\telse\n+\t\tdpaa_eth_dev_stop(dev);\n \treturn 0;\n }\n \n static int dpaa_link_up(struct rte_eth_dev *dev)\n {\n+\tstruct fman_if *fif = dev->process_private;\n+\tstruct __fman_if *__fif;\n+\n \tPMD_INIT_FUNC_TRACE();\n \n-\tdpaa_eth_dev_start(dev);\n+\t__fif = container_of(fif, struct __fman_if, __if);\n+\n+\tif (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)\n+\t\tdpaa_update_link_status(__fif->node_name, ETH_LINK_UP);\n+\telse\n+\t\tdpaa_eth_dev_start(dev);\n \treturn 0;\n }\n \n",
    "prefixes": [
        "v2",
        "14/29"
    ]
}