Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1223/?format=api
https://patches.dpdk.org/api/patches/1223/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415420776-4821-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": "<1415420776-4821-5-git-send-email-changchun.ouyang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1415420776-4821-5-git-send-email-changchun.ouyang@intel.com", "date": "2014-11-08T04:26:15", "name": "[dpdk-dev,v4,4/5] virtio: Support promiscuous and allmulticast", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "bfa51c7a1074d2153a345f337d2f4147c0f33cd1", "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-5-git-send-email-changchun.ouyang@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/1223/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/1223/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 6F3E27F49;\n\tSat, 8 Nov 2014 05:17:28 +0100 (CET)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 94505591A\n\tfor <dev@dpdk.org>; Sat, 8 Nov 2014 05:17:14 +0100 (CET)", "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga102.fm.intel.com with ESMTP; 07 Nov 2014 20:26:33 -0800", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby fmsmga002.fm.intel.com with ESMTP; 07 Nov 2014 20:26:32 -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 sA84QU9R020940;\n\tSat, 8 Nov 2014 12:26:30 +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 sA84QSVf004882; Sat, 8 Nov 2014 12:26:30 +0800", "(from couyang@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id sA84QS6m004878; \n\tSat, 8 Nov 2014 12:26:28 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.07,336,1413270000\"; d=\"scan'208\";a=\"628732381\"", "From": "Ouyang Changchun <changchun.ouyang@intel.com>", "To": "dev@dpdk.org", "Date": "Sat, 8 Nov 2014 12:26:15 +0800", "Message-Id": "<1415420776-4821-5-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 4/5] virtio: Support promiscuous and\n\tallmulticast", "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": "Add codes for supporting promiscuous and allmulticast enable and disable.\n\nSigned-off-by: Changchun Ouyang <changchun.ouyang@intel.com>\n---\n lib/librte_pmd_virtio/virtio_ethdev.c | 90 ++++++++++++++++++++++++++++++++++-\n 1 file changed, 89 insertions(+), 1 deletion(-)", "diff": "diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c\nindex 19930c0..c009f2a 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,86 @@ 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, \"Failed to enable promisc\");\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, \"Failed to disable promisc\");\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, \"Failed to enable allmulticast\");\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, \"Failed to disable allmulticast\");\n+}\n+\n /*\n * dev_ops for virtio, bare necessities for basic operation\n */\n@@ -411,6 +495,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 +649,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", "v4", "4/5" ] }{ "id": 1223, "url": "