get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 15789,
    "url": "http://patches.dpdk.org/api/patches/15789/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1473774463-26966-1-git-send-email-ciara.loftus@intel.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": "<1473774463-26966-1-git-send-email-ciara.loftus@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1473774463-26966-1-git-send-email-ciara.loftus@intel.com",
    "date": "2016-09-13T13:47:43",
    "name": "[dpdk-dev] net/vhost: Add function to retreive the 'vid' for a given port id.",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "31fb0666dee9a60275213433997bdfde39a25e1b",
    "submitter": {
        "id": 144,
        "url": "http://patches.dpdk.org/api/people/144/?format=api",
        "name": "Loftus, Ciara",
        "email": "ciara.loftus@intel.com"
    },
    "delegate": {
        "id": 355,
        "url": "http://patches.dpdk.org/api/users/355/?format=api",
        "username": "yliu",
        "first_name": "Yuanhan",
        "last_name": "Liu",
        "email": "yuanhan.liu@linux.intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1473774463-26966-1-git-send-email-ciara.loftus@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/15789/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/15789/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 8AE3658C5;\n\tTue, 13 Sep 2016 15:47:46 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id B6662568A\n\tfor <dev@dpdk.org>; Tue, 13 Sep 2016 15:47:45 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP; 13 Sep 2016 06:47:44 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby FMSMGA003.fm.intel.com with ESMTP; 13 Sep 2016 06:47:44 -0700",
            "from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com\n\t[10.237.217.45])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\tu8DDlhZb010064 for <dev@dpdk.org>; Tue, 13 Sep 2016 14:47:43 +0100",
            "from sivswdev01.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev01.ir.intel.com with ESMTP id u8DDlhBF027008\n\tfor <dev@dpdk.org>; Tue, 13 Sep 2016 14:47:43 +0100",
            "(from cloftus@localhost)\n\tby sivswdev01.ir.intel.com with  id u8DDlhRm027004\n\tfor dev@dpdk.org; Tue, 13 Sep 2016 14:47:43 +0100"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.30,328,1470726000\"; d=\"scan'208\";a=\"760233117\"",
        "From": "Ciara Loftus <ciara.loftus@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue, 13 Sep 2016 14:47:43 +0100",
        "Message-Id": "<1473774463-26966-1-git-send-email-ciara.loftus@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "Subject": "[dpdk-dev] [PATCH] net/vhost: Add function to retreive the 'vid'\n\tfor a given port id.",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "In some cases when using the vHost PMD, certain vHost library functions\nmay still need to be accessed. One such example is the\nrte_vhost_get_queue_num function which returns the number of virtqueues\nreported by the guest - information which is not exposed by the PMD.\n\nThis commit introduces a new rte_eth_vhost function that returns the\n'vid' associated with a given port id. This allows the PMD user to call\nvHost library functions which require the 'vid' value.\n\nSigned-off-by: Ciara Loftus <ciara.loftus@intel.com>\n---\n drivers/net/vhost/rte_eth_vhost.c           | 29 +++++++++++++++++++++++++++++\n drivers/net/vhost/rte_eth_vhost.h           |  9 +++++++++\n drivers/net/vhost/rte_pmd_vhost_version.map |  6 ++++++\n 3 files changed, 44 insertions(+)",
    "diff": "diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c\nindex 7539cd4..091517d 100644\n--- a/drivers/net/vhost/rte_eth_vhost.c\n+++ b/drivers/net/vhost/rte_eth_vhost.c\n@@ -428,6 +428,35 @@ rte_eth_vhost_get_queue_event(uint8_t port_id,\n \treturn -1;\n }\n \n+int\n+rte_eth_vhost_get_vid_from_port_id(uint8_t port_id)\n+{\n+\tstruct internal_list *list;\n+\tstruct rte_eth_dev *eth_dev;\n+\tstruct vhost_queue *vq;\n+\tint vid = -1;\n+\n+\tif (!rte_eth_dev_is_valid_port(port_id))\n+\t\treturn -1;\n+\n+\tpthread_mutex_lock(&internal_list_lock);\n+\n+\tTAILQ_FOREACH(list, &internal_list, next) {\n+\t\teth_dev = list->eth_dev;\n+\t\tif (eth_dev->data->port_id == port_id) {\n+\t\t\tvq = eth_dev->data->rx_queues[0];\n+\t\t\tif (vq) {\n+\t\t\t\tvid = vq->vid;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\tpthread_mutex_unlock(&internal_list_lock);\n+\n+\treturn vid;\n+}\n+\n static void *\n vhost_driver_session(void *param __rte_unused)\n {\ndiff --git a/drivers/net/vhost/rte_eth_vhost.h b/drivers/net/vhost/rte_eth_vhost.h\nindex ff5d877..7c98b1a 100644\n--- a/drivers/net/vhost/rte_eth_vhost.h\n+++ b/drivers/net/vhost/rte_eth_vhost.h\n@@ -102,6 +102,15 @@ struct rte_eth_vhost_queue_event {\n int rte_eth_vhost_get_queue_event(uint8_t port_id,\n \t\tstruct rte_eth_vhost_queue_event *event);\n \n+/**\n+ * Get the 'vid' value associated with the specified port.\n+ *\n+ * @return\n+ *  - On success, the 'vid' associated with 'port_id'.\n+ *  - On failure, a negative value.\n+ */\n+int rte_eth_vhost_get_vid_from_port_id(uint8_t port_id);\n+\n #ifdef __cplusplus\n }\n #endif\ndiff --git a/drivers/net/vhost/rte_pmd_vhost_version.map b/drivers/net/vhost/rte_pmd_vhost_version.map\nindex 65bf3a8..0533a83 100644\n--- a/drivers/net/vhost/rte_pmd_vhost_version.map\n+++ b/drivers/net/vhost/rte_pmd_vhost_version.map\n@@ -8,3 +8,9 @@ DPDK_16.04 {\n \n \tlocal: *;\n };\n+\n+DPDK_16.11 {\n+\tglobal:\n+\n+\trte_eth_vhost_get_vid_from_port_id;\n+}\n",
    "prefixes": [
        "dpdk-dev"
    ]
}