Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2529/?format=api
https://patches.dpdk.org/api/patches/2529/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1422326164-13697-14-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": "<1422326164-13697-14-git-send-email-changchun.ouyang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1422326164-13697-14-git-send-email-changchun.ouyang@intel.com", "date": "2015-01-27T02:35:53", "name": "[dpdk-dev,v2,13/24] virtio: Add support for vlan filtering", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "71f200445c3b7de64d694e20faad6403d0b01f68", "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/1422326164-13697-14-git-send-email-changchun.ouyang@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/2529/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/2529/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 7D5C85AD9;\n\tTue, 27 Jan 2015 03:38:05 +0100 (CET)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 4B83E5AA1\n\tfor <dev@dpdk.org>; Tue, 27 Jan 2015 03:36:52 +0100 (CET)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga102.fm.intel.com with ESMTP; 26 Jan 2015 18:36:43 -0800", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby FMSMGA003.fm.intel.com with ESMTP; 26 Jan 2015 18:23:01 -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 t0R2adNm015439;\n\tTue, 27 Jan 2015 10:36:39 +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 t0R2aanW013821; Tue, 27 Jan 2015 10:36:38 +0800", "(from couyang@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t0R2aavY013817; \n\tTue, 27 Jan 2015 10:36:36 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"4.97,862,1389772800\"; d=\"scan'208\";a=\"445541589\"", "From": "Ouyang Changchun <changchun.ouyang@intel.com>", "To": "dev@dpdk.org", "Date": "Tue, 27 Jan 2015 10:35:53 +0800", "Message-Id": "<1422326164-13697-14-git-send-email-changchun.ouyang@intel.com>", "X-Mailer": "git-send-email 1.7.12.2", "In-Reply-To": "<1422326164-13697-1-git-send-email-changchun.ouyang@intel.com>", "References": "<1421298930-15210-1-git-send-email-changchun.ouyang@intel.com>\n\t<1422326164-13697-1-git-send-email-changchun.ouyang@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 13/24] virtio: Add support for vlan filtering", "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": "Virtio supports vlan filtering.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\nSigned-off-by: Changchun Ouyang <changchun.ouyang@intel.com>\n---\n lib/librte_pmd_virtio/virtio_ethdev.c | 31 +++++++++++++++++++++++++++++--\n 1 file changed, 29 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/virtio_ethdev.c\nindex 39b1fb4..591d692 100644\n--- a/lib/librte_pmd_virtio/virtio_ethdev.c\n+++ b/lib/librte_pmd_virtio/virtio_ethdev.c\n@@ -84,6 +84,8 @@ static void virtio_dev_tx_queue_release(__rte_unused void *txq);\n static void virtio_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats);\n static void virtio_dev_stats_reset(struct rte_eth_dev *dev);\n static void virtio_dev_free_mbufs(struct rte_eth_dev *dev);\n+static int virtio_vlan_filter_set(struct rte_eth_dev *dev,\n+\t\t\t\tuint16_t vlan_id, int on);\n \n static int virtio_dev_queue_stats_mapping_set(\n \t__rte_unused struct rte_eth_dev *eth_dev,\n@@ -511,6 +513,7 @@ static struct eth_dev_ops virtio_eth_dev_ops = {\n \t.tx_queue_release = virtio_dev_tx_queue_release,\n \t/* collect stats per queue */\n \t.queue_stats_mapping_set = virtio_dev_queue_stats_mapping_set,\n+\t.vlan_filter_set = virtio_vlan_filter_set,\n };\n \n static inline int\n@@ -640,14 +643,31 @@ virtio_get_hwaddr(struct virtio_hw *hw)\n \t}\n }\n \n+static int\n+virtio_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)\n+{\n+\tstruct virtio_hw *hw = dev->data->dev_private;\n+\tstruct virtio_pmd_ctrl ctrl;\n+\tint len;\n+\n+\tif (!vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_VLAN))\n+\t\treturn -ENOTSUP;\n+\n+\tctrl.hdr.class = VIRTIO_NET_CTRL_VLAN;\n+\tctrl.hdr.cmd = on ? VIRTIO_NET_CTRL_VLAN_ADD : VIRTIO_NET_CTRL_VLAN_DEL;\n+\tmemcpy(ctrl.data, &vlan_id, sizeof(vlan_id));\n+\tlen = sizeof(vlan_id);\n+\n+\treturn virtio_send_command(hw->cvq, &ctrl, &len, 1);\n+}\n \n static void\n virtio_negotiate_features(struct virtio_hw *hw)\n {\n \tuint32_t host_features, mask;\n \n-\tmask = VIRTIO_NET_F_CTRL_VLAN;\n-\tmask |= VIRTIO_NET_F_CSUM | VIRTIO_NET_F_GUEST_CSUM;\n+\t/* checksum offload not implemented */\n+\tmask = VIRTIO_NET_F_CSUM | VIRTIO_NET_F_GUEST_CSUM;\n \n \t/* TSO and LRO are only available when their corresponding\n \t * checksum offload feature is also negotiated.\n@@ -1058,6 +1078,13 @@ virtio_dev_configure(struct rte_eth_dev *dev)\n \n \thw->vlan_strip = rxmode->hw_vlan_strip;\n \n+\tif (rxmode->hw_vlan_filter\n+\t && !vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_VLAN)) {\n+\t\tPMD_DRV_LOG(NOTICE,\n+\t\t\t \"vlan filtering not available on this host\");\n+\t\treturn -ENOTSUP;\n+\t}\n+\n \tif (vtpci_irq_config(hw, 0) == VIRTIO_MSI_NO_VECTOR) {\n \t\tPMD_DRV_LOG(ERR, \"failed to set config vector\");\n \t\treturn -EBUSY;\n", "prefixes": [ "dpdk-dev", "v2", "13/24" ] }{ "id": 2529, "url": "