Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/200/?format=api
https://patches.dpdk.org/api/patches/200/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1408932572-10343-5-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": "<1408932572-10343-5-git-send-email-changchun.ouyang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1408932572-10343-5-git-send-email-changchun.ouyang@intel.com", "date": "2014-08-25T02:09:31", "name": "[dpdk-dev,4/5] virtio: New API to enable/disable multicast and promisc mode", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c12113c4691416852355afe4477d2d171bf395f5", "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/1408932572-10343-5-git-send-email-changchun.ouyang@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/200/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/200/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<couyang@shecgisg004.sh.intel.com>", "Received": [ "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 53DA0B37C\n\tfor <dev@dpdk.org>; Mon, 25 Aug 2014 04:06:05 +0200 (CEST)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby fmsmga101.fm.intel.com with ESMTP; 24 Aug 2014 19:09:57 -0700", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga001.fm.intel.com with ESMTP; 24 Aug 2014 19:09:49 -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 s7P29muB025053;\n\tMon, 25 Aug 2014 10:09:48 +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 s7P29jHj010472; Mon, 25 Aug 2014 10:09:47 +0800", "(from couyang@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s7P29jq3010468; \n\tMon, 25 Aug 2014 10:09:45 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.04,393,1406617200\"; d=\"scan'208\";a=\"581150029\"", "From": "Ouyang Changchun <changchun.ouyang@intel.com>", "To": "dev@dpdk.org", "Date": "Mon, 25 Aug 2014 10:09:31 +0800", "Message-Id": "<1408932572-10343-5-git-send-email-changchun.ouyang@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": "<1408932572-10343-1-git-send-email-changchun.ouyang@intel.com>", "References": "<1408932572-10343-1-git-send-email-changchun.ouyang@intel.com>", "Subject": "[dpdk-dev] [PATCH 4/5] virtio: New API to enable/disable multicast\n\tand promisc mode", "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>", "X-List-Received-Date": "Mon, 25 Aug 2014 02:06:06 -0000" }, "content": "This patch adds new API in virtio for supporting promiscuous and allmulticast enabling and disabling.\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 lib/librte_pmd_virtio/virtio_ethdev.c | 98 ++++++++++++++++++++++++++++++++++-\n 1 file changed, 97 insertions(+), 1 deletion(-)", "diff": "diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c\nindex 6293ac6..c7f874a 100644\n--- a/lib/librte_pmd_virtio/virtio_ethdev.c\n+++ b/lib/librte_pmd_virtio/virtio_ethdev.c\n@@ -66,6 +66,10 @@ static int eth_virtio_dev_init(struct eth_driver *eth_drv,\n static int virtio_dev_configure(struct rte_eth_dev *dev);\n static int virtio_dev_start(struct rte_eth_dev *dev);\n static void virtio_dev_stop(struct rte_eth_dev *dev);\n+static void virtio_dev_promiscuous_enable(struct rte_eth_dev *dev);\n+static void virtio_dev_promiscuous_disable(struct rte_eth_dev *dev);\n+static void virtio_dev_allmulticast_enable(struct rte_eth_dev *dev);\n+static void virtio_dev_allmulticast_disable(struct rte_eth_dev *dev);\n static void virtio_dev_info_get(struct rte_eth_dev *dev,\n \t\t\t\tstruct rte_eth_dev_info *dev_info);\n static int virtio_dev_link_update(struct rte_eth_dev *dev,\n@@ -403,6 +407,94 @@ virtio_dev_close(struct rte_eth_dev *dev)\n \tvirtio_dev_stop(dev);\n }\n \n+static void\n+virtio_dev_promiscuous_enable(struct rte_eth_dev *dev)\n+{\n+\tstruct virtio_hw *hw\n+\t\t= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_pmd_ctrl ctrl;\n+\tint dlen[1];\n+\tint ret;\n+\n+\tctrl.hdr.class = VIRTIO_NET_CTRL_RX;\n+\tctrl.hdr.cmd = VIRTIO_NET_CTRL_RX_PROMISC;\n+\tctrl.data[0] = 1;\n+\tdlen[0] = 1;\n+\n+\tret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);\n+\n+\tif (ret) {\n+\t\tPMD_INIT_LOG(ERR, \"Promisc enabling but send command \"\n+\t\t\t \"failed, this is too late now...\\n\");\n+\t}\n+}\n+\n+static void\n+virtio_dev_promiscuous_disable(struct rte_eth_dev *dev)\n+{\n+\tstruct virtio_hw *hw\n+\t\t= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_pmd_ctrl ctrl;\n+\tint dlen[1];\n+\tint ret;\n+\n+\tctrl.hdr.class = VIRTIO_NET_CTRL_RX;\n+\tctrl.hdr.cmd = VIRTIO_NET_CTRL_RX_PROMISC;\n+\tctrl.data[0] = 0;\n+\tdlen[0] = 1;\n+\n+\tret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);\n+\n+\tif (ret) {\n+\t\tPMD_INIT_LOG(ERR, \"Promisc disabling but send command \"\n+\t\t\t \"failed, this is too late now...\\n\");\n+\t}\n+}\n+\n+static void\n+virtio_dev_allmulticast_enable(struct rte_eth_dev *dev)\n+{\n+\tstruct virtio_hw *hw\n+\t\t= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_pmd_ctrl ctrl;\n+\tint dlen[1];\n+\tint ret;\n+\n+\tctrl.hdr.class = VIRTIO_NET_CTRL_RX;\n+\tctrl.hdr.cmd = VIRTIO_NET_CTRL_RX_ALLMULTI;\n+\tctrl.data[0] = 1;\n+\tdlen[0] = 1;\n+\n+\tret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);\n+\n+\tif (ret) {\n+\t\tPMD_INIT_LOG(ERR, \"Promisc enabling but send command \"\n+\t\t\t \"failed, this is too late now...\\n\");\n+\t}\n+}\n+\n+static void\n+virtio_dev_allmulticast_disable(struct rte_eth_dev *dev)\n+{\n+\tstruct virtio_hw *hw\n+\t\t= VIRTIO_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct virtio_pmd_ctrl ctrl;\n+\tint dlen[1];\n+\tint ret;\n+\n+\tctrl.hdr.class = VIRTIO_NET_CTRL_RX;\n+\tctrl.hdr.cmd = VIRTIO_NET_CTRL_RX_ALLMULTI;\n+\tctrl.data[0] = 0;\n+\tdlen[0] = 1;\n+\n+\tret = virtio_send_command(hw->cvq, &ctrl, dlen, 1);\n+\n+\tif (ret) {\n+\t\tPMD_INIT_LOG(ERR, \"Promisc disabling but send command \"\n+\t\t\t \"failed, this is too late now...\\n\");\n+\t}\n+}\n+\n /*\n * dev_ops for virtio, bare necessities for basic operation\n */\n@@ -411,6 +503,10 @@ static struct eth_dev_ops virtio_eth_dev_ops = {\n \t.dev_start = virtio_dev_start,\n \t.dev_stop = virtio_dev_stop,\n \t.dev_close = virtio_dev_close,\n+\t.promiscuous_enable = virtio_dev_promiscuous_enable,\n+\t.promiscuous_disable = virtio_dev_promiscuous_disable,\n+\t.allmulticast_enable = virtio_dev_allmulticast_enable,\n+\t.allmulticast_disable = virtio_dev_allmulticast_disable,\n \n \t.dev_infos_get = virtio_dev_info_get,\n \t.stats_get = virtio_dev_stats_get,\n@@ -561,7 +657,7 @@ virtio_negotiate_features(struct virtio_hw *hw)\n {\n \tuint32_t host_features, mask;\n \n-\tmask = VIRTIO_NET_F_CTRL_RX | VIRTIO_NET_F_CTRL_VLAN;\n+\tmask = VIRTIO_NET_F_CTRL_VLAN;\n \tmask |= VIRTIO_NET_F_CSUM | VIRTIO_NET_F_GUEST_CSUM;\n \n \t/* TSO and LRO are only available when their corresponding\n", "prefixes": [ "dpdk-dev", "4/5" ] }{ "id": 200, "url": "