get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1276083,
    "url": "http://patchwork.ozlabs.org/api/patches/1276083/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200424011119.98746-1-andre.guedes@intel.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": "<20200424011119.98746-1-andre.guedes@intel.com>",
    "list_archive_url": null,
    "date": "2020-04-24T01:11:19",
    "name": "[v2,4/4] igc: Refactor VLAN priority filtering code",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0447646e4ac2042dde62b08b39fcec7eb0cd635d",
    "submitter": {
        "id": 72323,
        "url": "http://patchwork.ozlabs.org/api/people/72323/?format=api",
        "name": "Andre Guedes",
        "email": "andre.guedes@intel.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/20200424011119.98746-1-andre.guedes@intel.com/mbox/",
    "series": [
        {
            "id": 172367,
            "url": "http://patchwork.ozlabs.org/api/series/172367/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=172367",
            "date": "2020-04-24T01:11:19",
            "name": null,
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/172367/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1276083/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1276083/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@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"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=140.211.166.137; helo=fraxinus.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=<UNKNOWN>)",
            "ozlabs.org;\n dmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 497bkL3Pzqz9sSG\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 24 Apr 2020 11:12:23 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 86D8286EBA;\n\tFri, 24 Apr 2020 01:12:21 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id BBeQLzlYsSPm; Fri, 24 Apr 2020 01:12:20 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 7A4E886E4C;\n\tFri, 24 Apr 2020 01:12:20 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n by ash.osuosl.org (Postfix) with ESMTP id 978151BF3D0\n for <intel-wired-lan@lists.osuosl.org>; Fri, 24 Apr 2020 01:12:18 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by hemlock.osuosl.org (Postfix) with ESMTP id 84BEC8867E\n for <intel-wired-lan@lists.osuosl.org>; Fri, 24 Apr 2020 01:12:18 +0000 (UTC)",
            "from hemlock.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id 74PDvMoa9WvK for <intel-wired-lan@lists.osuosl.org>;\n Fri, 24 Apr 2020 01:12:17 +0000 (UTC)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by hemlock.osuosl.org (Postfix) with ESMTPS id EDF8887E62\n for <intel-wired-lan@lists.osuosl.org>; Fri, 24 Apr 2020 01:12:16 +0000 (UTC)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 23 Apr 2020 18:12:16 -0700",
            "from jwstark-mobl.amr.corp.intel.com ([10.212.173.233])\n by fmsmga005.fm.intel.com with ESMTP; 23 Apr 2020 18:12:15 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "IronPort-SDR": [
            "\n QAEwQEA9gCgJAjMEYvwbwQTzHdP+8KzQZkrqD3W4aEbqF0mmSoMlC1sasvVsFImHfJIQoi2PAa\n 5MA5X+NBNLug==",
            "\n ib7sjkMxkl62GlzJs6PNNexCgkMVgM/CldtcrdcrMM7PEYdDAj/u+f/1S+6eZuFeBdS23fsvfA\n W5ZmvRRurJ7w=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,309,1583222400\"; d=\"scan'208\";a=\"457145540\"",
        "From": "Andre Guedes <andre.guedes@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org, aaron.f.brown@intel.com,\n jeffrey.t.kirsher@intel.com",
        "Date": "Thu, 23 Apr 2020 18:11:19 -0700",
        "Message-Id": "<20200424011119.98746-1-andre.guedes@intel.com>",
        "X-Mailer": "git-send-email 2.26.0",
        "In-Reply-To": "<20200403181743.23447-5-andre.guedes@intel.com>",
        "References": "<20200403181743.23447-5-andre.guedes@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH v2 4/4] igc: Refactor VLAN priority\n filtering code",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "The whole VLAN priority filtering code is implemented in igc_ethtool.c\nand mixes logic from ethtool and core parts. This patch refactors it so\ncore logic is moved to igc_main.c, aligning the VLAN priority filtering\ncode organization with the MAC address filtering code.\n\nThis patch also takes the opportunity to add some log messages to ease\ndebugging.\n\nSigned-off-by: Andre Guedes <andre.guedes@intel.com>\n---\nv2: Previous version had a bug when clearing IGC_VLANPQF_QSEL bits in\n    igc_del_vlan_prio_filter().\n---\n drivers/net/ethernet/intel/igc/igc.h         |  3 +\n drivers/net/ethernet/intel/igc/igc_ethtool.c | 64 ++++----------------\n drivers/net/ethernet/intel/igc/igc_main.c    | 52 ++++++++++++++++\n 3 files changed, 68 insertions(+), 51 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h\nindex 1b07e8b870c2..48eb9c00a44d 100644\n--- a/drivers/net/ethernet/intel/igc/igc.h\n+++ b/drivers/net/ethernet/intel/igc/igc.h\n@@ -235,6 +235,9 @@ int igc_add_mac_filter(struct igc_adapter *adapter, const u8 *addr,\n \t\t       const s8 queue, const u8 flags);\n int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr,\n \t\t       const u8 flags);\n+int igc_add_vlan_prio_filter(struct igc_adapter *adapter, int prio,\n+\t\t\t     int queue);\n+void igc_del_vlan_prio_filter(struct igc_adapter *adapter, int prio);\n void igc_update_stats(struct igc_adapter *adapter);\n \n /* igc_dump declarations */\ndiff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c\nindex 036a2244b76c..35bc125183a0 100644\n--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c\n+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c\n@@ -1223,35 +1223,6 @@ static int igc_rxnfc_write_etype_filter(struct igc_adapter *adapter,\n \treturn 0;\n }\n \n-static int igc_rxnfc_write_vlan_prio_filter(struct igc_adapter *adapter,\n-\t\t\t\t\t    struct igc_nfc_filter *input)\n-{\n-\tstruct igc_hw *hw = &adapter->hw;\n-\tu8 vlan_priority;\n-\tu16 queue_index;\n-\tu32 vlapqf;\n-\n-\tvlapqf = rd32(IGC_VLANPQF);\n-\tvlan_priority = (ntohs(input->filter.vlan_tci) & VLAN_PRIO_MASK)\n-\t\t\t\t>> VLAN_PRIO_SHIFT;\n-\tqueue_index = (vlapqf >> (vlan_priority * 4)) & IGC_VLANPQF_QUEUE_MASK;\n-\n-\t/* check whether this vlan prio is already set */\n-\tif (vlapqf & IGC_VLANPQF_VALID(vlan_priority) &&\n-\t    queue_index != input->action) {\n-\t\tnetdev_err(adapter->netdev,\n-\t\t\t   \"ethtool rxnfc set vlan prio filter failed\");\n-\t\treturn -EEXIST;\n-\t}\n-\n-\tvlapqf |= IGC_VLANPQF_VALID(vlan_priority);\n-\tvlapqf |= IGC_VLANPQF_QSEL(vlan_priority, input->action);\n-\n-\twr32(IGC_VLANPQF, vlapqf);\n-\n-\treturn 0;\n-}\n-\n int igc_add_filter(struct igc_adapter *adapter, struct igc_nfc_filter *input)\n {\n \tstruct igc_hw *hw = &adapter->hw;\n@@ -1285,10 +1256,15 @@ int igc_add_filter(struct igc_adapter *adapter, struct igc_nfc_filter *input)\n \t\t\treturn err;\n \t}\n \n-\tif (input->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI)\n-\t\terr = igc_rxnfc_write_vlan_prio_filter(adapter, input);\n+\tif (input->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI) {\n+\t\tint prio = (ntohs(input->filter.vlan_tci) & VLAN_PRIO_MASK)\n+\t\t\t\t>> VLAN_PRIO_SHIFT;\n+\t\terr = igc_add_vlan_prio_filter(adapter, prio, input->action);\n+\t\tif (err)\n+\t\t\treturn err;\n+\t}\n \n-\treturn err;\n+\treturn 0;\n }\n \n static void igc_clear_etype_filter_regs(struct igc_adapter *adapter,\n@@ -1306,31 +1282,17 @@ static void igc_clear_etype_filter_regs(struct igc_adapter *adapter,\n \tadapter->etype_bitmap[reg_index] = false;\n }\n \n-static void igc_clear_vlan_prio_filter(struct igc_adapter *adapter,\n-\t\t\t\t       u16 vlan_tci)\n-{\n-\tstruct igc_hw *hw = &adapter->hw;\n-\tu8 vlan_priority;\n-\tu32 vlapqf;\n-\n-\tvlan_priority = (vlan_tci & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;\n-\n-\tvlapqf = rd32(IGC_VLANPQF);\n-\tvlapqf &= ~IGC_VLANPQF_VALID(vlan_priority);\n-\tvlapqf &= ~IGC_VLANPQF_QSEL(vlan_priority, IGC_VLANPQF_QUEUE_MASK);\n-\n-\twr32(IGC_VLANPQF, vlapqf);\n-}\n-\n int igc_erase_filter(struct igc_adapter *adapter, struct igc_nfc_filter *input)\n {\n \tif (input->filter.match_flags & IGC_FILTER_FLAG_ETHER_TYPE)\n \t\tigc_clear_etype_filter_regs(adapter,\n \t\t\t\t\t    input->etype_reg_index);\n \n-\tif (input->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI)\n-\t\tigc_clear_vlan_prio_filter(adapter,\n-\t\t\t\t\t   ntohs(input->filter.vlan_tci));\n+\tif (input->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI) {\n+\t\tint prio = (ntohs(input->filter.vlan_tci) & VLAN_PRIO_MASK)\n+\t\t\t\t>> VLAN_PRIO_SHIFT;\n+\t\tigc_del_vlan_prio_filter(adapter, prio);\n+\t}\n \n \tif (input->filter.match_flags & IGC_FILTER_FLAG_SRC_MAC_ADDR)\n \t\tigc_del_mac_filter(adapter, input->filter.src_addr,\ndiff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c\nindex c3555148ca0e..7ae5bc476bdb 100644\n--- a/drivers/net/ethernet/intel/igc/igc_main.c\n+++ b/drivers/net/ethernet/intel/igc/igc_main.c\n@@ -2315,6 +2315,58 @@ int igc_del_mac_filter(struct igc_adapter *adapter, const u8 *addr,\n \treturn 0;\n }\n \n+/**\n+ * igc_add_vlan_prio_filter() - Add VLAN priority filter.\n+ * @adapter: Pointer to adapter where the filter should be added.\n+ * @prio: VLAN priority value.\n+ * @queue: Queue number which matching frames are assigned to.\n+ *\n+ * Return: 0 in case of success, negative errno code otherwise.\n+ */\n+int igc_add_vlan_prio_filter(struct igc_adapter *adapter, int prio, int queue)\n+{\n+\tstruct net_device *dev = adapter->netdev;\n+\tstruct igc_hw *hw = &adapter->hw;\n+\tu32 vlanpqf;\n+\n+\tvlanpqf = rd32(IGC_VLANPQF);\n+\n+\tif (vlanpqf & IGC_VLANPQF_VALID(prio)) {\n+\t\tnetdev_dbg(dev, \"VLAN priority filter already in use\");\n+\t\treturn -EEXIST;\n+\t}\n+\n+\tvlanpqf |= IGC_VLANPQF_QSEL(prio, queue);\n+\tvlanpqf |= IGC_VLANPQF_VALID(prio);\n+\n+\twr32(IGC_VLANPQF, vlanpqf);\n+\n+\tnetdev_dbg(dev, \"Add VLAN priority filter: prio %d queue %d\",\n+\t\t   prio, queue);\n+\treturn 0;\n+}\n+\n+/**\n+ * igc_del_vlan_prio_filter() - Delete VLAN priority filter.\n+ * @adapter: Pointer to adapter where the filter should be deleted from.\n+ * @prio: VLAN priority value.\n+ */\n+void igc_del_vlan_prio_filter(struct igc_adapter *adapter, int prio)\n+{\n+\tstruct igc_hw *hw = &adapter->hw;\n+\tu32 vlanpqf;\n+\n+\tvlanpqf = rd32(IGC_VLANPQF);\n+\n+\tvlanpqf &= ~IGC_VLANPQF_VALID(prio);\n+\tvlanpqf &= ~IGC_VLANPQF_QSEL(prio, IGC_VLANPQF_QUEUE_MASK);\n+\n+\twr32(IGC_VLANPQF, vlanpqf);\n+\n+\tnetdev_dbg(adapter->netdev, \"Delete VLAN priority filter: prio %d\",\n+\t\t   prio);\n+}\n+\n static int igc_uc_sync(struct net_device *netdev, const unsigned char *addr)\n {\n \tstruct igc_adapter *adapter = netdev_priv(netdev);\n",
    "prefixes": [
        "v2",
        "4/4"
    ]
}