Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/574006/?format=api
{ "id": 574006, "url": "http://patchwork.ozlabs.org/api/patches/574006/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1453901284-32628-1-git-send-email-vinschen@redhat.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1453901284-32628-1-git-send-email-vinschen@redhat.com>", "list_archive_url": null, "date": "2016-01-27T13:28:04", "name": "igb: Fix VLAN tag stripping on Intel i350", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "40a38ddb19ba45585cab66d88436fd2ecc30faf8", "submitter": { "id": 7921, "url": "http://patchwork.ozlabs.org/api/people/7921/?format=api", "name": "Corinna Vinschen", "email": "vinschen@redhat.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1453901284-32628-1-git-send-email-vinschen@redhat.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/574006/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/574006/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Received": [ "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ozlabs.org (Postfix) with ESMTP id 1B7BB140BED\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Jan 2016 00:58:28 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id D5B6431F01;\n\tWed, 27 Jan 2016 13:58:27 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id TMUE0uj1HVyX; Wed, 27 Jan 2016 13:58:26 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 0A80331777;\n\tWed, 27 Jan 2016 13:58:26 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 0ACEC1C1730\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Jan 2016 13:58:24 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 014B08A1AA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Jan 2016 13:58:24 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id YNlNTdQ2BlkJ for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Jan 2016 13:58:22 +0000 (UTC)", "from mail-n.franken.de (mail-n.franken.de [193.175.24.27])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id C7913898AF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 27 Jan 2016 13:58:21 +0000 (UTC)", "from aqua.hirmke.de (aquarius.franken.de [193.175.24.89])\n\t(Authenticated sender: aquarius)\n\tby mail-n.franken.de (Postfix) with ESMTP id 05D921C0C069D;\n\tWed, 27 Jan 2016 14:28:06 +0100 (CET)", "from calimero.vinschen.de (calimero.vinschen.de [192.168.129.6])\n\tby aqua.hirmke.de (Postfix) with ESMTP id 0685F5E037D;\n\tWed, 27 Jan 2016 14:28:05 +0100 (CET)", "by calimero.vinschen.de (Postfix, from userid 500)\n\tid EC33DA80452; Wed, 27 Jan 2016 14:28:04 +0100 (CET)" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "delayed 00:30:12 by SQLgrey-1.7.6", "From": "Corinna Vinschen <vinschen@redhat.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 27 Jan 2016 14:28:04 +0100", "Message-Id": "<1453901284-32628-1-git-send-email-vinschen@redhat.com>", "X-Mailer": "git-send-email 2.5.0", "Cc": "netdev@vger.kernel.org", "Subject": "[Intel-wired-lan] [PATCH] igb: Fix VLAN tag stripping on Intel i350", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "Problem: When switching off VLAN offloading on an i350, the VLAN\ninterface gets unusable. For testing, set up a VLAN on an i350\nand some remote machine, e.g.:\n\n $ ip link add link eth0 name eth0.42 type vlan id 42\n $ ip addr add 192.168.42.1/24 dev eth0.42\n $ ip link set dev eth0.42 up\n\nOffloading is switched on by default:\n\n $ ethtool -k eth0 | grep vlan-offload\n rx-vlan-offload: on\n tx-vlan-offload: on\n\n $ ping -c 3 -I eth0.42 192.168.42.2\n [...works as usual...]\n\nNow switch off VLAN offloading and try again:\n\n $ ethtool -K eth0 rxvlan off\n Actual changes:\n rx-vlan-offload: off\n tx-vlan-offload: off [requested on]\n $ ping -c 3 -I eth0.42 192.168.42.2\n PING 192.168.42.2 (192.168.42.2) from 192.168.42.1 eth0.42: 56(84) bytes of data.\n\n --- 192.168.42.2 ping statistics ---\n 3 packets transmitted, 0 received, 100% packet loss, time 1999ms\n\nI can only reproduce it on an i350, the above works fine on a 82580.\n\nWhile inspecting the igb source, I came across the code in igb_set_vmolr\nwhich sets the E1000_VMOLR_STRVLAN/E1000_DVMOLR_STRVLAN flags once and\nfor all, and in all of the igb code there's no other place where the\nSTRVLAN is set or cleared. Thus, VLAN stripping is enabled in igb\nunconditionally, independently of the offloading setting.\n\nI compared that to the latest Intel igb-5.3.3.5 driver from\nhttp://sourceforge.net/projects/e1000/ which in fact sets and clears the\nSTRVLAN flag independently from igb_set_vmolr in its own function\nigb_set_vf_vlan_strip, depending on the vlan settings.\n\nSo I included the STRVLAN handling from the igb-5.3.3.5 driver into our\ncurrent igb driver and tested the above scenario again. This time ping\nstill works after switching off VLAN offloading.\n\nTested on i350, with and without addtional VFs, as well as on 82580\nsuccessfully.\n\nSigned-off-by: Corinna Vinschen <vinschen@redhat.com>\n---\n drivers/net/ethernet/intel/igb/igb_main.c | 39 ++++++++++++++++++++++++-------\n 1 file changed, 31 insertions(+), 8 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex 31e5f39..afd3990 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -3580,6 +3580,28 @@ static void igb_rlpml_set(struct igb_adapter *adapter)\n \twr32(E1000_RLPML, max_frame_size);\n }\n \n+static inline void igb_set_vf_vlan_strip(struct igb_adapter *adapter,\n+\t\t\t\t\t int vfn, bool enable)\n+{\n+\tstruct e1000_hw *hw = &adapter->hw;\n+\tu32 val, reg;\n+\n+\tif (hw->mac.type < e1000_82576)\n+\t\treturn;\n+\n+\tif (hw->mac.type == e1000_i350)\n+\t\treg = E1000_DVMOLR(vfn);\n+\telse\n+\t\treg = E1000_VMOLR(vfn);\n+\n+\tval = rd32(reg);\n+\tif (enable)\n+\t\tval |= E1000_VMOLR_STRVLAN;\n+\telse\n+\t\tval &= ~(E1000_VMOLR_STRVLAN);\n+\twr32(reg, val);\n+}\n+\n static inline void igb_set_vmolr(struct igb_adapter *adapter,\n \t\t\t\t int vfn, bool aupe)\n {\n@@ -3593,14 +3615,6 @@ static inline void igb_set_vmolr(struct igb_adapter *adapter,\n \t\treturn;\n \n \tvmolr = rd32(E1000_VMOLR(vfn));\n-\tvmolr |= E1000_VMOLR_STRVLAN; /* Strip vlan tags */\n-\tif (hw->mac.type == e1000_i350) {\n-\t\tu32 dvmolr;\n-\n-\t\tdvmolr = rd32(E1000_DVMOLR(vfn));\n-\t\tdvmolr |= E1000_DVMOLR_STRVLAN;\n-\t\twr32(E1000_DVMOLR(vfn), dvmolr);\n-\t}\n \tif (aupe)\n \t\tvmolr |= E1000_VMOLR_AUPE; /* Accept untagged packets */\n \telse\n@@ -5937,6 +5951,7 @@ static int igb_ndo_set_vf_vlan(struct net_device *netdev,\n \t\t\tgoto out;\n \t\tigb_set_vmvir(adapter, vlan | (qos << VLAN_PRIO_SHIFT), vf);\n \t\tigb_set_vmolr(adapter, vf, !vlan);\n+\t\tigb_set_vf_vlan_strip(adapter, vf, true);\n \t\tadapter->vf_data[vf].pf_vlan = vlan;\n \t\tadapter->vf_data[vf].pf_qos = qos;\n \t\tdev_info(&adapter->pdev->dev,\n@@ -5952,6 +5967,7 @@ static int igb_ndo_set_vf_vlan(struct net_device *netdev,\n \t\t\t false, vf);\n \t\tigb_set_vmvir(adapter, vlan, vf);\n \t\tigb_set_vmolr(adapter, vf, true);\n+\t\tigb_set_vf_vlan_strip(adapter, vf, false);\n \t\tadapter->vf_data[vf].pf_vlan = 0;\n \t\tadapter->vf_data[vf].pf_qos = 0;\n \t}\n@@ -5986,6 +6002,11 @@ static int igb_set_vf_vlan(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)\n \tint vid = (msgbuf[1] & E1000_VLVF_VLANID_MASK);\n \tint err = 0;\n \n+\tif (vid)\n+\t\tigb_set_vf_vlan_strip(adapter, vf, true);\n+\telse\n+\t\tigb_set_vf_vlan_strip(adapter, vf, false);\n+\n \t/* If in promiscuous mode we need to make sure the PF also has\n \t * the VLAN filter set.\n \t */\n@@ -7202,6 +7223,8 @@ static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features)\n \t\twr32(E1000_CTRL, ctrl);\n \t}\n \n+\tigb_set_vf_vlan_strip(adapter, adapter->vfs_allocated_count, enable);\n+\n \tigb_rlpml_set(adapter);\n }\n \n", "prefixes": [] }