get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 719279,
    "url": "http://patchwork.ozlabs.org/api/patches/719279/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1485282241-3579-3-git-send-email-bimmy.pujari@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": "<1485282241-3579-3-git-send-email-bimmy.pujari@intel.com>",
    "list_archive_url": null,
    "date": "2017-01-24T18:24:00",
    "name": "[next,S58-V3,3/4] i40e: KISS the client interface",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b1a3c7f4db47638e357969275dbf6496748acbb6",
    "submitter": {
        "id": 68919,
        "url": "http://patchwork.ozlabs.org/api/people/68919/?format=api",
        "name": "Pujari, Bimmy",
        "email": "bimmy.pujari@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/1485282241-3579-3-git-send-email-bimmy.pujari@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/719279/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/719279/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 3v7FTN5rcMz9s3T\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 25 Jan 2017 04:26:16 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 5F6A981125;\n\tTue, 24 Jan 2017 17:26:15 +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 sYzogVnVLlwG; Tue, 24 Jan 2017 17:26:11 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 20F72836AC;\n\tTue, 24 Jan 2017 17:26:11 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id D11931C0493\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 24 Jan 2017 17:26:07 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id C600A30A65\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 24 Jan 2017 17:26:07 +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 Wvkv-IxsUX-w for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 24 Jan 2017 17:25:59 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 0178D30A45\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 24 Jan 2017 17:25:58 +0000 (UTC)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n\tby fmsmga102.fm.intel.com with ESMTP; 24 Jan 2017 09:25:58 -0800",
            "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([134.134.2.167])\n\tby fmsmga004.fm.intel.com with ESMTP; 24 Jan 2017 09:25:58 -0800"
        ],
        "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.33,278,1477983600\"; d=\"scan'208\";a=\"217089096\"",
        "From": "Bimmy Pujari <bimmy.pujari@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 24 Jan 2017 10:24:00 -0800",
        "Message-Id": "<1485282241-3579-3-git-send-email-bimmy.pujari@intel.com>",
        "X-Mailer": "git-send-email 2.4.11",
        "In-Reply-To": "<1485282241-3579-1-git-send-email-bimmy.pujari@intel.com>",
        "References": "<1485282241-3579-1-git-send-email-bimmy.pujari@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S58-V3 3/4] i40e: KISS the client\n\tinterface",
        "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": "From: Mitch Williams <mitch.a.williams@intel.com>\n\n(KISS is Keep It Simple, Stupid. Or is it?)\n\nThe client interface vastly overengineered for what it needs to do.\nIt was originally designed to support multiple clients on multiple\nnetdevs, possibly even with multiple drivers. None of this happened,\nand now we know that there will only ever be one client for i40e\n(i40iw) and one for i40evf (i40iwvf). So, time for some KISS. Since\ni40e and i40evf are a Dynasty, we'll simplify this one to match the\nVF interface.\n\nFirst, be a Destroyer and remove all of the lists and locks required\nto support multiple clients. Keep one static around to keep track of\none client, and track the client instances for each netdev in the\ndriver's pf (or adapter) struct. Now it's Almost Human.\n\nSince we already know the client type is iWarp, get rid of any checks\nfor this. Same for VSI type - it's always going to be the same type,\nso it's just a Parasite.\n\nWhile we're at it, fix up some comments. This makes the function\nheaders actually match the functions.\n\nThese changes reduce code complexity, simplify maintenance,\nsquash some lurking timing bugs, and allow us to Rock and Roll All\nNite.\n\nSigned-off-by: Mitch Williams <mitch.a.williams@intel.com>\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nChange-ID: I1ea79948ad73b8685272451440a34507f9a9012e\n---\n drivers/net/ethernet/intel/i40e/i40e.h             |   8 +-\n drivers/net/ethernet/intel/i40e/i40e_client.c      | 457 +++++++--------------\n drivers/net/ethernet/intel/i40e/i40e_client.h      |   8 +-\n drivers/net/ethernet/intel/i40e/i40e_main.c        |  32 +-\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c |   2 +-\n 5 files changed, 179 insertions(+), 328 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 9b51026..e0668d4 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -387,8 +387,10 @@ struct i40e_pf {\n #define I40E_FLAG_TRUE_PROMISC_SUPPORT\t\tBIT_ULL(51)\n #define I40E_FLAG_HAVE_CRT_RETIMER\t\tBIT_ULL(52)\n #define I40E_FLAG_PTP_L4_CAPABLE\t\tBIT_ULL(53)\n-#define I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE\t\tBIT_ULL(54)\n+#define I40E_FLAG_CLIENT_RESET\t\t\tBIT_ULL(54)\n #define I40E_FLAG_TEMP_LINK_POLLING\t\tBIT_ULL(55)\n+#define I40E_FLAG_CLIENT_L2_CHANGE\t\tBIT_ULL(56)\n+#define I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE\t\tBIT_ULL(57)\n \n \t/* tracks features that get auto disabled by errors */\n \tu64 auto_disable_flags;\n@@ -397,6 +399,7 @@ struct i40e_pf {\n \tstruct i40e_fcoe fcoe;\n \n #endif /* I40E_FCOE */\n+\tstruct i40e_client_instance *cinst;\n \tbool stat_offsets_loaded;\n \tstruct i40e_hw_port_stats stats;\n \tstruct i40e_hw_port_stats stats_offsets;\n@@ -859,8 +862,7 @@ void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi);\n void i40e_notify_client_of_netdev_close(struct i40e_vsi *vsi, bool reset);\n void i40e_notify_client_of_vf_enable(struct i40e_pf *pf, u32 num_vfs);\n void i40e_notify_client_of_vf_reset(struct i40e_pf *pf, u32 vf_id);\n-int i40e_vf_client_capable(struct i40e_pf *pf, u32 vf_id,\n-\t\t\t   enum i40e_client_type type);\n+int i40e_vf_client_capable(struct i40e_pf *pf, u32 vf_id);\n /**\n  * i40e_irq_dynamic_enable - Enable default interrupt generation settings\n  * @vsi: pointer to a vsi\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c\nindex 09110d3..f2f05e3 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_client.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c\n@@ -32,16 +32,10 @@\n #include \"i40e_client.h\"\n \n static const char i40e_client_interface_version_str[] = I40E_CLIENT_VERSION_STR;\n-\n+static struct i40e_client *registered_client;\n static LIST_HEAD(i40e_devices);\n static DEFINE_MUTEX(i40e_device_mutex);\n \n-static LIST_HEAD(i40e_clients);\n-static DEFINE_MUTEX(i40e_client_mutex);\n-\n-static LIST_HEAD(i40e_client_instances);\n-static DEFINE_MUTEX(i40e_client_instance_mutex);\n-\n static int i40e_client_virtchnl_send(struct i40e_info *ldev,\n \t\t\t\t     struct i40e_client *client,\n \t\t\t\t     u32 vf_id, u8 *msg, u16 len);\n@@ -67,28 +61,6 @@ static struct i40e_ops i40e_lan_ops = {\n };\n \n /**\n- * i40e_client_type_to_vsi_type - convert client type to vsi type\n- * @client_type: the i40e_client type\n- *\n- * returns the related vsi type value\n- **/\n-static\n-enum i40e_vsi_type i40e_client_type_to_vsi_type(enum i40e_client_type type)\n-{\n-\tswitch (type) {\n-\tcase I40E_CLIENT_IWARP:\n-\t\treturn I40E_VSI_IWARP;\n-\n-\tcase I40E_CLIENT_VMDQ2:\n-\t\treturn I40E_VSI_VMDQ2;\n-\n-\tdefault:\n-\t\tpr_err(\"i40e: Client type unknown\\n\");\n-\t\treturn I40E_VSI_TYPE_UNKNOWN;\n-\t}\n-}\n-\n-/**\n  * i40e_client_get_params - Get the params that can change at runtime\n  * @vsi: the VSI with the message\n  * @param: clinet param struct\n@@ -134,31 +106,22 @@ int i40e_client_get_params(struct i40e_vsi *vsi, struct i40e_params *params)\n void\n i40e_notify_client_of_vf_msg(struct i40e_vsi *vsi, u32 vf_id, u8 *msg, u16 len)\n {\n-\tstruct i40e_client_instance *cdev;\n+\tstruct i40e_pf *pf = vsi->back;\n+\tstruct i40e_client_instance *cdev = pf->cinst;\n \n-\tif (!vsi)\n+\tif (!cdev || !cdev->client)\n+\t\treturn;\n+\tif (!cdev->client->ops || !cdev->client->ops->virtchnl_receive) {\n+\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\t\"Cannot locate client instance virtual channel receive routine\\n\");\n+\t\treturn;\n+\t}\n+\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {\n+\t\tdev_dbg(&pf->pdev->dev, \"Client is not open, abort virtchnl_receive\\n\");\n \t\treturn;\n-\tmutex_lock(&i40e_client_instance_mutex);\n-\tlist_for_each_entry(cdev, &i40e_client_instances, list) {\n-\t\tif (cdev->lan_info.pf == vsi->back) {\n-\t\t\tif (!cdev->client ||\n-\t\t\t    !cdev->client->ops ||\n-\t\t\t    !cdev->client->ops->virtchnl_receive) {\n-\t\t\t\tdev_dbg(&vsi->back->pdev->dev,\n-\t\t\t\t\t\"Cannot locate client instance virtual channel receive routine\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,\n-\t\t\t\t      &cdev->state)) {\n-\t\t\t\tdev_dbg(&vsi->back->pdev->dev, \"Client is not open, abort virtchnl_receive\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tcdev->client->ops->virtchnl_receive(&cdev->lan_info,\n-\t\t\t\t\t\t\t    cdev->client,\n-\t\t\t\t\t\t\t    vf_id, msg, len);\n-\t\t}\n \t}\n-\tmutex_unlock(&i40e_client_instance_mutex);\n+\tcdev->client->ops->virtchnl_receive(&cdev->lan_info, cdev->client,\n+\t\t\t\t\t    vf_id, msg, len);\n }\n \n /**\n@@ -169,39 +132,28 @@ i40e_notify_client_of_vf_msg(struct i40e_vsi *vsi, u32 vf_id, u8 *msg, u16 len)\n  **/\n void i40e_notify_client_of_l2_param_changes(struct i40e_vsi *vsi)\n {\n-\tstruct i40e_client_instance *cdev;\n+\tstruct i40e_pf *pf = vsi->back;\n+\tstruct i40e_client_instance *cdev = pf->cinst;\n \tstruct i40e_params params;\n \n-\tif (!vsi)\n+\tif (!cdev || !cdev->client)\n+\t\treturn;\n+\tif (!cdev->client->ops || !cdev->client->ops->l2_param_change) {\n+\t\tdev_dbg(&vsi->back->pdev->dev,\n+\t\t\t\"Cannot locate client instance l2_param_change routine\\n\");\n+\t\treturn;\n+\t}\n+\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {\n+\t\tdev_dbg(&vsi->back->pdev->dev, \"Client is not open, abort l2 param change\\n\");\n \t\treturn;\n-\tmutex_lock(&i40e_client_instance_mutex);\n-\tlist_for_each_entry(cdev, &i40e_client_instances, list) {\n-\t\tif (cdev->lan_info.pf == vsi->back) {\n-\t\t\tif (!cdev->client ||\n-\t\t\t    !cdev->client->ops ||\n-\t\t\t    !cdev->client->ops->l2_param_change) {\n-\t\t\t\tdev_dbg(&vsi->back->pdev->dev,\n-\t\t\t\t\t\"Cannot locate client instance l2_param_change routine\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\tmemset(&params, 0, sizeof(params));\n-\ti40e_client_get_params(vsi, &params);\n-\t\t\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,\n-\t\t\t\t      &cdev->state)) {\n-\t\t\t\tdev_dbg(&vsi->back->pdev->dev, \"Client is not open, abort l2 param change\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tcdev->lan_info.params = params;\n-\t\t\tcdev->client->ops->l2_param_change(&cdev->lan_info,\n-\t\t\t\t\t\t\t   cdev->client,\n-\t\t\t\t\t\t\t   &params);\n-\t\t}\n \t}\n-\tmutex_unlock(&i40e_client_instance_mutex);\n+\tmemcpy(&cdev->lan_info.params, &params, sizeof(struct i40e_params));\n+\tcdev->client->ops->l2_param_change(&cdev->lan_info, cdev->client,\n+\t\t\t\t\t   &params);\n }\n \n /**\n- * i40e_client_release_qvlist\n+ * i40e_client_release_qvlist - release MSI-X vector mapping for client\n  * @ldev: pointer to L2 context.\n  *\n  **/\n@@ -237,26 +189,19 @@ static void i40e_client_release_qvlist(struct i40e_info *ldev)\n  **/\n void i40e_notify_client_of_netdev_close(struct i40e_vsi *vsi, bool reset)\n {\n-\tstruct i40e_client_instance *cdev;\n+\tstruct i40e_pf *pf = vsi->back;\n+\tstruct i40e_client_instance *cdev = pf->cinst;\n \n-\tif (!vsi)\n+\tif (!cdev || !cdev->client)\n+\t\treturn;\n+\tif (!cdev->client->ops || !cdev->client->ops->close) {\n+\t\tdev_dbg(&vsi->back->pdev->dev,\n+\t\t\t\"Cannot locate client instance close routine\\n\");\n \t\treturn;\n-\tmutex_lock(&i40e_client_instance_mutex);\n-\tlist_for_each_entry(cdev, &i40e_client_instances, list) {\n-\t\tif (cdev->lan_info.netdev == vsi->netdev) {\n-\t\t\tif (!cdev->client ||\n-\t\t\t    !cdev->client->ops || !cdev->client->ops->close) {\n-\t\t\t\tdev_dbg(&vsi->back->pdev->dev,\n-\t\t\t\t\t\"Cannot locate client instance close routine\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tcdev->client->ops->close(&cdev->lan_info, cdev->client,\n-\t\t\t\t\t\t reset);\n-\t\t\tclear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);\n-\t\t\ti40e_client_release_qvlist(&cdev->lan_info);\n-\t\t}\n \t}\n-\tmutex_unlock(&i40e_client_instance_mutex);\n+\tcdev->client->ops->close(&cdev->lan_info, cdev->client, reset);\n+\tclear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state);\n+\ti40e_client_release_qvlist(&cdev->lan_info);\n }\n \n /**\n@@ -268,30 +213,20 @@ void i40e_notify_client_of_netdev_close(struct i40e_vsi *vsi, bool reset)\n  **/\n void i40e_notify_client_of_vf_reset(struct i40e_pf *pf, u32 vf_id)\n {\n-\tstruct i40e_client_instance *cdev;\n+\tstruct i40e_client_instance *cdev = pf->cinst;\n \n-\tif (!pf)\n+\tif (!cdev || !cdev->client)\n+\t\treturn;\n+\tif (!cdev->client->ops || !cdev->client->ops->vf_reset) {\n+\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\t\"Cannot locate client instance VF reset routine\\n\");\n+\t\treturn;\n+\t}\n+\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,  &cdev->state)) {\n+\t\tdev_dbg(&pf->pdev->dev, \"Client is not open, abort vf-reset\\n\");\n \t\treturn;\n-\tmutex_lock(&i40e_client_instance_mutex);\n-\tlist_for_each_entry(cdev, &i40e_client_instances, list) {\n-\t\tif (cdev->lan_info.pf == pf) {\n-\t\t\tif (!cdev->client ||\n-\t\t\t    !cdev->client->ops ||\n-\t\t\t    !cdev->client->ops->vf_reset) {\n-\t\t\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\t\t\"Cannot locate client instance VF reset routine\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,\n-\t\t\t\t      &cdev->state)) {\n-\t\t\t\tdev_dbg(&pf->pdev->dev, \"Client is not open, abort vf-reset\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tcdev->client->ops->vf_reset(&cdev->lan_info,\n-\t\t\t\t\t\t    cdev->client, vf_id);\n-\t\t}\n \t}\n-\tmutex_unlock(&i40e_client_instance_mutex);\n+\tcdev->client->ops->vf_reset(&cdev->lan_info, cdev->client, vf_id);\n }\n \n /**\n@@ -303,30 +238,21 @@ void i40e_notify_client_of_vf_reset(struct i40e_pf *pf, u32 vf_id)\n  **/\n void i40e_notify_client_of_vf_enable(struct i40e_pf *pf, u32 num_vfs)\n {\n-\tstruct i40e_client_instance *cdev;\n+\tstruct i40e_client_instance *cdev = pf->cinst;\n \n-\tif (!pf)\n+\tif (!cdev || !cdev->client)\n+\t\treturn;\n+\tif (!cdev->client->ops || !cdev->client->ops->vf_enable) {\n+\t\tdev_dbg(&pf->pdev->dev,\n+\t\t\t\"Cannot locate client instance VF enable routine\\n\");\n+\t\treturn;\n+\t}\n+\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,\n+\t\t      &cdev->state)) {\n+\t\tdev_dbg(&pf->pdev->dev, \"Client is not open, abort vf-enable\\n\");\n \t\treturn;\n-\tmutex_lock(&i40e_client_instance_mutex);\n-\tlist_for_each_entry(cdev, &i40e_client_instances, list) {\n-\t\tif (cdev->lan_info.pf == pf) {\n-\t\t\tif (!cdev->client ||\n-\t\t\t    !cdev->client->ops ||\n-\t\t\t    !cdev->client->ops->vf_enable) {\n-\t\t\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\t\t\"Cannot locate client instance VF enable routine\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,\n-\t\t\t\t      &cdev->state)) {\n-\t\t\t\tdev_dbg(&pf->pdev->dev, \"Client is not open, abort vf-enable\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tcdev->client->ops->vf_enable(&cdev->lan_info,\n-\t\t\t\t\t\t     cdev->client, num_vfs);\n-\t\t}\n \t}\n-\tmutex_unlock(&i40e_client_instance_mutex);\n+\tcdev->client->ops->vf_enable(&cdev->lan_info, cdev->client, num_vfs);\n }\n \n /**\n@@ -337,37 +263,25 @@ void i40e_notify_client_of_vf_enable(struct i40e_pf *pf, u32 num_vfs)\n  * If there is a client of the specified type attached to this PF, call\n  * its vf_capable routine\n  **/\n-int i40e_vf_client_capable(struct i40e_pf *pf, u32 vf_id,\n-\t\t\t   enum i40e_client_type type)\n+int i40e_vf_client_capable(struct i40e_pf *pf, u32 vf_id)\n {\n-\tstruct i40e_client_instance *cdev;\n+\tstruct i40e_client_instance *cdev = pf->cinst;\n \tint capable = false;\n \n-\tif (!pf)\n-\t\treturn false;\n-\tmutex_lock(&i40e_client_instance_mutex);\n-\tlist_for_each_entry(cdev, &i40e_client_instances, list) {\n-\t\tif (cdev->lan_info.pf == pf) {\n-\t\t\tif (!cdev->client ||\n-\t\t\t    !cdev->client->ops ||\n-\t\t\t    !cdev->client->ops->vf_capable ||\n-\t\t\t    !(cdev->client->type == type)) {\n-\t\t\t\tdev_dbg(&pf->pdev->dev,\n-\t\t\t\t\t\"Cannot locate client instance VF capability routine\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,\n-\t\t\t\t      &cdev->state)) {\n-\t\t\t\tdev_dbg(&pf->pdev->dev, \"Client is not open, abort vf-capable\\n\");\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\tcapable = cdev->client->ops->vf_capable(&cdev->lan_info,\n-\t\t\t\t\t\t\t\tcdev->client,\n-\t\t\t\t\t\t\t\tvf_id);\n-\t\t\tbreak;\n-\t\t}\n+\tif (!cdev || !cdev->client)\n+\t\tgoto out;\n+\tif (!cdev->client->ops || !cdev->client->ops->vf_capable) {\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"Cannot locate client instance VF capability routine\\n\");\n+\t\tgoto out;\n \t}\n-\tmutex_unlock(&i40e_client_instance_mutex);\n+\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state))\n+\t\tgoto out;\n+\n+\tcapable = cdev->client->ops->vf_capable(&cdev->lan_info,\n+\t\t\t\t\t\tcdev->client,\n+\t\t\t\t\t\tvf_id);\n+out:\n \treturn capable;\n }\n \n@@ -377,27 +291,19 @@ int i40e_vf_client_capable(struct i40e_pf *pf, u32 vf_id,\n  * @client: pointer to a client struct in the client list.\n  * @existing: if there was already an existing instance\n  *\n- * Returns cdev ptr on success or if already exists, NULL on failure\n  **/\n-static\n-struct i40e_client_instance *i40e_client_add_instance(struct i40e_pf *pf,\n-\t\t\t\t\t\t     struct i40e_client *client,\n-\t\t\t\t\t\t     bool *existing)\n+static void i40e_client_add_instance(struct i40e_pf *pf)\n {\n-\tstruct i40e_client_instance *cdev;\n+\tstruct i40e_client_instance *cdev = NULL;\n \tstruct netdev_hw_addr *mac = NULL;\n \tstruct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];\n \n-\tmutex_lock(&i40e_client_instance_mutex);\n-\tlist_for_each_entry(cdev, &i40e_client_instances, list) {\n-\t\tif ((cdev->lan_info.pf == pf) && (cdev->client == client)) {\n-\t\t\t*existing = true;\n-\t\t\tgoto out;\n-\t\t}\n-\t}\n+\tif (!registered_client || pf->cinst)\n+\t\treturn;\n+\n \tcdev = kzalloc(sizeof(*cdev), GFP_KERNEL);\n \tif (!cdev)\n-\t\tgoto out;\n+\t\treturn;\n \n \tcdev->lan_info.pf = (void *)pf;\n \tcdev->lan_info.netdev = vsi->netdev;\n@@ -417,7 +323,7 @@ struct i40e_client_instance *i40e_client_add_instance(struct i40e_pf *pf,\n \tif (i40e_client_get_params(vsi, &cdev->lan_info.params)) {\n \t\tkfree(cdev);\n \t\tcdev = NULL;\n-\t\tgoto out;\n+\t\treturn;\n \t}\n \n \tcdev->lan_info.msix_count = pf->num_iwarp_msix;\n@@ -430,41 +336,20 @@ struct i40e_client_instance *i40e_client_add_instance(struct i40e_pf *pf,\n \telse\n \t\tdev_err(&pf->pdev->dev, \"MAC address list is empty!\\n\");\n \n-\tcdev->client = client;\n-\tINIT_LIST_HEAD(&cdev->list);\n-\tlist_add(&cdev->list, &i40e_client_instances);\n-out:\n-\tmutex_unlock(&i40e_client_instance_mutex);\n-\treturn cdev;\n+\tcdev->client = registered_client;\n+\tpf->cinst = cdev;\n }\n \n /**\n  * i40e_client_del_instance - removes a client instance from the list\n  * @pf: pointer to the board struct\n  *\n- * Returns 0 on success or non-0 on error\n  **/\n static\n-int i40e_client_del_instance(struct i40e_pf *pf, struct i40e_client *client)\n+void i40e_client_del_instance(struct i40e_pf *pf)\n {\n-\tstruct i40e_client_instance *cdev, *tmp;\n-\tint ret = -ENODEV;\n-\n-\tmutex_lock(&i40e_client_instance_mutex);\n-\tlist_for_each_entry_safe(cdev, tmp, &i40e_client_instances, list) {\n-\t\tif ((cdev->lan_info.pf != pf) || (cdev->client != client))\n-\t\t\tcontinue;\n-\n-\t\tdev_info(&pf->pdev->dev, \"Deleted instance of Client %s, of dev %d bus=0x%02x func=0x%02x)\\n\",\n-\t\t\t client->name, pf->hw.pf_id,\n-\t\t\t pf->hw.bus.device, pf->hw.bus.func);\n-\t\tlist_del(&cdev->list);\n-\t\tkfree(cdev);\n-\t\tret = 0;\n-\t\tbreak;\n-\t}\n-\tmutex_unlock(&i40e_client_instance_mutex);\n-\treturn ret;\n+\tkfree(pf->cinst);\n+\tpf->cinst = NULL;\n }\n \n /**\n@@ -473,67 +358,50 @@ int i40e_client_del_instance(struct i40e_pf *pf, struct i40e_client *client)\n  **/\n void i40e_client_subtask(struct i40e_pf *pf)\n {\n+\tstruct i40e_client *client = registered_client;\n \tstruct i40e_client_instance *cdev;\n-\tstruct i40e_client *client;\n-\tbool existing = false;\n+\tstruct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];\n \tint ret = 0;\n \n \tif (!(pf->flags & I40E_FLAG_SERVICE_CLIENT_REQUESTED))\n \t\treturn;\n \tpf->flags &= ~I40E_FLAG_SERVICE_CLIENT_REQUESTED;\n+\tcdev = pf->cinst;\n \n \t/* If we're down or resetting, just bail */\n \tif (test_bit(__I40E_DOWN, &pf->state) ||\n \t    test_bit(__I40E_CONFIG_BUSY, &pf->state))\n \t\treturn;\n \n-\t/* Check client state and instantiate client if client registered */\n-\tmutex_lock(&i40e_client_mutex);\n-\tlist_for_each_entry(client, &i40e_clients, list) {\n-\t\t/* first check client is registered */\n-\t\tif (!test_bit(__I40E_CLIENT_REGISTERED, &client->state))\n-\t\t\tcontinue;\n-\n-\t\t/* Do we also need the LAN VSI to be up, to create instance */\n-\t\tif (!(client->flags & I40E_CLIENT_FLAGS_LAUNCH_ON_PROBE)) {\n-\t\t\t/* check if L2 VSI is up, if not we are not ready */\n-\t\t\tif (test_bit(__I40E_DOWN, &pf->vsi[pf->lan_vsi]->state))\n-\t\t\t\tcontinue;\n-\t\t} else {\n-\t\t\tdev_warn(&pf->pdev->dev, \"This client %s is being instantiated at probe\\n\",\n-\t\t\t\t client->name);\n-\t\t}\n-\n-\t\t/* Add the client instance to the instance list */\n-\t\tcdev = i40e_client_add_instance(pf, client, &existing);\n-\t\tif (!cdev)\n-\t\t\tcontinue;\n-\n-\t\tif (!existing) {\n-\t\t\tdev_info(&pf->pdev->dev, \"Added instance of Client %s to PF%d bus=0x%02x dev=0x%02x func=0x%02x\\n\",\n-\t\t\t\t client->name, pf->hw.pf_id,\n-\t\t\t\t pf->hw.bus.bus_id, pf->hw.bus.device,\n-\t\t\t\t pf->hw.bus.func);\n-\t\t}\n+\tif (!client || !cdev)\n+\t\treturn;\n \n-\t\tmutex_lock(&i40e_client_instance_mutex);\n-\t\tif (!test_bit(__I40E_CLIENT_INSTANCE_OPENED,\n-\t\t\t      &cdev->state)) {\n-\t\t\t/* Send an Open request to the client */\n-\t\t\tif (client->ops && client->ops->open)\n-\t\t\t\tret = client->ops->open(&cdev->lan_info,\n-\t\t\t\t\t\t\tclient);\n-\t\t\tif (!ret) {\n-\t\t\t\tset_bit(__I40E_CLIENT_INSTANCE_OPENED,\n-\t\t\t\t\t&cdev->state);\n-\t\t\t} else {\n-\t\t\t\t/* remove client instance */\n-\t\t\t\ti40e_client_del_instance(pf, client);\n+\t/* Here we handle client opens. If the client is down, but\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\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+\t\t\tif (ret) {\n+\t\t\t\t/* Remove failed client instance */\n+\t\t\t\tclear_bit(__I40E_CLIENT_INSTANCE_OPENED,\n+\t\t\t\t\t  &cdev->state);\n+\t\t\t\ti40e_client_del_instance(pf);\n \t\t\t}\n \t\t}\n-\t\tmutex_unlock(&i40e_client_instance_mutex);\n+\t} else {\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\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);\n+\t\t\ti40e_client_release_qvlist(&cdev->lan_info);\n+\t\t}\n \t}\n-\tmutex_unlock(&i40e_client_mutex);\n }\n \n /**\n@@ -601,7 +469,6 @@ int i40e_lan_del_device(struct i40e_pf *pf)\n \t\t\tbreak;\n \t\t}\n \t}\n-\n \tmutex_unlock(&i40e_device_mutex);\n \treturn ret;\n }\n@@ -610,22 +477,24 @@ int i40e_lan_del_device(struct i40e_pf *pf)\n  * i40e_client_release - release client specific resources\n  * @client: pointer to the registered client\n  *\n- * Return 0 on success or < 0 on error\n  **/\n-static int i40e_client_release(struct i40e_client *client)\n+static void i40e_client_release(struct i40e_client *client)\n {\n-\tstruct i40e_client_instance *cdev, *tmp;\n+\tstruct i40e_client_instance *cdev;\n+\tstruct i40e_device *ldev;\n \tstruct i40e_pf *pf;\n-\tint ret = 0;\n \n-\tLIST_HEAD(cdevs_tmp);\n-\n-\tmutex_lock(&i40e_client_instance_mutex);\n-\tlist_for_each_entry_safe(cdev, tmp, &i40e_client_instances, list) {\n-\t\tif (strncmp(cdev->client->name, client->name,\n-\t\t\t    I40E_CLIENT_STR_LENGTH))\n+\tmutex_lock(&i40e_device_mutex);\n+\tlist_for_each_entry(ldev, &i40e_devices, list) {\n+\t\tpf = ldev->pf;\n+\t\tcdev = pf->cinst;\n+\t\tif (!cdev)\n \t\t\tcontinue;\n-\t\tpf = (struct i40e_pf *)cdev->lan_info.pf;\n+\n+\t\twhile (test_and_set_bit(__I40E_SERVICE_SCHED,\n+\t\t\t\t\t&pf->state))\n+\t\t\tusleep_range(500, 1000);\n+\n \t\tif (test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) {\n \t\t\tif (client->ops && client->ops->close)\n \t\t\t\tclient->ops->close(&cdev->lan_info, client,\n@@ -637,18 +506,13 @@ static int i40e_client_release(struct i40e_client *client)\n \t\t\t\t \"Client %s instance for PF id %d closed\\n\",\n \t\t\t\t client->name, pf->hw.pf_id);\n \t\t}\n-\t\t/* delete the client instance from the list */\n-\t\tlist_move(&cdev->list, &cdevs_tmp);\n+\t\t/* delete the client instance */\n+\t\ti40e_client_del_instance(pf);\n \t\tdev_info(&pf->pdev->dev, \"Deleted client instance of Client %s\\n\",\n \t\t\t client->name);\n+\t\tclear_bit(__I40E_SERVICE_SCHED, &pf->state);\n \t}\n-\tmutex_unlock(&i40e_client_instance_mutex);\n-\n-\t/* free the client device and release its vsi */\n-\tlist_for_each_entry_safe(cdev, tmp, &cdevs_tmp, list) {\n-\t\tkfree(cdev);\n-\t}\n-\treturn ret;\n+\tmutex_unlock(&i40e_device_mutex);\n }\n \n /**\n@@ -664,6 +528,7 @@ static void i40e_client_prepare(struct i40e_client *client)\n \tmutex_lock(&i40e_device_mutex);\n \tlist_for_each_entry(ldev, &i40e_devices, list) {\n \t\tpf = ldev->pf;\n+\t\ti40e_client_add_instance(pf);\n \t\t/* Start the client subtask */\n \t\tpf->flags |= I40E_FLAG_SERVICE_CLIENT_REQUESTED;\n \t\ti40e_service_event_schedule(pf);\n@@ -792,8 +657,8 @@ static void i40e_client_request_reset(struct i40e_info *ldev,\n \t\tbreak;\n \tdefault:\n \t\tdev_warn(&pf->pdev->dev,\n-\t\t\t \"Client %s instance for PF id %d request an unsupported reset: %d.\\n\",\n-\t\t\t client->name, pf->hw.pf_id, reset_level);\n+\t\t\t \"Client for PF id %d requested an unsupported reset: %d.\\n\",\n+\t\t\t pf->hw.pf_id, reset_level);\n \t\tbreak;\n \t}\n \n@@ -852,8 +717,8 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev,\n \t} else {\n \t\tupdate = false;\n \t\tdev_warn(&pf->pdev->dev,\n-\t\t\t \"Client %s instance for PF id %d request an unsupported Config: %x.\\n\",\n-\t\t\t client->name, pf->hw.pf_id, flag);\n+\t\t\t \"Client for PF id %d request an unsupported Config: %x.\\n\",\n+\t\t\t pf->hw.pf_id, flag);\n \t}\n \n \tif (update) {\n@@ -878,7 +743,6 @@ static int i40e_client_update_vsi_ctxt(struct i40e_info *ldev,\n int i40e_register_client(struct i40e_client *client)\n {\n \tint ret = 0;\n-\tenum i40e_vsi_type vsi_type;\n \n \tif (!client) {\n \t\tret = -EIO;\n@@ -891,11 +755,9 @@ int i40e_register_client(struct i40e_client *client)\n \t\tgoto out;\n \t}\n \n-\tmutex_lock(&i40e_client_mutex);\n-\tif (i40e_client_is_registered(client)) {\n+\tif (registered_client) {\n \t\tpr_info(\"i40e: Client %s has already been registered!\\n\",\n \t\t\tclient->name);\n-\t\tmutex_unlock(&i40e_client_mutex);\n \t\tret = -EEXIST;\n \t\tgoto out;\n \t}\n@@ -908,22 +770,11 @@ int i40e_register_client(struct i40e_client *client)\n \t\t\tclient->version.major, client->version.minor,\n \t\t\tclient->version.build,\n \t\t\ti40e_client_interface_version_str);\n-\t\tmutex_unlock(&i40e_client_mutex);\n \t\tret = -EIO;\n \t\tgoto out;\n \t}\n \n-\tvsi_type = i40e_client_type_to_vsi_type(client->type);\n-\tif (vsi_type == I40E_VSI_TYPE_UNKNOWN) {\n-\t\tpr_info(\"i40e: Failed to register client %s due to unknown client type %d\\n\",\n-\t\t\tclient->name, client->type);\n-\t\tmutex_unlock(&i40e_client_mutex);\n-\t\tret = -EIO;\n-\t\tgoto out;\n-\t}\n-\tlist_add(&client->list, &i40e_clients);\n-\tset_bit(__I40E_CLIENT_REGISTERED, &client->state);\n-\tmutex_unlock(&i40e_client_mutex);\n+\tregistered_client = client;\n \n \ti40e_client_prepare(client);\n \n@@ -943,29 +794,21 @@ int i40e_unregister_client(struct i40e_client *client)\n {\n \tint ret = 0;\n \n-\t/* When a unregister request comes through we would have to send\n-\t * a close for each of the client instances that were opened.\n-\t * client_release function is called to handle this.\n-\t */\n-\tmutex_lock(&i40e_client_mutex);\n-\tif (!client || i40e_client_release(client)) {\n-\t\tret = -EIO;\n-\t\tgoto out;\n-\t}\n-\n-\t/* TODO: check if device is in reset, or if that matters? */\n-\tif (!i40e_client_is_registered(client)) {\n+\tif (registered_client != client) {\n \t\tpr_info(\"i40e: Client %s has not been registered\\n\",\n \t\t\tclient->name);\n \t\tret = -ENODEV;\n \t\tgoto out;\n \t}\n-\tclear_bit(__I40E_CLIENT_REGISTERED, &client->state);\n-\tlist_del(&client->list);\n-\tpr_info(\"i40e: Unregistered client %s with return code %d\\n\",\n-\t\tclient->name, ret);\n+\tregistered_client = NULL;\n+\t/* When a unregister request comes through we would have to send\n+\t * a close for each of the client instances that were opened.\n+\t * client_release function is called to handle this.\n+\t */\n+\ti40e_client_release(client);\n+\n+\tpr_info(\"i40e: Unregistered client %s\\n\", client->name);\n out:\n-\tmutex_unlock(&i40e_client_mutex);\n \treturn ret;\n }\n EXPORT_SYMBOL(i40e_unregister_client);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_client.h b/drivers/net/ethernet/intel/i40e/i40e_client.h\nindex 528bd79..15b21a5 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_client.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_client.h\n@@ -57,11 +57,6 @@ enum i40e_client_instance_state {\n \t__I40E_CLIENT_INSTANCE_OPENED,\n };\n \n-enum i40e_client_type {\n-\tI40E_CLIENT_IWARP,\n-\tI40E_CLIENT_VMDQ2\n-};\n-\n struct i40e_ops;\n struct i40e_client;\n \n@@ -214,7 +209,8 @@ struct i40e_client {\n \tu32 flags;\n #define I40E_CLIENT_FLAGS_LAUNCH_ON_PROBE\tBIT(0)\n #define I40E_TX_FLAGS_NOTIFY_OTHER_EVENTS\tBIT(2)\n-\tenum i40e_client_type type;\n+\tu8 type;\n+#define I40E_CLIENT_IWARP 0\n \tconst struct i40e_client_ops *ops; /* client ops provided by the client */\n };\n \ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex b685b55..ad7b9ba 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -2500,6 +2500,7 @@ static int i40e_change_mtu(struct net_device *netdev, int new_mtu)\n {\n \tstruct i40e_netdev_priv *np = netdev_priv(netdev);\n \tstruct i40e_vsi *vsi = np->vsi;\n+\tstruct i40e_pf *pf = vsi->back;\n \n \tif (i40e_enabled_xdp_vsi(vsi)) {\n \t\tint max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;\n@@ -2513,7 +2514,8 @@ static int i40e_change_mtu(struct net_device *netdev, int new_mtu)\n \tnetdev->mtu = new_mtu;\n \tif (netif_running(netdev))\n \t\ti40e_vsi_reinit_locked(vsi);\n-\ti40e_notify_client_of_l2_param_changes(vsi);\n+\tpf->flags |= (I40E_FLAG_SERVICE_CLIENT_REQUESTED |\n+\t\t      I40E_FLAG_CLIENT_L2_CHANGE);\n \treturn 0;\n }\n \n@@ -4590,17 +4592,16 @@ static void i40e_napi_disable_all(struct i40e_vsi *vsi)\n  **/\n static void i40e_vsi_close(struct i40e_vsi *vsi)\n {\n-\tbool reset = false;\n-\n+\tstruct i40e_pf *pf = vsi->back;\n \tif (!test_and_set_bit(__I40E_DOWN, &vsi->state))\n \t\ti40e_down(vsi);\n \ti40e_vsi_free_irq(vsi);\n \ti40e_vsi_free_tx_resources(vsi);\n \ti40e_vsi_free_rx_resources(vsi);\n \tvsi->current_netdev_flags = 0;\n-\tif (test_bit(__I40E_RESET_RECOVERY_PENDING, &vsi->back->state))\n-\t\treset = true;\n-\ti40e_notify_client_of_netdev_close(vsi, reset);\n+\tpf->flags |= I40E_FLAG_SERVICE_CLIENT_REQUESTED;\n+\tif (test_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state))\n+\t\tpf->flags |=  I40E_FLAG_CLIENT_RESET;\n }\n \n /**\n@@ -5684,8 +5685,6 @@ void i40e_down(struct i40e_vsi *vsi)\n \t\ti40e_clean_rx_ring(vsi->rx_rings[i]);\n \t}\n \n-\ti40e_notify_client_of_netdev_close(vsi, false);\n-\n }\n \n /**\n@@ -6182,8 +6181,8 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,\n \t\ti40e_service_event_schedule(pf);\n \t} else {\n \t\ti40e_pf_unquiesce_all_vsi(pf);\n-\t\t/* Notify the client for the DCB changes */\n-\t\ti40e_notify_client_of_l2_param_changes(pf->vsi[pf->lan_vsi]);\n+\tpf->flags |= (I40E_FLAG_SERVICE_CLIENT_REQUESTED |\n+\t\t      I40E_FLAG_CLIENT_L2_CHANGE);\n \t}\n \n exit:\n@@ -7573,7 +7572,18 @@ static void i40e_service_task(struct work_struct *work)\n \ti40e_vc_process_vflr_event(pf);\n \ti40e_watchdog_subtask(pf);\n \ti40e_fdir_reinit_subtask(pf);\n-\ti40e_client_subtask(pf);\n+\tif (pf->flags & I40E_FLAG_CLIENT_RESET) {\n+\t\t/* Client subtask will reopen next time through. */\n+\t\ti40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], true);\n+\t\tpf->flags &= ~I40E_FLAG_CLIENT_RESET;\n+\t} else {\n+\t\ti40e_client_subtask(pf);\n+\t\tif (pf->flags & I40E_FLAG_CLIENT_L2_CHANGE) {\n+\t\t\ti40e_notify_client_of_l2_param_changes(\n+\t\t\t\t\t\t\tpf->vsi[pf->lan_vsi]);\n+\t\t\tpf->flags &= ~I40E_FLAG_CLIENT_L2_CHANGE;\n+\t\t}\n+\t}\n \ti40e_sync_filters_subtask(pf);\n \ti40e_sync_udp_filters_subtask(pf);\n \ti40e_clean_adminq_subtask(pf);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex cbbf864..5b08fb9 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -1361,7 +1361,7 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf, u8 *msg)\n \tif (!vsi->info.pvid)\n \t\tvfres->vf_offload_flags |= I40E_VIRTCHNL_VF_OFFLOAD_VLAN;\n \n-\tif (i40e_vf_client_capable(pf, vf->vf_id, I40E_CLIENT_IWARP) &&\n+\tif (i40e_vf_client_capable(pf, vf->vf_id) &&\n \t    (vf->driver_caps & I40E_VIRTCHNL_VF_OFFLOAD_IWARP)) {\n \t\tvfres->vf_offload_flags |= I40E_VIRTCHNL_VF_OFFLOAD_IWARP;\n \t\tset_bit(I40E_VF_STAT_IWARPENA, &vf->vf_states);\n",
    "prefixes": [
        "next",
        "S58-V3",
        "3/4"
    ]
}