get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 564172,
    "url": "http://patchwork.ozlabs.org/api/patches/564172/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160107064844.12239.87981.stgit@localhost.localdomain/",
    "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": "<20160107064844.12239.87981.stgit@localhost.localdomain>",
    "list_archive_url": null,
    "date": "2016-01-07T06:48:44",
    "name": "[next,1/2] ixgbe: Do not allow PF to add VLVF entry unless it actually needs it",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "c704a0044b12bb58f6467a377efa648320304948",
    "submitter": {
        "id": 67293,
        "url": "http://patchwork.ozlabs.org/api/people/67293/?format=api",
        "name": "Alexander Duyck",
        "email": "aduyck@mirantis.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/20160107064844.12239.87981.stgit@localhost.localdomain/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/564172/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/564172/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 CCF5E1402C0\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Jan 2016 17:48:49 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 2141E32D8E;\n\tThu,  7 Jan 2016 06:48:49 +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 7PDfIVg9+46O; Thu,  7 Jan 2016 06:48:47 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 935FE31356;\n\tThu,  7 Jan 2016 06:48:47 +0000 (UTC)",
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id D77B21C0866\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu,  7 Jan 2016 06:48:46 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 666988B39D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu,  7 Jan 2016 06:48:46 +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 Ryts76eKXFl8 for <intel-wired-lan@lists.osuosl.org>;\n\tThu,  7 Jan 2016 06:48:45 +0000 (UTC)",
            "from mail-pa0-f51.google.com (mail-pa0-f51.google.com\n\t[209.85.220.51])\n\tby whitealder.osuosl.org (Postfix) with ESMTPS id 7254388289\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu,  7 Jan 2016 06:48:45 +0000 (UTC)",
            "by mail-pa0-f51.google.com with SMTP id qh10so704921pab.2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 06 Jan 2016 22:48:45 -0800 (PST)",
            "from localhost.localdomain\n\t(static-50-53-29-36.bvtn.or.frontiernet.net. [50.53.29.36])\n\tby smtp.gmail.com with ESMTPSA id\n\tqj8sm8094541pac.40.2016.01.06.22.48.44\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 06 Jan 2016 22:48:45 -0800 (PST)"
        ],
        "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=mirantis.com header.i=@mirantis.com\n\theader.b=BEzEmelE; dkim-atps=neutral",
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "from auto-whitelisted by SQLgrey-1.7.6",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com;\n\ts=google; \n\th=subject:from:to:cc:date:message-id:in-reply-to:references\n\t:user-agent:mime-version:content-type:content-transfer-encoding;\n\tbh=G51E3BFVjncW6Fs2D8hED0AyaGWCjGtDvAzUIZ/WSE8=;\n\tb=BEzEmelEc6qDZDiWWrL16ecCeETXbX5VXQaYKPx14OS0WfLfOo4PiJtNFVqkgFK5oP\n\tEMNrtOdvAylUL5AXpvu7jNVdSlpEwYyLNFg3YY+CzkjXsb1G3kzV5w6rDTzcwVX5HaOb\n\t8JVEnXM1ZX4msxOJ+PhhcjO1Sx5UMbsNSlWnM=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to\n\t:references:user-agent:mime-version:content-type\n\t:content-transfer-encoding;\n\tbh=G51E3BFVjncW6Fs2D8hED0AyaGWCjGtDvAzUIZ/WSE8=;\n\tb=D58lY1Al21WGPqn06CrRNgohEnMC+MHfiCLg2HieJTsn6o2N18uSU7NolSFacJ2g6Q\n\tl3rxs83hpnLaAqBJ7tC3Z0OrNIvnWDzn9TtD1BHeyXYlwxKMFiAbnm8c0qf3RzbQNfLh\n\t4fbfYKJtnbYqj376/RKDv7jiOmfvSVSt4db6u5c+nJ2JFB9vULvwqNPCfWZli8VcJCYI\n\tAX0udbYdT4RQd5GdCExOnKDQbtxHJ6xV/mJMf26rYH0QMtsjkLSLgqoeslzpRaMxQY15\n\tfJ75Wv9Abj5mkAY70wsm1Xyl1ZDXhQrwCKH+YVYfVYRc3V3LFNTqNYnfbqcgL5jj1se+\n\tcmsw==",
        "X-Gm-Message-State": "ALoCoQk0JJFU9hkezuRVmW4VUlVz12qfvo35poMYKvVxlz32FQ8zABMZFcmI8MmbYU99jQxkmwnVgqjTGYlg2dGUDsdBrzds7w==",
        "X-Received": "by 10.66.100.135 with SMTP id\n\tey7mr150430512pab.108.1452149325588; \n\tWed, 06 Jan 2016 22:48:45 -0800 (PST)",
        "From": "Alexander Duyck <aduyck@mirantis.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Wed, 06 Jan 2016 22:48:44 -0800",
        "Message-ID": "<20160107064844.12239.87981.stgit@localhost.localdomain>",
        "In-Reply-To": "<20160107064516.12239.98349.stgit@localhost.localdomain>",
        "References": "<20160107064516.12239.98349.stgit@localhost.localdomain>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [next PATCH 1/2] ixgbe: Do not allow PF to add\n\tVLVF entry unless it actually needs it",
        "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": "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": "While doing the work on igb I realized there were a few cases where we were\nstill adding VLANs to the VLVF entries for the PF when they were not\nneeded.  This patch cleans that up so that the only time we add a PF entry\nto the VLVF is either for VLAN 0 or if the PF has requested a VLAN that a VF\nis already using.\n\nSigned-off-by: Alexander Duyck <aduyck@mirantis.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c  |    8 +++---\n drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c |   31 +++++++++++++-----------\n 2 files changed, 21 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 202691793b38..1f2b039e71bd 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -3905,7 +3905,9 @@ static int ixgbe_vlan_rx_add_vid(struct net_device *netdev,\n \tstruct ixgbe_hw *hw = &adapter->hw;\n \n \t/* add VID to filter table */\n-\thw->mac.ops.set_vfta(&adapter->hw, vid, VMDQ_P(0), true, true);\n+\tif (!vid || !(adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC))\n+\t\thw->mac.ops.set_vfta(&adapter->hw, vid, VMDQ_P(0), true, !!vid);\n+\n \tset_bit(vid, adapter->active_vlans);\n \n \treturn 0;\n@@ -3962,9 +3964,7 @@ static int ixgbe_vlan_rx_kill_vid(struct net_device *netdev,\n \tstruct ixgbe_hw *hw = &adapter->hw;\n \n \t/* remove VID from filter table */\n-\tif (adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC)\n-\t\tixgbe_update_pf_promisc_vlvf(adapter, vid);\n-\telse\n+\tif (vid && !(adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC))\n \t\thw->mac.ops.set_vfta(hw, vid, VMDQ_P(0), false, true);\n \n \tclear_bit(vid, adapter->active_vlans);\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\nindex 8025a3f93598..5edf85990a8a 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c\n@@ -589,40 +589,40 @@ static void ixgbe_clear_vmvir(struct ixgbe_adapter *adapter, u32 vf)\n static void ixgbe_clear_vf_vlans(struct ixgbe_adapter *adapter, u32 vf)\n {\n \tstruct ixgbe_hw *hw = &adapter->hw;\n-\tu32 i;\n+\tu32 vlvfb_mask, pool_mask, i;\n+\n+\t/* create mask for VF and other pools */\n+\tpool_mask = ~(1 << (VMDQ_P(0) % 32));\n+\tvlvfb_mask = 1 << (vf % 32);\n \n \t/* post increment loop, covers VLVF_ENTRIES - 1 to 0 */\n \tfor (i = IXGBE_VLVF_ENTRIES; i--;) {\n \t\tu32 bits[2], vlvfb, vid, vfta, vlvf;\n \t\tu32 word = i * 2 + vf / 32;\n-\t\tu32 mask = 1 << (vf % 32);\n+\t\tu32 mask;\n \n \t\tvlvfb = IXGBE_READ_REG(hw, IXGBE_VLVFB(word));\n \n \t\t/* if our bit isn't set we can skip it */\n-\t\tif (!(vlvfb & mask))\n+\t\tif (!(vlvfb & vlvfb_mask))\n \t\t\tcontinue;\n \n \t\t/* clear our bit from vlvfb */\n-\t\tvlvfb ^= mask;\n+\t\tvlvfb ^= vlvfb_mask;\n \n \t\t/* create 64b mask to chedk to see if we should clear VLVF */\n \t\tbits[word % 2] = vlvfb;\n \t\tbits[~word % 2] = IXGBE_READ_REG(hw, IXGBE_VLVFB(word ^ 1));\n \n-\t\t/* if promisc is enabled, PF will be present, leave VFTA */\n-\t\tif (adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC) {\n-\t\t\tbits[VMDQ_P(0) / 32] &= ~(1 << (VMDQ_P(0) % 32));\n-\n-\t\t\tif (bits[0] || bits[1])\n-\t\t\t\tgoto update_vlvfb;\n-\t\t\tgoto update_vlvf;\n-\t\t}\n-\n \t\t/* if other pools are present, just remove ourselves */\n-\t\tif (bits[0] || bits[1])\n+\t\tif (bits[(VMDQ_P(0) / 32) ^ 1] ||\n+\t\t    (bits[VMDQ_P(0) / 32] & pool_mask))\n \t\t\tgoto update_vlvfb;\n \n+\t\t/* if PF is present, leave VFTA */\n+\t\tif (bits[0] || bits[1])\n+\t\t\tgoto update_vlvf;\n+\n \t\t/* if we cannot determine VLAN just remove ourselves */\n \t\tvlvf = IXGBE_READ_REG(hw, IXGBE_VLVF(i));\n \t\tif (!vlvf)\n@@ -638,6 +638,9 @@ static void ixgbe_clear_vf_vlans(struct ixgbe_adapter *adapter, u32 vf)\n update_vlvf:\n \t\t/* clear POOL selection enable */\n \t\tIXGBE_WRITE_REG(hw, IXGBE_VLVF(i), 0);\n+\n+\t\tif (!(adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC))\n+\t\t\tvlvfb = 0;\n update_vlvfb:\n \t\t/* clear pool bits */\n \t\tIXGBE_WRITE_REG(hw, IXGBE_VLVFB(word), vlvfb);\n",
    "prefixes": [
        "next",
        "1/2"
    ]
}