get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 6743,
    "url": "https://patches.dpdk.org/api/patches/6743/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1439366567-3402-8-git-send-email-changchun.ouyang@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": "<1439366567-3402-8-git-send-email-changchun.ouyang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1439366567-3402-8-git-send-email-changchun.ouyang@intel.com",
    "date": "2015-08-12T08:02:42",
    "name": "[dpdk-dev,v4,07/12] vhost: add new command line option: rxq",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c865c9a2a66f540ef26b17c0397ac8627dbd98a0",
    "submitter": {
        "id": 31,
        "url": "https://patches.dpdk.org/api/people/31/?format=api",
        "name": "Ouyang Changchun",
        "email": "changchun.ouyang@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1439366567-3402-8-git-send-email-changchun.ouyang@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/6743/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/6743/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 5EFFB8D90;\n\tWed, 12 Aug 2015 10:03:19 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 9AE7B8D86\n\tfor <dev@dpdk.org>; Wed, 12 Aug 2015 10:03:17 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby fmsmga101.fm.intel.com with ESMTP; 12 Aug 2015 01:03:17 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga002.jf.intel.com with ESMTP; 12 Aug 2015 01:03:16 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t7C83C8i027086;\n\tWed, 12 Aug 2015 16:03:12 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t7C83ATW003675; Wed, 12 Aug 2015 16:03:12 +0800",
            "(from couyang@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t7C83AaL003671; \n\tWed, 12 Aug 2015 16:03:10 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.15,659,1432623600\"; d=\"scan'208\";a=\"782522640\"",
        "From": "Ouyang Changchun <changchun.ouyang@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed, 12 Aug 2015 16:02:42 +0800",
        "Message-Id": "<1439366567-3402-8-git-send-email-changchun.ouyang@intel.com>",
        "X-Mailer": "git-send-email 1.7.12.2",
        "In-Reply-To": "<1439366567-3402-1-git-send-email-changchun.ouyang@intel.com>",
        "References": "<1434355006-30583-1-git-send-email-changchun.ouyang@intel.com>\n\t<1439366567-3402-1-git-send-email-changchun.ouyang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 07/12] vhost: add new command line option: rxq",
        "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": "Sample vhost need know the queue number user want to enable for each virtio device,\nso add the new option '--rxq' into it.\n\nSigned-off-by: Changchun Ouyang <changchun.ouyang@intel.com>\n---\nChanges in v3\n  - fix coding style\n\nChanges in v2\n  - refine help info\n  - check if rxq = 0\n  - fix checkpatch errors\n\n examples/vhost/main.c | 49 +++++++++++++++++++++++++++++++++++++++++++++----\n 1 file changed, 45 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/examples/vhost/main.c b/examples/vhost/main.c\nindex d3c45dd..5b811af 100644\n--- a/examples/vhost/main.c\n+++ b/examples/vhost/main.c\n@@ -163,6 +163,9 @@ static int mergeable;\n /* Do vlan strip on host, enabled on default */\n static uint32_t vlan_strip = 1;\n \n+/* Rx queue number per virtio device */\n+static uint32_t rxq = 1;\n+\n /* number of descriptors to apply*/\n static uint32_t num_rx_descriptor = RTE_TEST_RX_DESC_DEFAULT_ZCP;\n static uint32_t num_tx_descriptor = RTE_TEST_TX_DESC_DEFAULT_ZCP;\n@@ -408,8 +411,19 @@ port_init(uint8_t port)\n \t\ttxconf->tx_deferred_start = 1;\n \t}\n \n-\t/*configure the number of supported virtio devices based on VMDQ limits */\n-\tnum_devices = dev_info.max_vmdq_pools;\n+\t/* Configure the virtio devices num based on VMDQ limits */\n+\tswitch (rxq) {\n+\tcase 1:\n+\tcase 2:\n+\t\tnum_devices = dev_info.max_vmdq_pools;\n+\t\tbreak;\n+\tcase 4:\n+\t\tnum_devices = dev_info.max_vmdq_pools / 2;\n+\t\tbreak;\n+\tdefault:\n+\t\tRTE_LOG(ERR, VHOST_CONFIG, \"rxq invalid for VMDq.\\n\");\n+\t\treturn -1;\n+\t}\n \n \tif (zero_copy) {\n \t\trx_ring_size = num_rx_descriptor;\n@@ -431,7 +445,7 @@ port_init(uint8_t port)\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+\tqueues_per_pool = dev_info.vmdq_queue_num / num_devices;\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@@ -576,7 +590,8 @@ us_vhost_usage(const char *prgname)\n \t\"\t\t--rx-desc-num [0-N]: the number of descriptors on rx, \"\n \t\t\t\"used only when zero copy is enabled.\\n\"\n \t\"\t\t--tx-desc-num [0-N]: the number of descriptors on tx, \"\n-\t\t\t\"used only when zero copy is enabled.\\n\",\n+\t\t\t\"used only when zero copy is enabled.\\n\"\n+\t\"\t\t--rxq [1,2,4]: rx queue number for each vhost device\\n\",\n \t       prgname);\n }\n \n@@ -602,6 +617,7 @@ us_vhost_parse_args(int argc, char **argv)\n \t\t{\"zero-copy\", required_argument, NULL, 0},\n \t\t{\"rx-desc-num\", required_argument, NULL, 0},\n \t\t{\"tx-desc-num\", required_argument, NULL, 0},\n+\t\t{\"rxq\", required_argument, NULL, 0},\n \t\t{NULL, 0, 0, 0},\n \t};\n \n@@ -778,6 +794,18 @@ us_vhost_parse_args(int argc, char **argv)\n \t\t\t\t}\n \t\t\t}\n \n+\t\t\t/* Specify the Rx queue number for each vhost dev. */\n+\t\t\tif (!strncmp(long_option[option_index].name,\n+\t\t\t\t\"rxq\", MAX_LONG_OPT_SZ)) {\n+\t\t\t\tret = parse_num_opt(optarg, 4);\n+\t\t\t\tif ((ret == -1) || (ret == 0) || (!POWEROF2(ret))) {\n+\t\t\t\t\tRTE_LOG(INFO, VHOST_CONFIG,\n+\t\t\t\t\t\"Valid value for rxq is [1,2,4]\\n\");\n+\t\t\t\t\tus_vhost_usage(prgname);\n+\t\t\t\t\treturn -1;\n+\t\t\t\t} else\n+\t\t\t\t\trxq = ret;\n+\t\t\t}\n \t\t\tbreak;\n \n \t\t\t/* Invalid option - print options. */\n@@ -813,6 +841,19 @@ us_vhost_parse_args(int argc, char **argv)\n \t\treturn -1;\n \t}\n \n+\tif (rxq > 1) {\n+\t\tvmdq_conf_default.rxmode.mq_mode = ETH_MQ_RX_VMDQ_RSS;\n+\t\tvmdq_conf_default.rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP |\n+\t\t\t\tETH_RSS_UDP | ETH_RSS_TCP | ETH_RSS_SCTP;\n+\t}\n+\n+\tif ((zero_copy == 1) && (rxq > 1)) {\n+\t\tRTE_LOG(INFO, VHOST_PORT,\n+\t\t\t\"Vhost zero copy doesn't support mq mode,\"\n+\t\t\t\"please specify '--rxq 1' to disable it.\\n\");\n+\t\treturn -1;\n+\t}\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "dpdk-dev",
        "v4",
        "07/12"
    ]
}