get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 574681,
    "url": "http://patchwork.ozlabs.org/api/patches/574681/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160128125323.GA17357@calimero.vinschen.de/",
    "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": "<20160128125323.GA17357@calimero.vinschen.de>",
    "list_archive_url": null,
    "date": "2016-01-28T12:53:23",
    "name": "igb: Fix VLAN tag stripping on Intel i350",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0fda8fae0d6a33e3983482ce3cdbf05e20f4a67e",
    "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/20160128125323.GA17357@calimero.vinschen.de/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/574681/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/574681/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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ozlabs.org (Postfix) with ESMTP id C2E31140BCE\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Jan 2016 23:53:32 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 390B48C438;\n\tThu, 28 Jan 2016 12:53:30 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id aoVgP7bpf4aM; Thu, 28 Jan 2016 12:53:29 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 35D6E8C37C;\n\tThu, 28 Jan 2016 12:53:29 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id 5DD751C11FD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 28 Jan 2016 12:53:29 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id C60BB8C451\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 28 Jan 2016 12:53:27 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id YBNc+lDCjGrh for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 28 Jan 2016 12:53:24 +0000 (UTC)",
            "from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 0CF738C37C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 28 Jan 2016 12:53:23 +0000 (UTC)",
            "from int-mx14.intmail.prod.int.phx2.redhat.com\n\t(int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27])\n\tby mx1.redhat.com (Postfix) with ESMTPS id E9F9A8F4ED;\n\tThu, 28 Jan 2016 12:53:24 +0000 (UTC)",
            "from calimero.vinschen.de (ovpn-116-101.ams2.redhat.com\n\t[10.36.116.101])\n\tby int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with\n\tESMTP id u0SCrOlR027872; Thu, 28 Jan 2016 07:53:24 -0500",
            "by calimero.vinschen.de (Postfix, from userid 500)\n\tid A7403A8049B; Thu, 28 Jan 2016 13:53:23 +0100 (CET)"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "Date": "Thu, 28 Jan 2016 13:53:23 +0100",
        "From": "Corinna Vinschen <vinschen@redhat.com>",
        "To": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>",
        "Message-ID": "<20160128125323.GA17357@calimero.vinschen.de>",
        "Mail-Followup-To": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>,\n\tintel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org",
        "References": "<1453901284-32628-1-git-send-email-vinschen@redhat.com>\n\t<1453922722.3014.29.camel@intel.com>",
        "MIME-Version": "1.0",
        "In-Reply-To": "<1453922722.3014.29.camel@intel.com>",
        "User-Agent": "Mutt/1.5.24 (2015-08-30)",
        "X-Scanned-By": "MIMEDefang 2.68 on 10.5.11.27",
        "Cc": "netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org",
        "Subject": "Re: [Intel-wired-lan] [PATCH] igb: Fix VLAN tag stripping on Intel\n\ti350",
        "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>",
        "Content-Type": "multipart/mixed;\n\tboundary=\"===============2790921169046580159==\"",
        "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>"
    },
    "content": "Hi Jeff,\n\nOn Jan 27 11:25, Jeff Kirsher wrote:\n> On Wed, 2016-01-27 at 14:28 +0100, Corinna Vinschen wrote:\n> > Problem: When switching off VLAN offloading on an i350, the VLAN\n> > interface gets unusable.  For testing, set up a VLAN on an i350\n> > and some remote machine, e.g.:\n> > [...]\n> I tried applying your patch to my tree for review and validation, but\n> due to patches already applied against the igb driver in my tree, your\n> patch does not apply cleanly.\n> \n> Can you please update your patch to apply cleanly to my tree?\n> git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue.git\n> dev-queue\n> \n> (next-queue tree and dev-queue branch)\n\nThe attached patch is against the dev-queue branch of your next-queue tree.\n\nI retested again using an i350 as well as a 82580.  On the i350 I tested\nadditionally adding and removing VFs while offloading was switched on or\noff, and it worked as desired.\n\nI'm just a bit unsure about the correctness of the igb_set_vf_vlan_strip\ncall from igb_vf_reset.  I think it's the right thing to do since\nresetting the VF requires to reevaluate the STRVLAN flag.  I'd feel\nbetter if you could double check, though.\n\n\nThanks,\nCorinna\nFrom ab27415c3d3be2beb978316007f84fb54d12b619 Mon Sep 17 00:00:00 2001\nFrom: Corinna Vinschen <vinschen@redhat.com>\nDate: Thu, 28 Jan 2016 13:31:11 +0100\nSubject: [PATCH] igb: Fix VLAN tag stripping on Intel i350\n\nProblem: 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 da\nta.\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 | 41 ++++++++++++++++++++++++-------\n 1 file changed, 32 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex 95d6042..c414e41 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -3699,6 +3699,28 @@ static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,\n \treturn 0;\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@@ -3712,14 +3734,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@@ -6217,6 +6231,7 @@ static int igb_enable_port_vlan(struct igb_adapter *adapter, int vf,\n \n \tadapter->vf_data[vf].pf_vlan = vlan;\n \tadapter->vf_data[vf].pf_qos = qos;\n+\tigb_set_vf_vlan_strip(adapter, vf, true);\n \tdev_info(&adapter->pdev->dev,\n \t\t \"Setting VLAN %d, QOS 0x%x on VF %d\\n\", vlan, qos, vf);\n \tif (test_bit(__IGB_DOWN, &adapter->state)) {\n@@ -6244,6 +6259,7 @@ static int igb_disable_port_vlan(struct igb_adapter *adapter, int vf)\n \n \tadapter->vf_data[vf].pf_vlan = 0;\n \tadapter->vf_data[vf].pf_qos = 0;\n+\tigb_set_vf_vlan_strip(adapter, vf, false);\n \n \treturn 0;\n }\n@@ -6264,6 +6280,7 @@ static int igb_set_vf_vlan_msg(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)\n {\n \tint add = (msgbuf[0] & E1000_VT_MSGINFO_MASK) >> E1000_VT_MSGINFO_SHIFT;\n \tint vid = (msgbuf[1] & E1000_VLVF_VLANID_MASK);\n+\tint ret;\n \n \tif (adapter->vf_data[vf].pf_vlan)\n \t\treturn -1;\n@@ -6272,7 +6289,10 @@ static int igb_set_vf_vlan_msg(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)\n \tif (!vid && !add)\n \t\treturn 0;\n \n-\treturn igb_set_vf_vlan(adapter, vid, !!add, vf);\n+\tret = igb_set_vf_vlan(adapter, vid, !!add, vf);\n+\tif (!ret)\n+\t\tigb_set_vf_vlan_strip(adapter, vf, !!vid);\n+\treturn ret;\n }\n \n static inline void igb_vf_reset(struct igb_adapter *adapter, u32 vf)\n@@ -6289,6 +6309,7 @@ static inline void igb_vf_reset(struct igb_adapter *adapter, u32 vf)\n \tigb_set_vmvir(adapter, vf_data->pf_vlan |\n \t\t\t       (vf_data->pf_qos << VLAN_PRIO_SHIFT), vf);\n \tigb_set_vmolr(adapter, vf, !vf_data->pf_vlan);\n+\tigb_set_vf_vlan_strip(adapter, vf, !!(vf_data->pf_vlan));\n \n \t/* reset multicast table array for vf */\n \tadapter->vf_data[vf].num_vf_mc_hashes = 0;\n@@ -7449,6 +7470,8 @@ static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features)\n \t\tctrl &= ~E1000_CTRL_VME;\n \t\twr32(E1000_CTRL, ctrl);\n \t}\n+\n+\tigb_set_vf_vlan_strip(adapter, adapter->vfs_allocated_count, enable);\n }\n \n static int igb_vlan_rx_add_vid(struct net_device *netdev,\n",
    "prefixes": []
}