get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1262,
    "url": "https://patches.dpdk.org/api/patches/1262/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415831647-11139-2-git-send-email-huawei.xie@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1415831647-11139-2-git-send-email-huawei.xie@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415831647-11139-2-git-send-email-huawei.xie@intel.com",
    "date": "2014-11-12T22:34:06",
    "name": "[dpdk-dev,1/2] examples/vhost: support new VMDQ API and new nic i40e",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "040d90b6cecb36cd6ba9fd9f18a94b2efcc14156",
    "submitter": {
        "id": 16,
        "url": "https://patches.dpdk.org/api/people/16/?format=api",
        "name": "Huawei Xie",
        "email": "huawei.xie@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1415831647-11139-2-git-send-email-huawei.xie@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1262/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1262/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 332E77E9D;\n\tWed, 12 Nov 2014 23:26:30 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 3F7807E75\n\tfor <dev@dpdk.org>; Wed, 12 Nov 2014 23:26:27 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga103.fm.intel.com with ESMTP; 12 Nov 2014 14:28:48 -0800",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 12 Nov 2014 14:34:47 -0800",
            "from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com\n\t[10.239.29.90])\n\tby shvmail01.sh.intel.com with ESMTP id sACMYjtO026648;\n\tThu, 13 Nov 2014 06:34:45 +0800",
            "from shecgisg003.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid sACMYh7o011180; Thu, 13 Nov 2014 06:34:45 +0800",
            "(from hxie5@localhost)\n\tby shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id sACMYhYo011176; \n\tThu, 13 Nov 2014 06:34:43 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.07,371,1413270000\"; d=\"scan'208\";a=\"621474230\"",
        "From": "Huawei Xie <huawei.xie@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu, 13 Nov 2014 06:34:06 +0800",
        "Message-Id": "<1415831647-11139-2-git-send-email-huawei.xie@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1415831647-11139-1-git-send-email-huawei.xie@intel.com>",
        "References": "<1415831647-11139-1-git-send-email-huawei.xie@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 1/2] examples/vhost: support new VMDQ API and new\n\tnic i40e",
        "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 Niantic, if VMDQ mode is set, all queues are allocated to VMDQ in DPDK.\nIn I40E, only configured part of continous queues are allocated to VMDQ.\nThe rte_eth_dev_info structure is extened to provide VMDQ queue base, queue number, and VMDQ pool base information.\nThis patch support the new VMDQ API in vhost example.\n\nFIXME in PMD:\n * added mac address will be flushed at rte_eth_dev_start.\n * we don't support selectively setting up queues well. \n\nSigned-off-by: Huawei Xie <huawei.xie@intel.com>\n---\n examples/vhost/main.c | 25 +++++++++++++++++++------\n 1 file changed, 19 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/examples/vhost/main.c b/examples/vhost/main.c\nindex a93f7a0..2b1bf02 100644\n--- a/examples/vhost/main.c\n+++ b/examples/vhost/main.c\n@@ -53,7 +53,7 @@\n \n #include \"main.h\"\n \n-#define MAX_QUEUES 128\n+#define MAX_QUEUES 256\n \n /* the maximum number of external ports supported */\n #define MAX_SUP_PORTS 1\n@@ -282,6 +282,9 @@ static struct rte_eth_conf vmdq_conf_default = {\n static unsigned lcore_ids[RTE_MAX_LCORE];\n static uint8_t ports[RTE_MAX_ETHPORTS];\n static unsigned num_ports = 0; /**< The number of ports specified in command line */\n+static uint16_t num_pf_queues, num_vmdq_queues;\n+static uint16_t vmdq_pool_base, vmdq_queue_base;\n+static uint16_t queues_per_pool;\n \n static const uint16_t external_pkt_default_vlan_tag = 2000;\n const uint16_t vlan_tags[] = {\n@@ -417,7 +420,6 @@ port_init(uint8_t port)\n \n \t/*configure the number of supported virtio devices based on VMDQ limits */\n \tnum_devices = dev_info.max_vmdq_pools;\n-\tnum_queues = dev_info.max_rx_queues;\n \n \tif (zero_copy) {\n \t\trx_ring_size = num_rx_descriptor;\n@@ -437,10 +439,19 @@ port_init(uint8_t port)\n \tretval = get_eth_conf(&port_conf, num_devices);\n \tif (retval < 0)\n \t\treturn retval;\n+\t/* NIC queues are divided into pf queues and vmdq queues.  */\n+\tnum_pf_queues = dev_info.max_rx_queues - dev_info.vmdq_queue_num;\n+\tqueues_per_pool = dev_info.vmdq_queue_num / dev_info.max_vmdq_pools;\n+\tnum_vmdq_queues = num_devices * queues_per_pool;\n+\tnum_queues = num_pf_queues + num_vmdq_queues;\n+\tvmdq_queue_base = dev_info.vmdq_queue_base;\n+\tvmdq_pool_base  = dev_info.vmdq_pool_base;\n+\tprintf(\"pf queue num: %u, configured vmdq pool num: %u, each vmdq pool has %u queues\\n\",\n+\t\tnum_pf_queues, num_devices, queues_per_pool);\n \n \tif (port >= rte_eth_dev_count()) return -1;\n \n-\trx_rings = (uint16_t)num_queues,\n+\trx_rings = (uint16_t)dev_info.max_rx_queues;\n \t/* Configure ethernet device. */\n \tretval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);\n \tif (retval != 0)\n@@ -931,7 +942,8 @@ link_vmdq(struct vhost_dev *vdev, struct rte_mbuf *m)\n \t\tvdev->vlan_tag);\n \n \t/* Register the MAC address. */\n-\tret = rte_eth_dev_mac_addr_add(ports[0], &vdev->mac_address, (uint32_t)dev->device_fh);\n+\tret = rte_eth_dev_mac_addr_add(ports[0], &vdev->mac_address,\n+\t\t\t\t(uint32_t)dev->device_fh + vmdq_pool_base);\n \tif (ret)\n \t\tRTE_LOG(ERR, VHOST_DATA, \"(%\"PRIu64\") Failed to add device MAC address to VMDQ\\n\",\n \t\t\t\t\tdev->device_fh);\n@@ -2602,7 +2614,7 @@ new_device (struct virtio_net *dev)\n \tll_dev->vdev = vdev;\n \tadd_data_ll_entry(&ll_root_used, ll_dev);\n \tvdev->vmdq_rx_q\n-\t\t= dev->device_fh * (num_queues / num_devices);\n+\t\t= dev->device_fh * queues_per_pool + vmdq_queue_base;\n \n \tif (zero_copy) {\n \t\tuint32_t index = vdev->vmdq_rx_q;\n@@ -2837,7 +2849,8 @@ MAIN(int argc, char *argv[])\n \tunsigned lcore_id, core_id = 0;\n \tunsigned nb_ports, valid_num_ports;\n \tint ret;\n-\tuint8_t portid, queue_id = 0;\n+\tuint8_t portid;\n+\tuint16_t queue_id;\n \tstatic pthread_t tid;\n \n \t/* init EAL */\n",
    "prefixes": [
        "dpdk-dev",
        "1/2"
    ]
}