Show a patch.

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

{
    "id": 198,
    "url": "http://patches.dpdk.org/api/patches/198/",
    "web_url": "http://patches.dpdk.org/patch/198/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1408932572-10343-4-git-send-email-changchun.ouyang@intel.com>",
    "date": "2014-08-25T02:09:30",
    "name": "[dpdk-dev,3/5] examples/vhost: enable promisc mode and config VMDQ offload register for multicast feature",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4f3a3379e2686e964343aee9f7369ca111f12209",
    "submitter": {
        "id": 31,
        "url": "http://patches.dpdk.org/api/people/31/",
        "name": "Ouyang Changchun",
        "email": "changchun.ouyang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/198/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/198/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/198/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<couyang@shecgisg004.sh.intel.com>",
        "References": "<1408932572-10343-1-git-send-email-changchun.ouyang@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,393,1406617200\"; d=\"scan'208\";a=\"562892707\"",
        "From": "Ouyang Changchun <changchun.ouyang@intel.com>",
        "X-List-Received-Date": "Mon, 25 Aug 2014 02:05:57 -0000",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1408932572-10343-4-git-send-email-changchun.ouyang@intel.com>",
        "Received": [
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 8608BB376\n\tfor <dev@dpdk.org>; Mon, 25 Aug 2014 04:05:56 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP; 24 Aug 2014 19:03:51 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga001.jf.intel.com with ESMTP; 24 Aug 2014 19:09:47 -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 s7P29jVZ025048;\n\tMon, 25 Aug 2014 10:09:45 +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 s7P29hah010465; Mon, 25 Aug 2014 10:09:45 +0800",
            "(from couyang@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s7P29gJA010461; \n\tMon, 25 Aug 2014 10:09:42 +0800"
        ],
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Precedence": "list",
        "Date": "Mon, 25 Aug 2014 10:09:30 +0800",
        "Subject": "[dpdk-dev] [PATCH 3/5] examples/vhost: enable promisc mode and\n\tconfig VMDQ offload register for multicast feature",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-ExtLoop1": "1",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "In-Reply-To": "<1408932572-10343-1-git-send-email-changchun.ouyang@intel.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org"
    },
    "content": "This patch is to let vhost receive and forward multicast and broadcast packets,\nadd promiscuous option into command line; and set VMDQ RX mode as:\nETH_VMDQ_ACCEPT_BROADCAST|ETH_VMDQ_ACCEPT_MULTICAST if promisc mode is on.\n\nSigned-off-by: Changchun Ouyang <changchun.ouyang@intel.com>\nAcked-by: Huawei Xie <huawei.xie@intel.com>\nAcked-by: Cunming Liang <cunming.liang@intel.com>\n\n---\n examples/vhost/main.c | 27 +++++++++++++++++++++++----\n 1 file changed, 23 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/examples/vhost/main.c b/examples/vhost/main.c\nindex 193aa25..4acc7b8 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+/* Ports set in promiscuous mode off by default. */\n+static uint32_t promiscuous_on;\n+\n /*Number of switching cores enabled*/\n static uint32_t num_switching_cores = 0;\n \n@@ -278,6 +281,7 @@ static struct rte_eth_conf vmdq_conf_default = {\n \t\t\t.enable_default_pool = 0,\n \t\t\t.default_pool = 0,\n \t\t\t.nb_pool_maps = 0,\n+\t\t\t.rx_mode = 0,\n \t\t\t.pool_map = {{0, 0},},\n \t\t},\n \t},\n@@ -368,13 +372,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@@ -472,6 +478,9 @@ port_init(uint8_t port)\n \t\treturn retval;\n \t}\n \n+\tif (promiscuous_on)\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@@ -604,7 +613,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@@ -616,6 +626,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_on = 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\tVHOST_FEATURES |= (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\",\n@@ -677,7 +696,7 @@ us_vhost_parse_args(int argc, char **argv)\n \t\t\t\t\treturn -1;\n \t\t\t\t} else {\n \t\t\t\t\tif (ret)\n-\t\t\t\t\t\tVHOST_FEATURES = (1ULL << VIRTIO_NET_F_MRG_RXBUF);\n+\t\t\t\t\t\tVHOST_FEATURES |= (1ULL << VIRTIO_NET_F_MRG_RXBUF);\n \t\t\t\t}\n \t\t\t}\n \n",
    "prefixes": [
        "dpdk-dev",
        "3/5"
    ]
}