get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 80491,
    "url": "http://patches.dpdk.org/api/patches/80491/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201013115055.34295-3-huwei013@chinasoftinc.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": "<20201013115055.34295-3-huwei013@chinasoftinc.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201013115055.34295-3-huwei013@chinasoftinc.com",
    "date": "2020-10-13T11:50:54",
    "name": "[v5,2/3] ethdev: check if queue setup in queue-related APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "90cdc0c72bda312e05f207dd191e7845c943317b",
    "submitter": {
        "id": 1537,
        "url": "http://patches.dpdk.org/api/people/1537/?format=api",
        "name": "Wei Hu (Xavier)",
        "email": "huwei013@chinasoftinc.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/20201013115055.34295-3-huwei013@chinasoftinc.com/mbox/",
    "series": [
        {
            "id": 12911,
            "url": "http://patches.dpdk.org/api/series/12911/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12911",
            "date": "2020-10-13T11:50:52",
            "name": "check queue id in queue-related APIs",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/12911/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/80491/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/80491/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 330F6A04B7;\n\tTue, 13 Oct 2020 13:51:54 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3C5671DAF0;\n\tTue, 13 Oct 2020 13:51:19 +0200 (CEST)",
            "from incedge.chinasoftinc.com (unknown [114.113.233.8])\n by dpdk.org (Postfix) with ESMTP id 894061DADB\n for <dev@dpdk.org>; Tue, 13 Oct 2020 13:51:15 +0200 (CEST)",
            "from mail.chinasoftinc.com (inccas001.ito.icss [10.168.0.51]) by\n incedge.chinasoftinc.com with ESMTP id xxfe1ZEcnMJOdSK8 (version=TLSv1\n cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO);\n Tue, 13 Oct 2020 19:51:12 +0800 (CST)",
            "from localhost.localdomain (65.49.108.226) by INCCAS001.ito.icss\n (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Tue, 13 Oct 2020\n 19:51:12 +0800"
        ],
        "X-ASG-Debug-ID": "1602589872-149d114caf2078c0001-TfluYd",
        "X-Barracuda-Envelope-From": "huwei013@chinasoftinc.com",
        "X-Barracuda-RBL-Trusted-Forwarder": [
            "10.168.0.51",
            "10.168.0.60"
        ],
        "X-ASG-Whitelist": "Client",
        "From": "\"Wei Hu (Xavier)\" <huwei013@chinasoftinc.com>",
        "To": "<dev@dpdk.org>, <stephen@networkplumber.org>, <ferruh.yigit@intel.com>,\n <kalesh-anakkur.purayil@broadcom.com>, <andrew.rybchenko@oktetlabs.ru>",
        "CC": "<xavier.huwei@huawei.com>",
        "Date": "Tue, 13 Oct 2020 19:50:54 +0800",
        "X-ASG-Orig-Subj": "[PATCH v5 2/3] ethdev: check if queue setup in queue-related\n APIs",
        "Message-ID": "<20201013115055.34295-3-huwei013@chinasoftinc.com>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20201013115055.34295-1-huwei013@chinasoftinc.com>",
        "References": "<20201010071212.24086-1-huwei013@chinasoftinc.com>\n <20201013115055.34295-1-huwei013@chinasoftinc.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[65.49.108.226]",
        "X-Barracuda-Connect": "inccas001.ito.icss[10.168.0.51]",
        "X-Barracuda-Start-Time": "1602589872",
        "X-Barracuda-Encrypted": "ECDHE-RSA-AES256-SHA",
        "X-Barracuda-URL": "https://incspam.chinasofti.com:443/cgi-mod/mark.cgi",
        "X-Virus-Scanned": "by bsmtpd at chinasoftinc.com",
        "X-Barracuda-Scan-Msg-Size": "2266",
        "Subject": "[dpdk-dev] [PATCH v5 2/3] ethdev: check if queue setup in\n\tqueue-related APIs",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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: \"Wei Hu (Xavier)\" <xavier.huwei@huawei.com>\n\nThis patch adds checking whether the related Tx or Rx queue has been setup\nin the queue-related API functions to avoid illegal address access.\n\nSigned-off-by: Chengchang Tang <tangchengchang@huawei.com>\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\nAcked-by: Stephen Hemminger <stephen@networkplumber.org>\nReviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>\n---\n lib/librte_ethdev/rte_ethdev.c | 16 ++++++++++++++++\n lib/librte_ethdev/rte_ethdev.h |  3 ++-\n 2 files changed, 18 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 11e54d9..4acf858 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -890,6 +890,14 @@ eth_dev_validate_rx_queue(const struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \t\treturn -EINVAL;\n \t}\n \n+\tif (dev->data->rx_queues[rx_queue_id] == NULL) {\n+\t\tport_id = dev->data->port_id;\n+\t\tRTE_ETHDEV_LOG(ERR,\n+\t\t\t       \"Queue %u of device with port_id=%u has not been setup\\n\",\n+\t\t\t       rx_queue_id, port_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \treturn 0;\n }\n \n@@ -906,6 +914,14 @@ eth_dev_validate_tx_queue(const struct rte_eth_dev *dev, uint16_t tx_queue_id)\n \t\treturn -EINVAL;\n \t}\n \n+\tif (dev->data->tx_queues[tx_queue_id] == NULL) {\n+\t\tport_id = dev->data->port_id;\n+\t\tRTE_ETHDEV_LOG(ERR,\n+\t\t\t       \"Queue %u of device with port_id=%u has not been setup\\n\",\n+\t\t\t       tx_queue_id, port_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n \treturn 0;\n }\n \ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex 5bcfbb8..f4cc591 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -4721,7 +4721,8 @@ rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)\n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);\n \tdev = &rte_eth_devices[port_id];\n \tRTE_FUNC_PTR_OR_ERR_RET(*dev->rx_queue_count, -ENOTSUP);\n-\tif (queue_id >= dev->data->nb_rx_queues)\n+\tif (queue_id >= dev->data->nb_rx_queues ||\n+\t    dev->data->rx_queues[queue_id] == NULL)\n \t\treturn -EINVAL;\n \n \treturn (int)(*dev->rx_queue_count)(dev, queue_id);\n",
    "prefixes": [
        "v5",
        "2/3"
    ]
}