get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 753593,
    "url": "http://patchwork.ozlabs.org/api/patches/753593/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170421203805.11445-2-jacob.e.keller@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": "<20170421203805.11445-2-jacob.e.keller@intel.com>",
    "list_archive_url": null,
    "date": "2017-04-21T20:38:05",
    "name": "i40e: separate PF and VSI state flags",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "db7f6f98e6584405687c15cb5b967eca69dd6339",
    "submitter": {
        "id": 9784,
        "url": "http://patchwork.ozlabs.org/api/people/9784/?format=api",
        "name": "Jacob Keller",
        "email": "jacob.e.keller@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/20170421203805.11445-2-jacob.e.keller@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/753593/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/753593/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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3w8ncr6HVBz9s78\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 22 Apr 2017 06:38:20 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 6EACC8967C;\n\tFri, 21 Apr 2017 20:38:19 +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 aIaT5DLsJ69m; Fri, 21 Apr 2017 20:38:12 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 5AA36895E5;\n\tFri, 21 Apr 2017 20:38:12 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 11F9D1C0E45\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Apr 2017 20:38:11 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 09B6F30FD5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Apr 2017 20:38:11 +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 sokorsNCrPLu for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Apr 2017 20:38:08 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 53CE330FD9\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 21 Apr 2017 20:38:08 +0000 (UTC)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Apr 2017 13:38:07 -0700",
            "from jekeller-desk.amr.corp.intel.com (HELO\n\tjekeller-desk.jekeller.internal) ([10.166.35.158])\n\tby fmsmga006.fm.intel.com with ESMTP; 21 Apr 2017 13:38:07 -0700"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.37,231,1488873600\"; d=\"scan'208\";a=\"92759417\"",
        "From": "Jacob Keller <jacob.e.keller@intel.com>",
        "To": "Intel Wired LAN <intel-wired-lan@lists.osuosl.org>",
        "Date": "Fri, 21 Apr 2017 13:38:05 -0700",
        "Message-Id": "<20170421203805.11445-2-jacob.e.keller@intel.com>",
        "X-Mailer": "git-send-email 2.12.2.882.g942b4cedeff1.dirty",
        "In-Reply-To": "<20170421203805.11445-1-jacob.e.keller@intel.com>",
        "References": "<20170421203805.11445-1-jacob.e.keller@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH] i40e: separate PF and VSI state flags",
        "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": "Avoid using the same named flags for both vsi->state and pf->state. This\nmakes code review easier, as it is more likely that future authors will\nuse the correct state field when checking bits. Previous commits already\nfound issues with at least one check, and possibly others may be\nincorrect.\n\nThis reduces confusion as it is more clear what each flag represents,\nand which flags are valid for which state field.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\nThis version has the fixup! already squashed in for convenience. Again\nit replaces the patch with the same title on the queue.\n\n drivers/net/ethernet/intel/i40e/i40e.h          | 12 ++++-\n drivers/net/ethernet/intel/i40e/i40e_client.c   |  4 +-\n drivers/net/ethernet/intel/i40e/i40e_debugfs.c  |  4 +-\n drivers/net/ethernet/intel/i40e/i40e_main.c     | 66 ++++++++++++-------------\n drivers/net/ethernet/intel/i40e/i40e_txrx.c     |  8 +--\n drivers/net/ethernet/intel/i40evf/i40e_txrx.c   |  8 +--\n drivers/net/ethernet/intel/i40evf/i40evf.h      |  7 ++-\n drivers/net/ethernet/intel/i40evf/i40evf_main.c | 10 ++--\n 8 files changed, 64 insertions(+), 55 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 0f22c03ec726..ac2a4850a30b 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -125,7 +125,6 @@ enum i40e_state_t {\n \t__I40E_CONFIG_BUSY,\n \t__I40E_CONFIG_DONE,\n \t__I40E_DOWN,\n-\t__I40E_NEEDS_RESTART,\n \t__I40E_SERVICE_SCHED,\n \t__I40E_ADMINQ_EVENT_PENDING,\n \t__I40E_MDD_EVENT_PENDING,\n@@ -138,7 +137,6 @@ enum i40e_state_t {\n \t__I40E_GLOBAL_RESET_REQUESTED,\n \t__I40E_EMP_RESET_REQUESTED,\n \t__I40E_EMP_RESET_INTR_RECEIVED,\n-\t__I40E_FILTER_OVERFLOW_PROMISC,\n \t__I40E_SUSPENDED,\n \t__I40E_PTP_TX_IN_PROGRESS,\n \t__I40E_BAD_EEPROM,\n@@ -149,6 +147,16 @@ enum i40e_state_t {\n \t__I40E_VF_DISABLE,\n };\n \n+/* VSI state flags */\n+enum i40e_vsi_state_t {\n+\t__I40E_VSI_DOWN,\n+\t__I40E_VSI_NEEDS_RESTART,\n+\t__I40E_VSI_SYNCING_FILTERS,\n+\t__I40E_VSI_OVERFLOW_PROMISC,\n+\t__I40E_VSI_REINIT_REQUESTED,\n+\t__I40E_VSI_DOWN_REQUESTED,\n+};\n+\n enum i40e_interrupt_policy {\n \tI40E_INTERRUPT_BEST_CASE,\n \tI40E_INTERRUPT_MEDIUM,\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c\nindex eb2896fd52a6..75e528a6943f 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_client.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c\n@@ -382,7 +382,7 @@ void i40e_client_subtask(struct i40e_pf *pf)\n \t * the netdev is up, then open the client.\n \t */\n \tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {\n-\t\tif (!test_bit(__I40E_DOWN, &vsi->state) &&\n+\t\tif (!test_bit(__I40E_VSI_DOWN, &vsi->state) &&\n \t\t    client->ops && client->ops->open) {\n \t\t\tset_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);\n \t\t\tret = client->ops->open(&cdev->lan_info, client);\n@@ -397,7 +397,7 @@ void i40e_client_subtask(struct i40e_pf *pf)\n \t/* Likewise for client close. If the client is up, but the netdev\n \t * is down, then close the client.\n \t */\n-\t\tif (test_bit(__I40E_DOWN, &vsi->state) &&\n+\t\tif (test_bit(__I40E_VSI_DOWN, &vsi->state) &&\n \t\t    client->ops && client->ops->close) {\n \t\t\tclear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);\n \t\t\tclient->ops->close(&cdev->lan_info, client, false);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\nindex a3d7ec62b76c..5408dbf04a00 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c\n@@ -174,7 +174,7 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)\n \t}\n \tdev_info(&pf->pdev->dev, \"    active_filters %u, promisc_threshold %u, overflow promisc %s\\n\",\n \t\t vsi->active_filters, vsi->promisc_threshold,\n-\t\t (test_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state) ?\n+\t\t (test_bit(__I40E_VSI_OVERFLOW_PROMISC, &vsi->state) ?\n \t\t  \"ON\" : \"OFF\"));\n \tnstat = i40e_get_vsi_stats_struct(vsi);\n \tdev_info(&pf->pdev->dev,\n@@ -1706,7 +1706,7 @@ static ssize_t i40e_dbg_netdev_ops_write(struct file *filp,\n \t\t} else if (!vsi->netdev) {\n \t\t\tdev_info(&pf->pdev->dev, \"tx_timeout: no netdev for VSI %d\\n\",\n \t\t\t\t vsi_seid);\n-\t\t} else if (test_bit(__I40E_DOWN, &vsi->state)) {\n+\t\t} else if (test_bit(__I40E_VSI_DOWN, &vsi->state)) {\n \t\t\tdev_info(&pf->pdev->dev, \"tx_timeout: VSI %d not UP\\n\",\n \t\t\t\t vsi_seid);\n \t\t} else if (rtnl_trylock()) {\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 20850a646e6c..c30f2bc65451 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -422,7 +422,7 @@ static void i40e_get_netdev_stats_struct(struct net_device *netdev,\n \tstruct rtnl_link_stats64 *vsi_stats = i40e_get_vsi_stats_struct(vsi);\n \tint i;\n \n-\tif (test_bit(__I40E_DOWN, &vsi->state))\n+\tif (test_bit(__I40E_VSI_DOWN, &vsi->state))\n \t\treturn;\n \n \tif (!vsi->tx_rings)\n@@ -753,7 +753,7 @@ static void i40e_update_vsi_stats(struct i40e_vsi *vsi)\n \tu64 tx_p, tx_b;\n \tu16 q;\n \n-\tif (test_bit(__I40E_DOWN, &vsi->state) ||\n+\tif (test_bit(__I40E_VSI_DOWN, &vsi->state) ||\n \t    test_bit(__I40E_CONFIG_BUSY, &pf->state))\n \t\treturn;\n \n@@ -1346,7 +1346,7 @@ struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi,\n \t\t * to failed, so we don't bother to try sending the filter\n \t\t * to the hardware.\n \t\t */\n-\t\tif (test_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state))\n+\t\tif (test_bit(__I40E_VSI_OVERFLOW_PROMISC, &vsi->state))\n \t\t\tf->state = I40E_FILTER_FAILED;\n \t\telse\n \t\t\tf->state = I40E_FILTER_NEW;\n@@ -1525,7 +1525,7 @@ static int i40e_set_mac(struct net_device *netdev, void *p)\n \t\treturn 0;\n \t}\n \n-\tif (test_bit(__I40E_DOWN, &vsi->back->state) ||\n+\tif (test_bit(__I40E_VSI_DOWN, &vsi->back->state) ||\n \t    test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state))\n \t\treturn -EADDRNOTAVAIL;\n \n@@ -1920,7 +1920,7 @@ void i40e_aqc_add_filters(struct i40e_vsi *vsi, const char *vsi_name,\n \n \tif (fcnt != num_add) {\n \t\t*promisc_changed = true;\n-\t\tset_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state);\n+\t\tset_bit(__I40E_VSI_OVERFLOW_PROMISC, &vsi->state);\n \t\tdev_warn(&vsi->back->pdev->dev,\n \t\t\t \"Error %s adding RX filters on %s, promiscuous mode forced on\\n\",\n \t\t\t i40e_aq_str(hw, aq_err),\n@@ -2003,7 +2003,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \tstruct i40e_aqc_add_macvlan_element_data *add_list;\n \tstruct i40e_aqc_remove_macvlan_element_data *del_list;\n \n-\twhile (test_and_set_bit(__I40E_CONFIG_BUSY, &vsi->state))\n+\twhile (test_and_set_bit(__I40E_VSI_SYNCING_FILTERS, &vsi->state))\n \t\tusleep_range(1000, 2000);\n \tpf = vsi->back;\n \n@@ -2139,7 +2139,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \n \t\tnum_add = 0;\n \t\thlist_for_each_entry_safe(new, h, &tmp_add_list, hlist) {\n-\t\t\tif (test_bit(__I40E_FILTER_OVERFLOW_PROMISC,\n+\t\t\tif (test_bit(__I40E_VSI_OVERFLOW_PROMISC,\n \t\t\t\t     &vsi->state)) {\n \t\t\t\tnew->state = I40E_FILTER_FAILED;\n \t\t\t\tcontinue;\n@@ -2227,20 +2227,20 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t * safely exit if we didn't just enter, we no longer have any failed\n \t * filters, and we have reduced filters below the threshold value.\n \t */\n-\tif (test_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state) &&\n+\tif (test_bit(__I40E_VSI_OVERFLOW_PROMISC, &vsi->state) &&\n \t    !promisc_changed && !failed_filters &&\n \t    (vsi->active_filters < vsi->promisc_threshold)) {\n \t\tdev_info(&pf->pdev->dev,\n \t\t\t \"filter logjam cleared on %s, leaving overflow promiscuous mode\\n\",\n \t\t\t vsi_name);\n-\t\tclear_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state);\n+\t\tclear_bit(__I40E_VSI_OVERFLOW_PROMISC, &vsi->state);\n \t\tpromisc_changed = true;\n \t\tvsi->promisc_threshold = 0;\n \t}\n \n \t/* if the VF is not trusted do not do promisc */\n \tif ((vsi->type == I40E_VSI_SRIOV) && !pf->vf[vsi->vf_id].trusted) {\n-\t\tclear_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state);\n+\t\tclear_bit(__I40E_VSI_OVERFLOW_PROMISC, &vsi->state);\n \t\tgoto out;\n \t}\n \n@@ -2265,11 +2265,11 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t}\n \tif ((changed_flags & IFF_PROMISC) ||\n \t    (promisc_changed &&\n-\t     test_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state))) {\n+\t     test_bit(__I40E_VSI_OVERFLOW_PROMISC, &vsi->state))) {\n \t\tbool cur_promisc;\n \n \t\tcur_promisc = (!!(vsi->current_netdev_flags & IFF_PROMISC) ||\n-\t\t\t       test_bit(__I40E_FILTER_OVERFLOW_PROMISC,\n+\t\t\t       test_bit(__I40E_VSI_OVERFLOW_PROMISC,\n \t\t\t\t\t&vsi->state));\n \t\tif ((vsi->type == I40E_VSI_MAIN) &&\n \t\t    (pf->lan_veb != I40E_NO_VEB) &&\n@@ -2353,7 +2353,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \tif (retval)\n \t\tvsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;\n \n-\tclear_bit(__I40E_CONFIG_BUSY, &vsi->state);\n+\tclear_bit(__I40E_VSI_SYNCING_FILTERS, &vsi->state);\n \treturn retval;\n \n err_no_memory:\n@@ -2365,7 +2365,7 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \tspin_unlock_bh(&vsi->mac_filter_hash_lock);\n \n \tvsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;\n-\tclear_bit(__I40E_CONFIG_BUSY, &vsi->state);\n+\tclear_bit(__I40E_VSI_SYNCING_FILTERS, &vsi->state);\n \treturn -ENOMEM;\n }\n \n@@ -3907,7 +3907,7 @@ static void i40e_netpoll(struct net_device *netdev)\n \tint i;\n \n \t/* if interface is down do nothing */\n-\tif (test_bit(__I40E_DOWN, &vsi->state))\n+\tif (test_bit(__I40E_VSI_DOWN, &vsi->state))\n \t\treturn;\n \n \tif (pf->flags & I40E_FLAG_MSIX_ENABLED) {\n@@ -4436,7 +4436,7 @@ static void i40e_napi_disable_all(struct i40e_vsi *vsi)\n static void i40e_vsi_close(struct i40e_vsi *vsi)\n {\n \tstruct i40e_pf *pf = vsi->back;\n-\tif (!test_and_set_bit(__I40E_DOWN, &vsi->state))\n+\tif (!test_and_set_bit(__I40E_VSI_DOWN, &vsi->state))\n \t\ti40e_down(vsi);\n \ti40e_vsi_free_irq(vsi);\n \ti40e_vsi_free_tx_resources(vsi);\n@@ -4453,10 +4453,10 @@ static void i40e_vsi_close(struct i40e_vsi *vsi)\n  **/\n static void i40e_quiesce_vsi(struct i40e_vsi *vsi)\n {\n-\tif (test_bit(__I40E_DOWN, &vsi->state))\n+\tif (test_bit(__I40E_VSI_DOWN, &vsi->state))\n \t\treturn;\n \n-\tset_bit(__I40E_NEEDS_RESTART, &vsi->state);\n+\tset_bit(__I40E_VSI_NEEDS_RESTART, &vsi->state);\n \tif (vsi->netdev && netif_running(vsi->netdev))\n \t\tvsi->netdev->netdev_ops->ndo_stop(vsi->netdev);\n \telse\n@@ -4469,10 +4469,9 @@ static void i40e_quiesce_vsi(struct i40e_vsi *vsi)\n  **/\n static void i40e_unquiesce_vsi(struct i40e_vsi *vsi)\n {\n-\tif (!test_bit(__I40E_NEEDS_RESTART, &vsi->state))\n+\tif (!test_and_clear_bit(__I40E_VSI_NEEDS_RESTART, &vsi->state))\n \t\treturn;\n \n-\tclear_bit(__I40E_NEEDS_RESTART, &vsi->state);\n \tif (vsi->netdev && netif_running(vsi->netdev))\n \t\tvsi->netdev->netdev_ops->ndo_open(vsi->netdev);\n \telse\n@@ -4638,7 +4637,7 @@ static void i40e_detect_recover_hung(struct i40e_pf *pf)\n \t\treturn;\n \n \t/* Make sure, VSI state is not DOWN/RECOVERY_PENDING */\n-\tif (test_bit(__I40E_DOWN, &vsi->back->state) ||\n+\tif (test_bit(__I40E_VSI_DOWN, &vsi->back->state) ||\n \t    test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state))\n \t\treturn;\n \n@@ -5354,7 +5353,7 @@ static int i40e_up_complete(struct i40e_vsi *vsi)\n \tif (err)\n \t\treturn err;\n \n-\tclear_bit(__I40E_DOWN, &vsi->state);\n+\tclear_bit(__I40E_VSI_DOWN, &vsi->state);\n \ti40e_napi_enable_all(vsi);\n \ti40e_vsi_enable_irq(vsi);\n \n@@ -5435,7 +5434,7 @@ void i40e_down(struct i40e_vsi *vsi)\n \tint i;\n \n \t/* It is assumed that the caller of this function\n-\t * sets the vsi->state __I40E_DOWN bit.\n+\t * sets the vsi->state __I40E_VSI_DOWN bit.\n \t */\n \tif (vsi->netdev) {\n \t\tnetif_carrier_off(vsi->netdev);\n@@ -5787,10 +5786,9 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired)\n \t\t\tstruct i40e_vsi *vsi = pf->vsi[v];\n \n \t\t\tif (vsi != NULL &&\n-\t\t\t    test_bit(__I40E_REINIT_REQUESTED, &vsi->state)) {\n+\t\t\t    test_and_clear_bit(__I40E_VSI_REINIT_REQUESTED,\n+\t\t\t\t\t       &vsi->state))\n \t\t\t\ti40e_vsi_reinit_locked(pf->vsi[v]);\n-\t\t\t\tclear_bit(__I40E_REINIT_REQUESTED, &vsi->state);\n-\t\t\t}\n \t\t}\n \t} else if (reset_flags & BIT_ULL(__I40E_DOWN_REQUESTED)) {\n \t\tint v;\n@@ -5801,10 +5799,10 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired)\n \t\t\tstruct i40e_vsi *vsi = pf->vsi[v];\n \n \t\t\tif (vsi != NULL &&\n-\t\t\t    test_bit(__I40E_DOWN_REQUESTED, &vsi->state)) {\n-\t\t\t\tset_bit(__I40E_DOWN, &vsi->state);\n+\t\t\t    test_and_clear_bit(__I40E_VSI_DOWN_REQUESTED,\n+\t\t\t\t\t       &vsi->state)) {\n+\t\t\t\tset_bit(__I40E_VSI_DOWN, &vsi->state);\n \t\t\t\ti40e_down(vsi);\n-\t\t\t\tclear_bit(__I40E_DOWN_REQUESTED, &vsi->state);\n \t\t\t}\n \t\t}\n \t} else {\n@@ -6223,7 +6221,7 @@ static void i40e_fdir_reinit_subtask(struct i40e_pf *pf)\n  **/\n static void i40e_vsi_link_event(struct i40e_vsi *vsi, bool link_up)\n {\n-\tif (!vsi || test_bit(__I40E_DOWN, &vsi->state))\n+\tif (!vsi || test_bit(__I40E_VSI_DOWN, &vsi->state))\n \t\treturn;\n \n \tswitch (vsi->type) {\n@@ -6316,11 +6314,11 @@ static void i40e_link_event(struct i40e_pf *pf)\n \n \tif (new_link == old_link &&\n \t    new_link_speed == old_link_speed &&\n-\t    (test_bit(__I40E_DOWN, &vsi->state) ||\n+\t    (test_bit(__I40E_VSI_DOWN, &vsi->state) ||\n \t     new_link == netif_carrier_ok(vsi->netdev)))\n \t\treturn;\n \n-\tif (!test_bit(__I40E_DOWN, &vsi->state))\n+\tif (!test_bit(__I40E_VSI_DOWN, &vsi->state))\n \t\ti40e_print_link_message(vsi, new_link);\n \n \t/* Notify the base of the switch tree connected to\n@@ -7591,7 +7589,7 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type)\n \t}\n \tvsi->type = type;\n \tvsi->back = pf;\n-\tset_bit(__I40E_DOWN, &vsi->state);\n+\tset_bit(__I40E_VSI_DOWN, &vsi->state);\n \tvsi->flags = 0;\n \tvsi->idx = vsi_idx;\n \tvsi->int_rate_limit = 0;\n@@ -9718,7 +9716,7 @@ static int i40e_add_vsi(struct i40e_vsi *vsi)\n \t}\n \n \tvsi->active_filters = 0;\n-\tclear_bit(__I40E_FILTER_OVERFLOW_PROMISC, &vsi->state);\n+\tclear_bit(__I40E_VSI_OVERFLOW_PROMISC, &vsi->state);\n \tspin_lock_bh(&vsi->mac_filter_hash_lock);\n \t/* If macvlan filters already exist, force them to get loaded */\n \thash_for_each_safe(vsi->mac_filter_hash, bkt, h, f, hlist) {\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\nindex 1531a0f9fcc6..bbd21cbf3e4d 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c\n@@ -850,7 +850,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n \n \t\tif (budget &&\n \t\t    ((j / WB_STRIDE) == 0) && (j > 0) &&\n-\t\t    !test_bit(__I40E_DOWN, &vsi->state) &&\n+\t\t    !test_bit(__I40E_VSI_DOWN, &vsi->state) &&\n \t\t    (I40E_DESC_UNUSED(tx_ring) != tx_ring->count))\n \t\t\ttx_ring->arm_wb = true;\n \t}\n@@ -868,7 +868,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n \t\tsmp_mb();\n \t\tif (__netif_subqueue_stopped(tx_ring->netdev,\n \t\t\t\t\t     tx_ring->queue_index) &&\n-\t\t   !test_bit(__I40E_DOWN, &vsi->state)) {\n+\t\t   !test_bit(__I40E_VSI_DOWN, &vsi->state)) {\n \t\t\tnetif_wake_subqueue(tx_ring->netdev,\n \t\t\t\t\t    tx_ring->queue_index);\n \t\t\t++tx_ring->tx_stats.restart_queue;\n@@ -2179,7 +2179,7 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi,\n \t}\n \n enable_int:\n-\tif (!test_bit(__I40E_DOWN, &vsi->state))\n+\tif (!test_bit(__I40E_VSI_DOWN, &vsi->state))\n \t\twr32(hw, INTREG(vector - 1), txval);\n \n \tif (q_vector->itr_countdown)\n@@ -2208,7 +2208,7 @@ int i40e_napi_poll(struct napi_struct *napi, int budget)\n \tint budget_per_ring;\n \tint work_done = 0;\n \n-\tif (test_bit(__I40E_DOWN, &vsi->state)) {\n+\tif (test_bit(__I40E_VSI_DOWN, &vsi->state)) {\n \t\tnapi_complete(napi);\n \t\treturn 0;\n \t}\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\nindex 34e96d98251a..c95ee0a8950f 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c\n@@ -266,7 +266,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n \n \t\tif (budget &&\n \t\t    ((j / WB_STRIDE) == 0) && (j > 0) &&\n-\t\t    !test_bit(__I40E_DOWN, &vsi->state) &&\n+\t\t    !test_bit(__I40E_VSI_DOWN, &vsi->state) &&\n \t\t    (I40E_DESC_UNUSED(tx_ring) != tx_ring->count))\n \t\t\ttx_ring->arm_wb = true;\n \t}\n@@ -284,7 +284,7 @@ static bool i40e_clean_tx_irq(struct i40e_vsi *vsi,\n \t\tsmp_mb();\n \t\tif (__netif_subqueue_stopped(tx_ring->netdev,\n \t\t\t\t\t     tx_ring->queue_index) &&\n-\t\t   !test_bit(__I40E_DOWN, &vsi->state)) {\n+\t\t   !test_bit(__I40E_VSI_DOWN, &vsi->state)) {\n \t\t\tnetif_wake_subqueue(tx_ring->netdev,\n \t\t\t\t\t    tx_ring->queue_index);\n \t\t\t++tx_ring->tx_stats.restart_queue;\n@@ -1508,7 +1508,7 @@ static inline void i40e_update_enable_itr(struct i40e_vsi *vsi,\n \t}\n \n enable_int:\n-\tif (!test_bit(__I40E_DOWN, &vsi->state))\n+\tif (!test_bit(__I40E_VSI_DOWN, &vsi->state))\n \t\twr32(hw, INTREG(vector - 1), txval);\n \n \tif (q_vector->itr_countdown)\n@@ -1537,7 +1537,7 @@ int i40evf_napi_poll(struct napi_struct *napi, int budget)\n \tint budget_per_ring;\n \tint work_done = 0;\n \n-\tif (test_bit(__I40E_DOWN, &vsi->state)) {\n+\tif (test_bit(__I40E_VSI_DOWN, &vsi->state)) {\n \t\tnapi_complete(napi);\n \t\treturn 0;\n \t}\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf.h b/drivers/net/ethernet/intel/i40evf/i40evf.h\nindex 40f56e2335df..a56a6e54d907 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf.h\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf.h\n@@ -49,6 +49,11 @@\n #define DEFAULT_DEBUG_LEVEL_SHIFT 3\n #define PFX \"i40evf: \"\n \n+/* VSI state flags shared with common code */\n+enum i40evf_vsi_state_t {\n+\t__I40E_VSI_DOWN,\n+};\n+\n /* dummy struct to make common code less painful */\n struct i40e_vsi {\n \tstruct i40evf_adapter *back;\n@@ -168,8 +173,6 @@ enum i40evf_critical_section_t {\n \t__I40EVF_IN_CRITICAL_TASK,\t/* cannot be interrupted */\n \t__I40EVF_IN_CLIENT_TASK,\n };\n-/* make common code happy */\n-#define __I40E_DOWN __I40EVF_DOWN\n \n /* board specific private data structure */\n struct i40evf_adapter {\ndiff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\nindex 3ea81bd0db32..b453d05c2a30 100644\n--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c\n@@ -497,7 +497,7 @@ static void i40evf_netpoll(struct net_device *netdev)\n \tint i;\n \n \t/* if interface is down do nothing */\n-\tif (test_bit(__I40E_DOWN, &adapter->vsi.state))\n+\tif (test_bit(__I40E_VSI_DOWN, &adapter->vsi.state))\n \t\treturn;\n \n \tfor (i = 0; i < q_vectors; i++)\n@@ -1087,7 +1087,7 @@ static void i40evf_configure(struct i40evf_adapter *adapter)\n static void i40evf_up_complete(struct i40evf_adapter *adapter)\n {\n \tadapter->state = __I40EVF_RUNNING;\n-\tclear_bit(__I40E_DOWN, &adapter->vsi.state);\n+\tclear_bit(__I40E_VSI_DOWN, &adapter->vsi.state);\n \n \ti40evf_napi_enable_all(adapter);\n \n@@ -1753,7 +1753,7 @@ static void i40evf_disable_vf(struct i40evf_adapter *adapter)\n \tadapter->flags |= I40EVF_FLAG_PF_COMMS_FAILED;\n \n \tif (netif_running(adapter->netdev)) {\n-\t\tset_bit(__I40E_DOWN, &adapter->vsi.state);\n+\t\tset_bit(__I40E_VSI_DOWN, &adapter->vsi.state);\n \t\tnetif_carrier_off(adapter->netdev);\n \t\tnetif_tx_disable(adapter->netdev);\n \t\tadapter->link_up = false;\n@@ -2233,7 +2233,7 @@ static int i40evf_close(struct net_device *netdev)\n \t\treturn 0;\n \n \n-\tset_bit(__I40E_DOWN, &adapter->vsi.state);\n+\tset_bit(__I40E_VSI_DOWN, &adapter->vsi.state);\n \tif (CLIENT_ENABLED(adapter))\n \t\tadapter->flags |= I40EVF_FLAG_CLIENT_NEEDS_CLOSE;\n \n@@ -2674,7 +2674,7 @@ static void i40evf_init_task(struct work_struct *work)\n \t\tdev_info(&pdev->dev, \"GRO is enabled\\n\");\n \n \tadapter->state = __I40EVF_DOWN;\n-\tset_bit(__I40E_DOWN, &adapter->vsi.state);\n+\tset_bit(__I40E_VSI_DOWN, &adapter->vsi.state);\n \ti40evf_misc_irq_enable(adapter);\n \n \tadapter->rss_key = kzalloc(adapter->rss_key_size, GFP_KERNEL);\n",
    "prefixes": []
}