get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1276666,
    "url": "http://patchwork.ozlabs.org/api/patches/1276666/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200424201623.10971-7-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": "<20200424201623.10971-7-andre.guedes@intel.com>",
    "list_archive_url": null,
    "date": "2020-04-24T20:16:10",
    "name": "[06/19] igc: Align terms used in NFC support code",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "9b1dbe489d3772e219df2106b9922c45f9ace367",
    "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/20200424201623.10971-7-andre.guedes@intel.com/mbox/",
    "series": [
        {
            "id": 172579,
            "url": "http://patchwork.ozlabs.org/api/series/172579/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=172579",
            "date": "2020-04-24T20:16:07",
            "name": "igc: Fixes to NFC support code",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/172579/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1276666/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1276666/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 49857j0Wtxz9sSG\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 25 Apr 2020 06:17:37 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id A093386B59;\n\tFri, 24 Apr 2020 20:17:35 +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 IoEetx5iF0v1; Fri, 24 Apr 2020 20:17:33 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 8020B86BA9;\n\tFri, 24 Apr 2020 20:17:33 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n by ash.osuosl.org (Postfix) with ESMTP id 0A7F81BF9C2\n for <intel-wired-lan@lists.osuosl.org>; Fri, 24 Apr 2020 20:17:29 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by fraxinus.osuosl.org (Postfix) with ESMTP id 0750686BF7\n for <intel-wired-lan@lists.osuosl.org>; Fri, 24 Apr 2020 20:17:29 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n with ESMTP id AXtAiAh4xzlL for <intel-wired-lan@lists.osuosl.org>;\n Fri, 24 Apr 2020 20:17:26 +0000 (UTC)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n by fraxinus.osuosl.org (Postfix) with ESMTPS id 5C9D4868BC\n for <intel-wired-lan@lists.osuosl.org>; Fri, 24 Apr 2020 20:17:26 +0000 (UTC)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 24 Apr 2020 13:17:26 -0700",
            "from kleandre-mobl.amr.corp.intel.com ([10.213.164.39])\n by orsmga001.jf.intel.com with ESMTP; 24 Apr 2020 13:17:25 -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 qJyKxzeb2CU5zCHr9L+wD1Kcg6Afy0uwFvZJF8/3nA/4ic8oJ1o/RDxxtzLiOoOCXxcBpQxVCb\n rJLG/aUVUbgg==",
            "\n pG+g8zMGKdGoOWNwJzVkkLW4yYtVSqP4KBsd5NBWVJK8riGWELM+GzmMYiEbVz3tMiZM/Ipdmn\n LVVFdvsxMyYw=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,313,1583222400\"; d=\"scan'208\";a=\"335474506\"",
        "From": "Andre Guedes <andre.guedes@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 24 Apr 2020 13:16:10 -0700",
        "Message-Id": "<20200424201623.10971-7-andre.guedes@intel.com>",
        "X-Mailer": "git-send-email 2.26.0",
        "In-Reply-To": "<20200424201623.10971-1-andre.guedes@intel.com>",
        "References": "<20200424201623.10971-1-andre.guedes@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH 06/19] igc: Align terms used in NFC\n support 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 Network Flow Classification (NFC) support code from IGC driver uses\nterms such as 'rule', 'filter', 'entry', 'input' interchangeably when\nreferring to NFC rules, making it harder to follow the code. This patch\nrenames IGC's internal APIs, structs, and variables so we stick with the\nterm 'rule' since this is the term used in ethtool APIs. It also removes\nsome not applicable comments along the way. No functionality is changed\nby this patch.\n\nSigned-off-by: Andre Guedes <andre.guedes@intel.com>\n---\n drivers/net/ethernet/intel/igc/igc.h         |  29 ++--\n drivers/net/ethernet/intel/igc/igc_ethtool.c | 160 +++++++++----------\n drivers/net/ethernet/intel/igc/igc_main.c    |  42 ++---\n 3 files changed, 114 insertions(+), 117 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h\nindex 359ac40908f6..7124ba254b89 100644\n--- a/drivers/net/ethernet/intel/igc/igc.h\n+++ b/drivers/net/ethernet/intel/igc/igc.h\n@@ -187,12 +187,12 @@ struct igc_adapter {\n \tu32 rss_queues;\n \tu32 rss_indir_tbl_init;\n \n-\t/* RX network flow classification support */\n-\tstruct hlist_head nfc_filter_list;\n-\tunsigned int nfc_filter_count;\n-\n-\t/* lock for RX network flow classification filter */\n-\tspinlock_t nfc_lock;\n+\t/* Any access to elements in nfc_rule_list is protected by the\n+\t * nfc_rule_lock.\n+\t */\n+\tspinlock_t nfc_rule_lock;\n+\tstruct hlist_head nfc_rule_list;\n+\tunsigned int nfc_rule_count;\n \n \tu8 rss_indir_tbl[IGC_RETA_SIZE];\n \n@@ -453,7 +453,7 @@ enum igc_filter_match_flags {\n };\n \n /* RX network flow classification data structure */\n-struct igc_nfc_input {\n+struct igc_nfc_filter {\n \t/* Byte layout in order, all values with MSB first:\n \t * match_flags - 1 byte\n \t * etype - 2 bytes\n@@ -466,14 +466,14 @@ struct igc_nfc_input {\n \tu8 dst_addr[ETH_ALEN];\n };\n \n-struct igc_nfc_filter {\n+struct igc_nfc_rule {\n \tstruct hlist_node nfc_node;\n-\tstruct igc_nfc_input filter;\n+\tstruct igc_nfc_filter filter;\n \tu16 sw_idx;\n \tu16 action;\n };\n \n-#define IGC_MAX_RXNFC_FILTERS\t\t16\n+#define IGC_MAX_RXNFC_RULES\t\t16\n \n /* igc_desc_unused - calculate if we have unused descriptors */\n static inline u16 igc_desc_unused(const struct igc_ring *ring)\n@@ -549,12 +549,11 @@ static inline s32 igc_read_phy_reg(struct igc_hw *hw, u32 offset, u16 *data)\n \treturn 0;\n }\n \n-/* forward declaration */\n void igc_reinit_locked(struct igc_adapter *);\n-int igc_add_filter(struct igc_adapter *adapter,\n-\t\t   struct igc_nfc_filter *input);\n-int igc_erase_filter(struct igc_adapter *adapter,\n-\t\t     struct igc_nfc_filter *input);\n+int igc_enable_nfc_rule(struct igc_adapter *adapter,\n+\t\t\tconst struct igc_nfc_rule *rule);\n+int igc_disable_nfc_rule(struct igc_adapter *adapter,\n+\t\t\t const struct igc_nfc_rule *rule);\n \n void igc_ptp_init(struct igc_adapter *adapter);\n void igc_ptp_reset(struct igc_adapter *adapter);\ndiff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c\nindex 4ee040607c0b..46599ee7f0b9 100644\n--- a/drivers/net/ethernet/intel/igc/igc_ethtool.c\n+++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c\n@@ -931,16 +931,15 @@ static int igc_ethtool_set_coalesce(struct net_device *netdev,\n }\n \n #define ETHER_TYPE_FULL_MASK ((__force __be16)~0)\n-static int igc_ethtool_get_nfc_entry(struct igc_adapter *adapter,\n-\t\t\t\t     struct ethtool_rxnfc *cmd)\n+static int igc_ethtool_get_nfc_rule(struct igc_adapter *adapter,\n+\t\t\t\t    struct ethtool_rxnfc *cmd)\n {\n \tstruct ethtool_rx_flow_spec *fsp = &cmd->fs;\n-\tstruct igc_nfc_filter *rule = NULL;\n+\tstruct igc_nfc_rule *rule = NULL;\n \n-\t/* report total rule count */\n-\tcmd->data = IGC_MAX_RXNFC_FILTERS;\n+\tcmd->data = IGC_MAX_RXNFC_RULES;\n \n-\thlist_for_each_entry(rule, &adapter->nfc_filter_list, nfc_node) {\n+\thlist_for_each_entry(rule, &adapter->nfc_rule_list, nfc_node) {\n \t\tif (fsp->location <= rule->sw_idx)\n \t\t\tbreak;\n \t}\n@@ -980,17 +979,16 @@ static int igc_ethtool_get_nfc_entry(struct igc_adapter *adapter,\n \treturn 0;\n }\n \n-static int igc_ethtool_get_nfc_all(struct igc_adapter *adapter,\n-\t\t\t\t   struct ethtool_rxnfc *cmd,\n-\t\t\t\t   u32 *rule_locs)\n+static int igc_ethtool_get_nfc_rules(struct igc_adapter *adapter,\n+\t\t\t\t     struct ethtool_rxnfc *cmd,\n+\t\t\t\t     u32 *rule_locs)\n {\n-\tstruct igc_nfc_filter *rule;\n+\tstruct igc_nfc_rule *rule;\n \tint cnt = 0;\n \n-\t/* report total rule count */\n-\tcmd->data = IGC_MAX_RXNFC_FILTERS;\n+\tcmd->data = IGC_MAX_RXNFC_RULES;\n \n-\thlist_for_each_entry(rule, &adapter->nfc_filter_list, nfc_node) {\n+\thlist_for_each_entry(rule, &adapter->nfc_rule_list, nfc_node) {\n \t\tif (cnt == cmd->rule_cnt)\n \t\t\treturn -EMSGSIZE;\n \t\trule_locs[cnt] = rule->sw_idx;\n@@ -1062,12 +1060,12 @@ static int igc_ethtool_get_rxnfc(struct net_device *dev,\n \t\tcmd->data = adapter->num_rx_queues;\n \t\treturn 0;\n \tcase ETHTOOL_GRXCLSRLCNT:\n-\t\tcmd->rule_cnt = adapter->nfc_filter_count;\n+\t\tcmd->rule_cnt = adapter->nfc_rule_count;\n \t\treturn 0;\n \tcase ETHTOOL_GRXCLSRULE:\n-\t\treturn igc_ethtool_get_nfc_entry(adapter, cmd);\n+\t\treturn igc_ethtool_get_nfc_rule(adapter, cmd);\n \tcase ETHTOOL_GRXCLSRLALL:\n-\t\treturn igc_ethtool_get_nfc_all(adapter, cmd, rule_locs);\n+\t\treturn igc_ethtool_get_nfc_rules(adapter, cmd, rule_locs);\n \tcase ETHTOOL_GRXFH:\n \t\treturn igc_ethtool_get_rss_hash_opts(adapter, cmd);\n \tdefault:\n@@ -1179,38 +1177,37 @@ static int igc_ethtool_set_rss_hash_opt(struct igc_adapter *adapter,\n \treturn 0;\n }\n \n-int igc_add_filter(struct igc_adapter *adapter, struct igc_nfc_filter *input)\n+int igc_enable_nfc_rule(struct igc_adapter *adapter,\n+\t\t\tconst struct igc_nfc_rule *rule)\n {\n \tint err = -EINVAL;\n \n-\tif (input->filter.match_flags & IGC_FILTER_FLAG_ETHER_TYPE) {\n-\t\tu16 etype = ntohs(input->filter.etype);\n+\tif (rule->filter.match_flags & IGC_FILTER_FLAG_ETHER_TYPE) {\n+\t\tu16 etype = ntohs(rule->filter.etype);\n \n-\t\terr = igc_add_etype_filter(adapter, etype, input->action);\n+\t\terr = igc_add_etype_filter(adapter, etype, rule->action);\n \t\tif (err)\n \t\t\treturn err;\n \t}\n \n-\tif (input->filter.match_flags & IGC_FILTER_FLAG_SRC_MAC_ADDR) {\n+\tif (rule->filter.match_flags & IGC_FILTER_FLAG_SRC_MAC_ADDR) {\n \t\terr = igc_add_mac_filter(adapter, IGC_MAC_FILTER_TYPE_SRC,\n-\t\t\t\t\t input->filter.src_addr,\n-\t\t\t\t\t input->action);\n+\t\t\t\t\t rule->filter.src_addr, rule->action);\n \t\tif (err)\n \t\t\treturn err;\n \t}\n \n-\tif (input->filter.match_flags & IGC_FILTER_FLAG_DST_MAC_ADDR) {\n+\tif (rule->filter.match_flags & IGC_FILTER_FLAG_DST_MAC_ADDR) {\n \t\terr = igc_add_mac_filter(adapter, IGC_MAC_FILTER_TYPE_DST,\n-\t\t\t\t\t input->filter.dst_addr,\n-\t\t\t\t\t input->action);\n+\t\t\t\t\t rule->filter.dst_addr, rule->action);\n \t\tif (err)\n \t\t\treturn err;\n \t}\n \n-\tif (input->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI) {\n-\t\tint prio = (ntohs(input->filter.vlan_tci) & VLAN_PRIO_MASK)\n+\tif (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI) {\n+\t\tint prio = (ntohs(rule->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\terr = igc_add_vlan_prio_filter(adapter, prio, rule->action);\n \t\tif (err)\n \t\t\treturn err;\n \t}\n@@ -1218,42 +1215,43 @@ int igc_add_filter(struct igc_adapter *adapter, struct igc_nfc_filter *input)\n \treturn 0;\n }\n \n-int igc_erase_filter(struct igc_adapter *adapter, struct igc_nfc_filter *input)\n+int igc_disable_nfc_rule(struct igc_adapter *adapter,\n+\t\t\t const struct igc_nfc_rule *rule)\n {\n-\tif (input->filter.match_flags & IGC_FILTER_FLAG_ETHER_TYPE) {\n-\t\tu16 etype = ntohs(input->filter.etype);\n+\tif (rule->filter.match_flags & IGC_FILTER_FLAG_ETHER_TYPE) {\n+\t\tu16 etype = ntohs(rule->filter.etype);\n \n \t\tigc_del_etype_filter(adapter, etype);\n \t}\n \n-\tif (input->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI) {\n-\t\tint prio = (ntohs(input->filter.vlan_tci) & VLAN_PRIO_MASK)\n+\tif (rule->filter.match_flags & IGC_FILTER_FLAG_VLAN_TCI) {\n+\t\tint prio = (ntohs(rule->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+\tif (rule->filter.match_flags & IGC_FILTER_FLAG_SRC_MAC_ADDR)\n \t\tigc_del_mac_filter(adapter, IGC_MAC_FILTER_TYPE_SRC,\n-\t\t\t\t   input->filter.src_addr);\n+\t\t\t\t   rule->filter.src_addr);\n \n-\tif (input->filter.match_flags & IGC_FILTER_FLAG_DST_MAC_ADDR)\n+\tif (rule->filter.match_flags & IGC_FILTER_FLAG_DST_MAC_ADDR)\n \t\tigc_del_mac_filter(adapter, IGC_MAC_FILTER_TYPE_DST,\n-\t\t\t\t   input->filter.dst_addr);\n+\t\t\t\t   rule->filter.dst_addr);\n \n \treturn 0;\n }\n \n-static int igc_ethtool_update_nfc_entry(struct igc_adapter *adapter,\n-\t\t\t\t\tstruct igc_nfc_filter *input,\n-\t\t\t\t\tu16 sw_idx)\n+static int igc_ethtool_update_nfc_rule(struct igc_adapter *adapter,\n+\t\t\t\t       struct igc_nfc_rule *input,\n+\t\t\t\t       u16 sw_idx)\n {\n-\tstruct igc_nfc_filter *rule, *parent;\n+\tstruct igc_nfc_rule *rule, *parent;\n \tint err = -EINVAL;\n \n \tparent = NULL;\n \trule = NULL;\n \n-\thlist_for_each_entry(rule, &adapter->nfc_filter_list, nfc_node) {\n+\thlist_for_each_entry(rule, &adapter->nfc_rule_list, nfc_node) {\n \t\t/* hash found, or no matching entry */\n \t\tif (rule->sw_idx >= sw_idx)\n \t\t\tbreak;\n@@ -1263,11 +1261,11 @@ static int igc_ethtool_update_nfc_entry(struct igc_adapter *adapter,\n \t/* if there is an old rule occupying our place remove it */\n \tif (rule && rule->sw_idx == sw_idx) {\n \t\tif (!input)\n-\t\t\terr = igc_erase_filter(adapter, rule);\n+\t\t\terr = igc_disable_nfc_rule(adapter, rule);\n \n \t\thlist_del(&rule->nfc_node);\n \t\tkfree(rule);\n-\t\tadapter->nfc_filter_count--;\n+\t\tadapter->nfc_rule_count--;\n \t}\n \n \t/* If no input this was a delete, err should be 0 if a rule was\n@@ -1283,21 +1281,21 @@ static int igc_ethtool_update_nfc_entry(struct igc_adapter *adapter,\n \tif (parent)\n \t\thlist_add_behind(&input->nfc_node, &parent->nfc_node);\n \telse\n-\t\thlist_add_head(&input->nfc_node, &adapter->nfc_filter_list);\n+\t\thlist_add_head(&input->nfc_node, &adapter->nfc_rule_list);\n \n \t/* update counts */\n-\tadapter->nfc_filter_count++;\n+\tadapter->nfc_rule_count++;\n \n \treturn 0;\n }\n \n-static int igc_ethtool_add_nfc_entry(struct igc_adapter *adapter,\n-\t\t\t\t     struct ethtool_rxnfc *cmd)\n+static int igc_ethtool_add_nfc_rule(struct igc_adapter *adapter,\n+\t\t\t\t    struct ethtool_rxnfc *cmd)\n {\n \tstruct net_device *netdev = adapter->netdev;\n \tstruct ethtool_rx_flow_spec *fsp =\n \t\t(struct ethtool_rx_flow_spec *)&cmd->fs;\n-\tstruct igc_nfc_filter *input, *rule;\n+\tstruct igc_nfc_rule *rule, *tmp;\n \tint err = 0;\n \n \tif (!(netdev->hw_features & NETIF_F_NTUPLE))\n@@ -1314,7 +1312,7 @@ static int igc_ethtool_add_nfc_entry(struct igc_adapter *adapter,\n \t}\n \n \t/* Don't allow indexes to exist outside of available space */\n-\tif (fsp->location >= IGC_MAX_RXNFC_FILTERS) {\n+\tif (fsp->location >= IGC_MAX_RXNFC_RULES) {\n \t\tnetdev_err(netdev, \"Location out of range\");\n \t\treturn -EINVAL;\n \t}\n@@ -1322,32 +1320,32 @@ static int igc_ethtool_add_nfc_entry(struct igc_adapter *adapter,\n \tif ((fsp->flow_type & ~FLOW_EXT) != ETHER_FLOW)\n \t\treturn -EINVAL;\n \n-\tinput = kzalloc(sizeof(*input), GFP_KERNEL);\n-\tif (!input)\n+\trule = kzalloc(sizeof(*rule), GFP_KERNEL);\n+\tif (!rule)\n \t\treturn -ENOMEM;\n \n \tif (fsp->m_u.ether_spec.h_proto == ETHER_TYPE_FULL_MASK) {\n-\t\tinput->filter.etype = fsp->h_u.ether_spec.h_proto;\n-\t\tinput->filter.match_flags = IGC_FILTER_FLAG_ETHER_TYPE;\n+\t\trule->filter.etype = fsp->h_u.ether_spec.h_proto;\n+\t\trule->filter.match_flags = IGC_FILTER_FLAG_ETHER_TYPE;\n \t}\n \n \t/* Both source and destination address filters only support the full\n \t * mask.\n \t */\n \tif (is_broadcast_ether_addr(fsp->m_u.ether_spec.h_source)) {\n-\t\tinput->filter.match_flags |= IGC_FILTER_FLAG_SRC_MAC_ADDR;\n-\t\tether_addr_copy(input->filter.src_addr,\n+\t\trule->filter.match_flags |= IGC_FILTER_FLAG_SRC_MAC_ADDR;\n+\t\tether_addr_copy(rule->filter.src_addr,\n \t\t\t\tfsp->h_u.ether_spec.h_source);\n \t}\n \n \tif (is_broadcast_ether_addr(fsp->m_u.ether_spec.h_dest)) {\n-\t\tinput->filter.match_flags |= IGC_FILTER_FLAG_DST_MAC_ADDR;\n-\t\tether_addr_copy(input->filter.dst_addr,\n+\t\trule->filter.match_flags |= IGC_FILTER_FLAG_DST_MAC_ADDR;\n+\t\tether_addr_copy(rule->filter.dst_addr,\n \t\t\t\tfsp->h_u.ether_spec.h_dest);\n \t}\n \n-\tif (input->filter.match_flags & IGC_FILTER_FLAG_DST_MAC_ADDR &&\n-\t    input->filter.match_flags & IGC_FILTER_FLAG_SRC_MAC_ADDR) {\n+\tif (rule->filter.match_flags & IGC_FILTER_FLAG_DST_MAC_ADDR &&\n+\t    rule->filter.match_flags & IGC_FILTER_FLAG_SRC_MAC_ADDR) {\n \t\tnetdev_dbg(netdev, \"Filters with both dst and src are not supported\");\n \t\terr = -EOPNOTSUPP;\n \t\tgoto err_out;\n@@ -1359,18 +1357,18 @@ static int igc_ethtool_add_nfc_entry(struct igc_adapter *adapter,\n \t\t\terr = -EOPNOTSUPP;\n \t\t\tgoto err_out;\n \t\t}\n-\t\tinput->filter.vlan_tci = fsp->h_ext.vlan_tci;\n-\t\tinput->filter.match_flags |= IGC_FILTER_FLAG_VLAN_TCI;\n+\t\trule->filter.vlan_tci = fsp->h_ext.vlan_tci;\n+\t\trule->filter.match_flags |= IGC_FILTER_FLAG_VLAN_TCI;\n \t}\n \n-\tinput->action = fsp->ring_cookie;\n-\tinput->sw_idx = fsp->location;\n+\trule->action = fsp->ring_cookie;\n+\trule->sw_idx = fsp->location;\n \n-\tspin_lock(&adapter->nfc_lock);\n+\tspin_lock(&adapter->nfc_rule_lock);\n \n-\thlist_for_each_entry(rule, &adapter->nfc_filter_list, nfc_node) {\n-\t\tif (!memcmp(&input->filter, &rule->filter,\n-\t\t\t    sizeof(input->filter))) {\n+\thlist_for_each_entry(tmp, &adapter->nfc_rule_list, nfc_node) {\n+\t\tif (!memcmp(&rule->filter, &tmp->filter,\n+\t\t\t    sizeof(rule->filter))) {\n \t\t\terr = -EEXIST;\n \t\t\tnetdev_err(netdev,\n \t\t\t\t   \"ethtool: this filter is already set\");\n@@ -1378,32 +1376,32 @@ static int igc_ethtool_add_nfc_entry(struct igc_adapter *adapter,\n \t\t}\n \t}\n \n-\terr = igc_add_filter(adapter, input);\n+\terr = igc_enable_nfc_rule(adapter, rule);\n \tif (err)\n \t\tgoto err_out_w_lock;\n \n-\tigc_ethtool_update_nfc_entry(adapter, input, input->sw_idx);\n+\tigc_ethtool_update_nfc_rule(adapter, rule, rule->sw_idx);\n \n-\tspin_unlock(&adapter->nfc_lock);\n+\tspin_unlock(&adapter->nfc_rule_lock);\n \treturn 0;\n \n err_out_w_lock:\n-\tspin_unlock(&adapter->nfc_lock);\n+\tspin_unlock(&adapter->nfc_rule_lock);\n err_out:\n-\tkfree(input);\n+\tkfree(rule);\n \treturn err;\n }\n \n-static int igc_ethtool_del_nfc_entry(struct igc_adapter *adapter,\n-\t\t\t\t     struct ethtool_rxnfc *cmd)\n+static int igc_ethtool_del_nfc_rule(struct igc_adapter *adapter,\n+\t\t\t\t    struct ethtool_rxnfc *cmd)\n {\n \tstruct ethtool_rx_flow_spec *fsp =\n \t\t(struct ethtool_rx_flow_spec *)&cmd->fs;\n \tint err;\n \n-\tspin_lock(&adapter->nfc_lock);\n-\terr = igc_ethtool_update_nfc_entry(adapter, NULL, fsp->location);\n-\tspin_unlock(&adapter->nfc_lock);\n+\tspin_lock(&adapter->nfc_rule_lock);\n+\terr = igc_ethtool_update_nfc_rule(adapter, NULL, fsp->location);\n+\tspin_unlock(&adapter->nfc_rule_lock);\n \n \treturn err;\n }\n@@ -1417,9 +1415,9 @@ static int igc_ethtool_set_rxnfc(struct net_device *dev,\n \tcase ETHTOOL_SRXFH:\n \t\treturn igc_ethtool_set_rss_hash_opt(adapter, cmd);\n \tcase ETHTOOL_SRXCLSRLINS:\n-\t\treturn igc_ethtool_add_nfc_entry(adapter, cmd);\n+\t\treturn igc_ethtool_add_nfc_rule(adapter, cmd);\n \tcase ETHTOOL_SRXCLSRLDEL:\n-\t\treturn igc_ethtool_del_nfc_entry(adapter, cmd);\n+\t\treturn igc_ethtool_del_nfc_rule(adapter, cmd);\n \tdefault:\n \t\treturn -EOPNOTSUPP;\n \t}\ndiff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c\nindex ecdc0548f24e..7d9a2da4feee 100644\n--- a/drivers/net/ethernet/intel/igc/igc_main.c\n+++ b/drivers/net/ethernet/intel/igc/igc_main.c\n@@ -2175,16 +2175,16 @@ static bool igc_clean_tx_irq(struct igc_q_vector *q_vector, int napi_budget)\n \treturn !!budget;\n }\n \n-static void igc_nfc_filter_restore(struct igc_adapter *adapter)\n+static void igc_restore_nfc_rules(struct igc_adapter *adapter)\n {\n-\tstruct igc_nfc_filter *rule;\n+\tstruct igc_nfc_rule *rule;\n \n-\tspin_lock(&adapter->nfc_lock);\n+\tspin_lock(&adapter->nfc_rule_lock);\n \n-\thlist_for_each_entry(rule, &adapter->nfc_filter_list, nfc_node)\n-\t\tigc_add_filter(adapter, rule);\n+\thlist_for_each_entry(rule, &adapter->nfc_rule_list, nfc_node)\n+\t\tigc_enable_nfc_rule(adapter, rule);\n \n-\tspin_unlock(&adapter->nfc_lock);\n+\tspin_unlock(&adapter->nfc_rule_lock);\n }\n \n static int igc_find_mac_filter(struct igc_adapter *adapter,\n@@ -2538,7 +2538,7 @@ static void igc_configure(struct igc_adapter *adapter)\n \tigc_setup_rctl(adapter);\n \n \tigc_set_default_mac_filter(adapter);\n-\tigc_nfc_filter_restore(adapter);\n+\tigc_restore_nfc_rules(adapter);\n \n \tigc_configure_tx(adapter);\n \tigc_configure_rx(adapter);\n@@ -3425,7 +3425,7 @@ static int igc_sw_init(struct igc_adapter *adapter)\n \t\t\t\tVLAN_HLEN;\n \tadapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;\n \n-\tspin_lock_init(&adapter->nfc_lock);\n+\tspin_lock_init(&adapter->nfc_rule_lock);\n \tspin_lock_init(&adapter->stats64_lock);\n \t/* Assume MSI-X interrupts, will be checked during IRQ allocation */\n \tadapter->flags |= IGC_FLAG_HAS_MSIX;\n@@ -3652,16 +3652,16 @@ void igc_update_stats(struct igc_adapter *adapter)\n \tadapter->stats.mgpdc += rd32(IGC_MGTPDC);\n }\n \n-static void igc_nfc_filter_exit(struct igc_adapter *adapter)\n+static void igc_nfc_rule_exit(struct igc_adapter *adapter)\n {\n-\tstruct igc_nfc_filter *rule;\n+\tstruct igc_nfc_rule *rule;\n \n-\tspin_lock(&adapter->nfc_lock);\n+\tspin_lock(&adapter->nfc_rule_lock);\n \n-\thlist_for_each_entry(rule, &adapter->nfc_filter_list, nfc_node)\n-\t\tigc_erase_filter(adapter, rule);\n+\thlist_for_each_entry(rule, &adapter->nfc_rule_list, nfc_node)\n+\t\tigc_disable_nfc_rule(adapter, rule);\n \n-\tspin_unlock(&adapter->nfc_lock);\n+\tspin_unlock(&adapter->nfc_rule_lock);\n }\n \n /**\n@@ -3682,7 +3682,7 @@ void igc_down(struct igc_adapter *adapter)\n \twr32(IGC_RCTL, rctl & ~IGC_RCTL_EN);\n \t/* flush and sleep below */\n \n-\tigc_nfc_filter_exit(adapter);\n+\tigc_nfc_rule_exit(adapter);\n \n \t/* set trans_start so we don't get spurious watchdogs during reset */\n \tnetif_trans_update(netdev);\n@@ -3834,17 +3834,17 @@ static int igc_set_features(struct net_device *netdev,\n \n \tif (!(features & NETIF_F_NTUPLE)) {\n \t\tstruct hlist_node *node2;\n-\t\tstruct igc_nfc_filter *rule;\n+\t\tstruct igc_nfc_rule *rule;\n \n-\t\tspin_lock(&adapter->nfc_lock);\n+\t\tspin_lock(&adapter->nfc_rule_lock);\n \t\thlist_for_each_entry_safe(rule, node2,\n-\t\t\t\t\t  &adapter->nfc_filter_list, nfc_node) {\n-\t\t\tigc_erase_filter(adapter, rule);\n+\t\t\t\t\t  &adapter->nfc_rule_list, nfc_node) {\n+\t\t\tigc_disable_nfc_rule(adapter, rule);\n \t\t\thlist_del(&rule->nfc_node);\n \t\t\tkfree(rule);\n \t\t}\n-\t\tspin_unlock(&adapter->nfc_lock);\n-\t\tadapter->nfc_filter_count = 0;\n+\t\tspin_unlock(&adapter->nfc_rule_lock);\n+\t\tadapter->nfc_rule_count = 0;\n \t}\n \n \tnetdev->features = features;\n",
    "prefixes": [
        "06/19"
    ]
}