get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1222,
    "url": "https://patches.dpdk.org/api/patches/1222/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415420776-4821-6-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": "<1415420776-4821-6-git-send-email-changchun.ouyang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415420776-4821-6-git-send-email-changchun.ouyang@intel.com",
    "date": "2014-11-08T04:26:16",
    "name": "[dpdk-dev,v4,5/5] vhost: Enable promisc mode and multicast",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "7eec80a497839b8fedd7fcd0d1d634685377855d",
    "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/1415420776-4821-6-git-send-email-changchun.ouyang@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1222/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1222/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 9BD4F7F71;\n\tSat,  8 Nov 2014 05:17:08 +0100 (CET)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id 27875590B\n\tfor <dev@dpdk.org>; Sat,  8 Nov 2014 05:17:00 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga103.jf.intel.com with ESMTP; 07 Nov 2014 20:24:24 -0800",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga002.jf.intel.com with ESMTP; 07 Nov 2014 20:26:34 -0800",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id sA84QWIM020946;\n\tSat, 8 Nov 2014 12:26:32 +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 sA84QUQI004889; Sat, 8 Nov 2014 12:26:32 +0800",
            "(from couyang@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id sA84QUcl004885; \n\tSat, 8 Nov 2014 12:26:30 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.07,336,1413270000\"; d=\"scan'208\";a=\"633676987\"",
        "From": "Ouyang Changchun <changchun.ouyang@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Sat,  8 Nov 2014 12:26:16 +0800",
        "Message-Id": "<1415420776-4821-6-git-send-email-changchun.ouyang@intel.com>",
        "X-Mailer": "git-send-email 1.7.12.2",
        "In-Reply-To": "<1415420776-4821-1-git-send-email-changchun.ouyang@intel.com>",
        "References": "<1414732757-7241-1-git-send-email-changchun.ouyang@intel.com>\n\t<1415420776-4821-1-git-send-email-changchun.ouyang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 5/5] vhost: Enable promisc mode and multicast",
        "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": "This is to enable user space vhost receiving and forwarding broadcast and multicast packets: Use new option in command line to enable promisc mode; Enable 2 bits in VMDQ RX mode: ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST.\n\nSigned-off-by: Changchun Ouyang <changchun.ouyang@intel.com>\n---\n examples/vhost/main.c         | 24 +++++++++++++++++++++---\n lib/librte_vhost/virtio-net.c |  3 ++-\n 2 files changed, 23 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/examples/vhost/main.c b/examples/vhost/main.c\nindex a93f7a0..1f1edbe 100644\n--- a/examples/vhost/main.c\n+++ b/examples/vhost/main.c\n@@ -161,6 +161,9 @@\n /* mask of enabled ports */\n static uint32_t enabled_port_mask = 0;\n \n+/* Promiscuous mode */\n+static uint32_t promiscuous;\n+\n /*Number of switching cores enabled*/\n static uint32_t num_switching_cores = 0;\n \n@@ -364,13 +367,15 @@ static inline int\n get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_devices)\n {\n \tstruct rte_eth_vmdq_rx_conf conf;\n+\tstruct rte_eth_vmdq_rx_conf *def_conf =\n+\t\t&vmdq_conf_default.rx_adv_conf.vmdq_rx_conf;\n \tunsigned i;\n \n \tmemset(&conf, 0, sizeof(conf));\n \tconf.nb_queue_pools = (enum rte_eth_nb_pools)num_devices;\n \tconf.nb_pool_maps = num_devices;\n-\tconf.enable_loop_back =\n-\t\tvmdq_conf_default.rx_adv_conf.vmdq_rx_conf.enable_loop_back;\n+\tconf.enable_loop_back = def_conf->enable_loop_back;\n+\tconf.rx_mode = def_conf->rx_mode;\n \n \tfor (i = 0; i < conf.nb_pool_maps; i++) {\n \t\tconf.pool_map[i].vlan_id = vlan_tags[ i ];\n@@ -468,6 +473,9 @@ port_init(uint8_t port)\n \t\treturn retval;\n \t}\n \n+\tif (promiscuous)\n+\t\trte_eth_promiscuous_enable(port);\n+\n \trte_eth_macaddr_get(port, &vmdq_ports_eth_addr[port]);\n \tRTE_LOG(INFO, VHOST_PORT, \"Max virtio devices supported: %u\\n\", num_devices);\n \tRTE_LOG(INFO, VHOST_PORT, \"Port %u MAC: %02\"PRIx8\" %02\"PRIx8\" %02\"PRIx8\n@@ -598,7 +606,8 @@ us_vhost_parse_args(int argc, char **argv)\n \t};\n \n \t/* Parse command line */\n-\twhile ((opt = getopt_long(argc, argv, \"p:\",long_option, &option_index)) != EOF) {\n+\twhile ((opt = getopt_long(argc, argv, \"p:P\",\n+\t\t\tlong_option, &option_index)) != EOF) {\n \t\tswitch (opt) {\n \t\t/* Portmask */\n \t\tcase 'p':\n@@ -610,6 +619,15 @@ us_vhost_parse_args(int argc, char **argv)\n \t\t\t}\n \t\t\tbreak;\n \n+\t\tcase 'P':\n+\t\t\tpromiscuous = 1;\n+\t\t\tvmdq_conf_default.rx_adv_conf.vmdq_rx_conf.rx_mode =\n+\t\t\t\tETH_VMDQ_ACCEPT_BROADCAST |\n+\t\t\t\tETH_VMDQ_ACCEPT_MULTICAST;\n+\t\t\trte_vhost_feature_enable(1ULL << VIRTIO_NET_F_CTRL_RX);\n+\n+\t\t\tbreak;\n+\n \t\tcase 0:\n \t\t\t/* Enable/disable vm2vm comms. */\n \t\t\tif (!strncmp(long_option[option_index].name, \"vm2vm\",\ndiff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c\nindex 6d8de09..852b6d1 100644\n--- a/lib/librte_vhost/virtio-net.c\n+++ b/lib/librte_vhost/virtio-net.c\n@@ -68,7 +68,8 @@ static struct virtio_net_device_ops const *notify_ops;\n static struct virtio_net_config_ll *ll_root;\n \n /* Features supported by this lib. */\n-#define VHOST_SUPPORTED_FEATURES (1ULL << VIRTIO_NET_F_MRG_RXBUF)\n+#define VHOST_SUPPORTED_FEATURES ((1ULL << VIRTIO_NET_F_MRG_RXBUF) | \\\n+\t\t\t\t  (1ULL << VIRTIO_NET_F_CTRL_RX))\n static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES;\n \n /* Line size for reading maps file. */\n",
    "prefixes": [
        "dpdk-dev",
        "v4",
        "5/5"
    ]
}