get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 102609,
    "url": "http://patches.dpdk.org/api/patches/102609/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211021214215.1633-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": "<20211021214215.1633-1-vipul.ashri@oracle.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211021214215.1633-1-vipul.ashri@oracle.com",
    "date": "2021-10-21T21:42:15",
    "name": "[v2] net/failsafe: link_update request crashing at boot",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "4d612f8f07e72d3cbd406d497958ff72f5b869d5",
    "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/20211021214215.1633-1-vipul.ashri@oracle.com/mbox/",
    "series": [
        {
            "id": 19888,
            "url": "http://patches.dpdk.org/api/series/19888/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19888",
            "date": "2021-10-21T21:42:15",
            "name": "[v2] net/failsafe: link_update request crashing at boot",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/19888/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/102609/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/102609/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 9AB87A0C43;\n\tThu, 21 Oct 2021 23:43:09 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1D17240040;\n\tThu, 21 Oct 2021 23:43:09 +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 042BB4003F;\n Thu, 21 Oct 2021 23:43:06 +0200 (CEST)",
            "from pps.filterd (m0246627.ppops.net [127.0.0.1])\n by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id\n 19LLCuNc030748;\n Thu, 21 Oct 2021 21:43:05 GMT",
            "from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79])\n by mx0b-00069f02.pphosted.com with ESMTP id 3btkxa1efg-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Thu, 21 Oct 2021 21:43:05 +0000",
            "from pps.filterd (userp3020.oracle.com [127.0.0.1])\n by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19LLfejf163312;\n Thu, 21 Oct 2021 21:43:03 GMT",
            "from pps.reinject (localhost [127.0.0.1])\n by userp3020.oracle.com with ESMTP id 3br8gwsscn-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Thu, 21 Oct 2021 21:43:03 +0000",
            "from userp3020.oracle.com (userp3020.oracle.com [127.0.0.1])\n by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 19LLh3jk167265;\n Thu, 21 Oct 2021 21:43:03 GMT",
            "from vashri-in.in.oracle.com (dhcp-10-166-165-156.vpn.oracle.com\n [10.166.165.156]) by userp3020.oracle.com with ESMTP id 3br8gwss9g-1;\n Thu, 21 Oct 2021 21:43:02 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding; s=corp-2021-07-09;\n bh=0pEiVA7/UmeapkF8eb0abs3OMrfNwZ7QROVq8B6JqJU=;\n b=dWCE67J7LKDTDS6Yt5q+LwnYqOD9Zknb+zulnIOIdvVY7IBOmciGsEjvrglc57ajWzuw\n mv9COQyHKgYW+aYSlcOyiTyJFbY4wtcUiz3kmK5HYi+VHDx3Cx1cfMdVq8fuCchCEkWX\n OGa1xjzfemle7oGFlmOO295Zv3R5FIXW+giFUyhaKxz7rAHSH00czCriBAZz93I3LUqC\n x5euZB7rdgKLIYYRA6+lAjPu5nlYo3XxdKhyfAjz5kaRoLJ+YEcmmSdqNMdIbkH1fcOO\n ACOwskQvs5BDNxxpMsj/+n805fuThVqfOjf30qqWaIo+ML6keqYs27p+IDRgS2VkXpXO MA==",
        "From": "vipul.ashri@oracle.com",
        "To": "dev@dpdk.org",
        "Cc": "grive@u256.net, Vipul Ashri <vipul.ashri@oracle.com>, stable@dpdk.org",
        "Date": "Fri, 22 Oct 2021 03:12:15 +0530",
        "Message-Id": "<20211021214215.1633-1-vipul.ashri@oracle.com>",
        "X-Mailer": "git-send-email 2.28.0.windows.1",
        "In-Reply-To": "<20211021115139.2634-1-vipul.ashri@oracle.com>",
        "References": "<20211021115139.2634-1-vipul.ashri@oracle.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Proofpoint-ORIG-GUID": "3UxXJJZSs-94rElE_DZhbYvK1vKaHco0",
        "X-Proofpoint-GUID": "3UxXJJZSs-94rElE_DZhbYvK1vKaHco0",
        "Subject": "[dpdk-dev] [PATCH v2] net/failsafe: link_update request crashing at\n 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 29de39910c..8e128b9802 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(\"%s: Invalid sub-device port_id=%u\\n\",\n+\t\t\t\t\t__func__, 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(\"%s: Invalid sub-device port_id=%u\\n\",\n+\t\t\t\t\t__func__, 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(\"%s: Invalid sub-device port_id=%u\\n\",\n+\t\t\t\t__func__, 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(\"%s: Invalid Sub-device port_id=%u\\n\",\n+\t\t\t\t__func__, 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@@ -1249,6 +1275,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(\"%s: Invalid TX_SUBDEV port_id=%u\\n\",\n+\t\t\t__func__, 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@@ -1324,6 +1359,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(\"%s: Invalid TX_SUBDEV port_id=%u\\n\",\n+\t\t\t__func__, 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..0227060bcb 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+\trte_eth_dev_is_valid_port(PORT_ID(s))\n+\n /**\n  * s:   (struct sub_device *)\n  * ops: (struct eth_dev_ops) member\n",
    "prefixes": [
        "v2"
    ]
}