get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 102589,
    "url": "http://patches.dpdk.org/api/patches/102589/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211021115139.2634-1-vipul.ashri@oracle.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": "<20211021115139.2634-1-vipul.ashri@oracle.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211021115139.2634-1-vipul.ashri@oracle.com",
    "date": "2021-10-21T11:51:39",
    "name": "[1/1] net/failsafe: link_update request crashing at boot",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9f35e918be8f6849aa3130299d6770dd3f698f65",
    "submitter": {
        "id": 1867,
        "url": "http://patches.dpdk.org/api/people/1867/?format=api",
        "name": "Vipul Ashri",
        "email": "vipul.ashri@oracle.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211021115139.2634-1-vipul.ashri@oracle.com/mbox/",
    "series": [
        {
            "id": 19881,
            "url": "http://patches.dpdk.org/api/series/19881/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19881",
            "date": "2021-10-21T11:51:39",
            "name": "[1/1] net/failsafe: link_update request crashing at boot",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/19881/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/102589/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/102589/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 2ED2CA0C4B;\n\tThu, 21 Oct 2021 13:56:37 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7F9E3411D8;\n\tThu, 21 Oct 2021 13:56:36 +0200 (CEST)",
            "from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com\n [205.220.165.32])\n by mails.dpdk.org (Postfix) with ESMTP id DBC0B4117A;\n Thu, 21 Oct 2021 13:56:34 +0200 (CEST)",
            "from pps.filterd (m0246617.ppops.net [127.0.0.1])\n by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id\n 19LAaAT1009072;\n Thu, 21 Oct 2021 11:56:33 GMT",
            "from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80])\n by mx0b-00069f02.pphosted.com with ESMTP id 3btqypmmf7-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Thu, 21 Oct 2021 11:56:32 +0000",
            "from pps.filterd (userp3030.oracle.com [127.0.0.1])\n by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19LBqhtx068717;\n Thu, 21 Oct 2021 11:56:30 GMT",
            "from pps.reinject (localhost [127.0.0.1])\n by userp3030.oracle.com with ESMTP id 3bqkv1rr6b-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Thu, 21 Oct 2021 11:56:30 +0000",
            "from userp3030.oracle.com (userp3030.oracle.com [127.0.0.1])\n by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 19LBqot8071215;\n Thu, 21 Oct 2021 11:52:50 GMT",
            "from vashri-in.in.oracle.com (dhcp-10-166-166-204.vpn.oracle.com\n [10.166.166.204]) by userp3030.oracle.com with ESMTP id 3bqkv1rjss-1;\n Thu, 21 Oct 2021 11:52:46 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;\n h=from : to : cc :\n subject : date : message-id : mime-version : content-transfer-encoding;\n s=corp-2021-07-09; bh=XPYr1MIPOuXmr1H1xk1knjW99Se6v67d6OqTq6vFSss=;\n b=ht1aDwOHvhKGHoZfY9DX/2bNi/ReV5S5mws3Y6zOSkrvFfELjrJL+ZQGdSfOwpFL5IfZ\n rVzWRX7RGpXAb8gGec62aQBs/JWDCz0z956hgCERkv6NT5TEqrFaeSZyoYrhJJUPdB4y\n lgMG2GPM06s3IUwl3Q7I9FxZ4svwWFNcqO6zWLswZsy/+Bdvr0mryrEZIP7YpSFGa388\n KfLQHfaq9geIuzkMeSzFUMzCUk+3geHwFglb/ktsX2zK5wbY8073zDM/hMIrlPPV8JYU\n lePOF40Y7J16u4Od5HwsbqzQJS7vtjDb3tBSa+kfKauo0iRhEpdc++oMUJ4G6+Ncyr9b bA==",
        "From": "vipul.ashri@oracle.com",
        "To": "grive@u256.net",
        "Cc": "dev@dpdk.org, Vipul Ashri <vipul.ashri@oracle.com>, stable@dpdk.org",
        "Date": "Thu, 21 Oct 2021 17:21:39 +0530",
        "Message-Id": "<20211021115139.2634-1-vipul.ashri@oracle.com>",
        "X-Mailer": "git-send-email 2.28.0.windows.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Proofpoint-ORIG-GUID": "Yi6Lz3p7V32mjOdz_JxSsh6J5TFF5qmQ",
        "X-Proofpoint-GUID": "Yi6Lz3p7V32mjOdz_JxSsh6J5TFF5qmQ",
        "Subject": "[dpdk-dev] [PATCH 1/1] net/failsafe: link_update request crashing\n at boot",
        "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": "From: Vipul Ashri <vipul.ashri@oracle.com>\n\nfailsafe crashed while sending early link_update request during\nboot time initialization.\nBased on debugging we found failsafe device was good but sub-\ndevices were progressing towards initialization and SUBOPS macro\nwhere expanding macro gives [partial_dev]->dev_ops->link_update()\nexecution of which triggered crash because dev_ops==0. similar\ncrash seen at failsafe_eth_dev_close()\n\nFailsafe driver need a separate check for subdevices similar to\n\"RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\" which is\ncalled to almost every eth_dev function.\n\nFixes: a46f8d5 (\"net/failsafe: add fail-safe PMD\")\nCc: stable@dpdk.org\nSigned-off-by: Vipul Ashri <vipul.ashri@oracle.com>\n---\n drivers/net/failsafe/failsafe_ops.c     | 45 +++++++++++++++++++++++--\n drivers/net/failsafe/failsafe_private.h |  6 ++++\n 2 files changed, 49 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c\nindex d0030af061..f0c5e40fd5 100644\n--- a/drivers/net/failsafe/failsafe_ops.c\n+++ b/drivers/net/failsafe/failsafe_ops.c\n@@ -371,7 +371,8 @@ fs_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)\n \t\tclose(rxq->event_fd);\n \tFOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {\n \t\tif (ETH(sdev)->data->rx_queues != NULL &&\n-\t\t    ETH(sdev)->data->rx_queues[rxq->qid] != NULL)\n+\t\t\tETH(sdev)->data->rx_queues[rxq->qid] != NULL &&\n+\t\t\tSUBDEV_VALID_PORTID(sdev)) {\n \t\t\tSUBOPS(sdev, rx_queue_release)(ETH(sdev), rxq->qid);\n \t}\n \tdev->data->rx_queues[rxq->qid] = NULL;\n@@ -405,6 +406,12 @@ fs_rx_queue_setup(struct rte_eth_dev *dev,\n \tfs_lock(dev, 0);\n \tif (rx_conf->rx_deferred_start) {\n \t\tFOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {\n+\t\t\tif (!SUBDEV_VALID_PORTID(sdev)) {\n+\t\t\t\tERROR(\"fs_rx_queue_setup: Invalid sub-device \"\n+\t\t\t\t\t\"port_id=%u\\n\", PORT_ID(sdev));\n+\t\t\t\tfs_unlock(dev, 0);\n+\t\t\t\treturn -ENODEV;\n+\t\t\t}\n \t\t\tif (SUBOPS(sdev, rx_queue_start) == NULL) {\n \t\t\t\tERROR(\"Rx queue deferred start is not \"\n \t\t\t\t\t\"supported for subdevice %d\", i);\n@@ -548,7 +555,8 @@ fs_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)\n \tfs_lock(dev, 0);\n \tFOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {\n \t\tif (ETH(sdev)->data->tx_queues != NULL &&\n-\t\t    ETH(sdev)->data->tx_queues[txq->qid] != NULL)\n+\t\t\tETH(sdev)->data->tx_queues[txq->qid] != NULL &&\n+\t\t\tSUBDEV_VALID_PORTID(sdev)) {\n \t\t\tSUBOPS(sdev, tx_queue_release)(ETH(sdev), txq->qid);\n \t}\n \tdev->data->tx_queues[txq->qid] = NULL;\n@@ -571,6 +579,12 @@ fs_tx_queue_setup(struct rte_eth_dev *dev,\n \tfs_lock(dev, 0);\n \tif (tx_conf->tx_deferred_start) {\n \t\tFOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) {\n+\t\t\tif (!SUBDEV_VALID_PORTID(sdev)) {\n+\t\t\t\tERROR(\"fs_tx_queue_setup: Invalid sub-device \"\n+\t\t\t\t\t\"port_id=%u\\n\", PORT_ID(sdev));\n+\t\t\t\tfs_unlock(dev, 0);\n+\t\t\t\treturn -ENODEV;\n+\t\t\t}\n \t\t\tif (SUBOPS(sdev, tx_queue_start) == NULL) {\n \t\t\t\tERROR(\"Tx queue deferred start is not \"\n \t\t\t\t\t\"supported for subdevice %d\", i);\n@@ -645,6 +659,12 @@ failsafe_eth_dev_close(struct rte_eth_dev *dev)\n \tfs_lock(dev, 0);\n \tfailsafe_hotplug_alarm_cancel(dev);\n \tif (PRIV(dev)->state == DEV_STARTED) {\n+\t\tif (!rte_eth_dev_is_valid_port(dev->data->port_id)) {\n+\t\t\tERROR(\"failsafe_eth_dev_close: Invalid sub-device \"\n+\t\t\t\t\"port_id=%u\\n\", dev->data->port_id);\n+\t\t\tfs_unlock(dev, 0);\n+\t\t\treturn -ENODEV;\n+\t\t}\n \t\tret = dev->dev_ops->dev_stop(dev);\n \t\tif (ret != 0) {\n \t\t\tfs_unlock(dev, 0);\n@@ -827,6 +847,12 @@ fs_link_update(struct rte_eth_dev *dev,\n \n \tfs_lock(dev, 0);\n \tFOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {\n+\t\tif (!SUBDEV_VALID_PORTID(sdev)) {\n+\t\t\tERROR(\"fs_link_update: Invalid Sub-device \"\n+\t\t\t\t\"port_id=%u\\n\", PORT_ID(sdev));\n+\t\t\tfs_unlock(dev, 0);\n+\t\t\treturn -ENODEV;\n+\t\t}\n \t\tDEBUG(\"Calling link_update on sub_device %d\", i);\n \t\tret = (SUBOPS(sdev, link_update))(ETH(sdev), wait_to_complete);\n \t\tif (ret && ret != -1 && sdev->remove == 0 &&\n@@ -1251,6 +1277,15 @@ fs_dev_supported_ptypes_get(struct rte_eth_dev *dev)\n \t\tgoto unlock;\n \t}\n \tedev = ETH(sdev);\n+\n+\tif (!SUBDEV_VALID_PORTID(sdev)) {\n+\t\tERROR(\"fs_dev_supported_ptypes_get: \"\n+\t\t\t\"Invalid TX_SUBDEV port_id=%u\\n\", PORT_ID(sdev));\n+\t\trte_errno = -ENODEV;\n+\t\tret = NULL;\n+\t\tgoto unlock;\n+\t}\n+\n \t/* ENOTSUP: counts as no supported ptypes */\n \tif (SUBOPS(sdev, dev_supported_ptypes_get) == NULL) {\n \t\tret = NULL;\n@@ -1326,6 +1361,12 @@ fs_flow_ctrl_get(struct rte_eth_dev *dev,\n \t\tret = 0;\n \t\tgoto unlock;\n \t}\n+\tif (!SUBDEV_VALID_PORTID(sdev)) {\n+\t\tERROR(\"fs_flow_ctrl_get_get: Invalid TX_SUBDEV \"\n+\t\t\t\"port_id=%u\\n\", PORT_ID(sdev));\n+\t\tret = -ENODEV;\n+\t\tgoto unlock;\n+\t}\n \tif (SUBOPS(sdev, flow_ctrl_get) == NULL) {\n \t\tret = -ENOTSUP;\n \t\tgoto unlock;\ndiff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h\nindex cd39d103c6..95eb31f9e6 100644\n--- a/drivers/net/failsafe/failsafe_private.h\n+++ b/drivers/net/failsafe/failsafe_private.h\n@@ -308,6 +308,12 @@ extern int failsafe_mac_from_arg;\n \t : (PRIV(dev)->subs[PRIV(dev)->subs_tx].state < DEV_PROBED ? NULL \\\n \t : &PRIV(dev)->subs[PRIV(dev)->subs_tx]))\n \n+/**\n+ * check for fail-safe sub-device valid port\n+ */\n+#define SUBDEV_VALID_PORTID(s) \\\n+    rte_eth_dev_is_valid_port(PORT_ID(s))\n+\n /**\n  * s:   (struct sub_device *)\n  * ops: (struct eth_dev_ops) member\n",
    "prefixes": [
        "1/1"
    ]
}