Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/747497/?format=api
{ "id": 747497, "url": "http://patchwork.ozlabs.org/api/patches/747497/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170405115103.67374-3-alice.michael@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": "<20170405115103.67374-3-alice.michael@intel.com>", "list_archive_url": null, "date": "2017-04-05T11:50:55", "name": "[next,S66,v2,03/11] i40e: Decrease the scope of rtnl lock", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "73ce262b67337965cd92bb40f4cccff3f3b778cd", "submitter": { "id": 71123, "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api", "name": "Michael, Alice", "email": "alice.michael@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/20170405115103.67374-3-alice.michael@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/747497/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/747497/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 whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 3vyxNr3Mkbz9s8c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 6 Apr 2017 05:53:48 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id EE9C386115;\n\tWed, 5 Apr 2017 19:53:46 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id iX8TQ8B8GYD5; Wed, 5 Apr 2017 19:53:44 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B84038618E;\n\tWed, 5 Apr 2017 19:53:44 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 8765D1C0100\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 5 Apr 2017 19:53:43 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 82E25885F5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 5 Apr 2017 19:53:43 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id iWYpUaIWFR2v for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 5 Apr 2017 19:53:42 +0000 (UTC)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 57E96885F2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 5 Apr 2017 19:53:42 +0000 (UTC)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t05 Apr 2017 12:53:42 -0700", "from unknown (HELO localhost.jf.intel.com) ([10.166.16.121])\n\tby orsmga003.jf.intel.com with ESMTP; 05 Apr 2017 12:53:42 -0700" ], "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" (0-bit key;\n\tunprotected) header.d=intel.com header.i=@intel.com\n\theader.b=\"LfFjdx2p\"; dkim-atps=neutral", "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple;\n\td=intel.com; i=@intel.com; q=dns/txt; s=intel;\n\tt=1491422022; x=1522958022;\n\th=from:to:cc:subject:date:message-id:in-reply-to: references;\n\tbh=k5Rl+eYjhQi6eKYysxexUhYCCzUzMm+8CgM2c4dPZ6g=;\n\tb=LfFjdx2pr3j4j8kDWvfqVh7Ojc9bYLujSXd+ZViFHIVSPVkeTM5QFPe3\n\tmkr9iYEHUtrdcQhHrPCdG8yWEzp2gQ==;", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.37,280,1488873600\"; d=\"scan'208\";a=\"952301564\"", "From": "Alice Michael <alice.michael@intel.com>", "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org", "Date": "Wed, 5 Apr 2017 07:50:55 -0400", "Message-Id": "<20170405115103.67374-3-alice.michael@intel.com>", "X-Mailer": "git-send-email 2.9.3", "In-Reply-To": "<20170405115103.67374-1-alice.michael@intel.com>", "References": "<20170405115103.67374-1-alice.michael@intel.com>", "Cc": "Maciej Sosin <maciej.sosin@intel.com>", "Subject": "[Intel-wired-lan] [next S66 v2 03/11] i40e: Decrease the scope of\n\trtnl lock", "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: Maciej Sosin <maciej.sosin@intel.com>\n\nPreviously rtnl lock was held during whole reset procedure that\nwas stoping other PFs running their reset procedures. In the result\nreset was not handled properly and host reset was the only way\nto recover.\n\nSigned-off-by: Maciej Sosin <maciej.sosin@intel.com>\nChange-ID: I23c0771c0303caaa7bd64badbf0c667e25142954\n---\n drivers/net/ethernet/intel/i40e/i40e.h | 2 +-\n drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 6 +-\n drivers/net/ethernet/intel/i40e/i40e_main.c | 138 +++++++++++++++++--------\n 3 files changed, 101 insertions(+), 45 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h\nindex 421ea57..686327c 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e.h\n@@ -837,7 +837,7 @@ void i40e_down(struct i40e_vsi *vsi);\n extern const char i40e_driver_name[];\n extern const char i40e_driver_version_str[];\n void i40e_do_reset_safe(struct i40e_pf *pf, u32 reset_flags);\n-void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags);\n+void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired);\n int i40e_config_rss(struct i40e_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);\n int i40e_get_rss(struct i40e_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size);\n void i40e_fill_rss_lut(struct i40e_pf *pf, u8 *lut,\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\nindex c0c1a0c..68c0f20 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c\n@@ -1852,7 +1852,7 @@ static void i40e_diag_test(struct net_device *netdev,\n \t\t\t * link then the following link test would have\n \t\t\t * to be moved to before the reset\n \t\t\t */\n-\t\t\ti40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED));\n+\t\t\ti40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED), true);\n \n \t\tif (i40e_link_test(netdev, &data[I40E_ETH_TEST_LINK]))\n \t\t\teth_test->flags |= ETH_TEST_FL_FAILED;\n@@ -1868,7 +1868,7 @@ static void i40e_diag_test(struct net_device *netdev,\n \t\t\teth_test->flags |= ETH_TEST_FL_FAILED;\n \n \t\tclear_bit(__I40E_TESTING, &pf->state);\n-\t\ti40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED));\n+\t\ti40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED), true);\n \n \t\tif (if_running)\n \t\t\ti40e_open(netdev);\n@@ -4099,7 +4099,7 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)\n \t */\n \tif ((changed_flags & I40E_FLAG_VEB_STATS_ENABLED) ||\n \t ((changed_flags & I40E_FLAG_LEGACY_RX) && netif_running(dev)))\n-\t\ti40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED));\n+\t\ti40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED), true);\n \n \treturn 0;\n }\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 86df489..3d85fc9 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -50,13 +50,16 @@ static const char i40e_copyright[] = \"Copyright (c) 2013 - 2014 Intel Corporatio\n \n /* a bit of forward declarations */\n static void i40e_vsi_reinit_locked(struct i40e_vsi *vsi);\n-static void i40e_handle_reset_warning(struct i40e_pf *pf);\n+static void i40e_handle_reset_warning(struct i40e_pf *pf, bool lock_acquired);\n static int i40e_add_vsi(struct i40e_vsi *vsi);\n static int i40e_add_veb(struct i40e_veb *veb, struct i40e_vsi *vsi);\n static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit);\n static int i40e_setup_misc_vector(struct i40e_pf *pf);\n static void i40e_determine_queue_usage(struct i40e_pf *pf);\n static int i40e_setup_pf_filter_control(struct i40e_pf *pf);\n+static void i40e_prep_for_reset(struct i40e_pf *pf, bool lock_acquired);\n+static int i40e_reset(struct i40e_pf *pf);\n+static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired);\n static void i40e_fdir_sb_setup(struct i40e_pf *pf);\n static int i40e_veb_get_bw_info(struct i40e_veb *veb);\n \n@@ -5528,6 +5531,8 @@ int i40e_open(struct net_device *netdev)\n * Finish initialization of the VSI.\n *\n * Returns 0 on success, negative value on failure\n+ *\n+ * Note: expects to be called while under rtnl_lock()\n **/\n int i40e_vsi_open(struct i40e_vsi *vsi)\n {\n@@ -5591,7 +5596,7 @@ int i40e_vsi_open(struct i40e_vsi *vsi)\n err_setup_tx:\n \ti40e_vsi_free_tx_resources(vsi);\n \tif (vsi == pf->vsi[pf->lan_vsi])\n-\t\ti40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED));\n+\t\ti40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED), true);\n \n \treturn err;\n }\n@@ -5677,12 +5682,14 @@ int i40e_close(struct net_device *netdev)\n * i40e_do_reset - Start a PF or Core Reset sequence\n * @pf: board private structure\n * @reset_flags: which reset is requested\n+ * @lock_acquired: indicates whether or not the lock has been acquired\n+ * before this function was called.\n *\n * The essential difference in resets is that the PF Reset\n * doesn't clear the packet buffers, doesn't reset the PE\n * firmware, and doesn't bother the other PFs on the chip.\n **/\n-void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)\n+void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags, bool lock_acquired)\n {\n \tu32 val;\n \n@@ -5728,7 +5735,7 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)\n \t\t * for the Core Reset.\n \t\t */\n \t\tdev_dbg(&pf->pdev->dev, \"PFR requested\\n\");\n-\t\ti40e_handle_reset_warning(pf);\n+\t\ti40e_handle_reset_warning(pf, lock_acquired);\n \n \t} else if (reset_flags & BIT_ULL(__I40E_REINIT_REQUESTED)) {\n \t\tint v;\n@@ -5937,7 +5944,7 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf,\n void i40e_do_reset_safe(struct i40e_pf *pf, u32 reset_flags)\n {\n \trtnl_lock();\n-\ti40e_do_reset(pf, reset_flags);\n+\ti40e_do_reset(pf, reset_flags, true);\n \trtnl_unlock();\n }\n \n@@ -6339,7 +6346,6 @@ static void i40e_reset_subtask(struct i40e_pf *pf)\n {\n \tu32 reset_flags = 0;\n \n-\trtnl_lock();\n \tif (test_bit(__I40E_REINIT_REQUESTED, &pf->state)) {\n \t\treset_flags |= BIT(__I40E_REINIT_REQUESTED);\n \t\tclear_bit(__I40E_REINIT_REQUESTED, &pf->state);\n@@ -6365,18 +6371,19 @@ static void i40e_reset_subtask(struct i40e_pf *pf)\n \t * precedence before starting a new reset sequence.\n \t */\n \tif (test_bit(__I40E_RESET_INTR_RECEIVED, &pf->state)) {\n-\t\ti40e_handle_reset_warning(pf);\n-\t\tgoto unlock;\n+\t\ti40e_prep_for_reset(pf, false);\n+\t\ti40e_reset(pf);\n+\t\ti40e_rebuild(pf, false, false);\n \t}\n \n \t/* If we're already down or resetting, just bail */\n \tif (reset_flags &&\n \t !test_bit(__I40E_DOWN, &pf->state) &&\n-\t !test_bit(__I40E_CONFIG_BUSY, &pf->state))\n-\t\ti40e_do_reset(pf, reset_flags);\n-\n-unlock:\n-\trtnl_unlock();\n+\t !test_bit(__I40E_CONFIG_BUSY, &pf->state)) {\n+\t\trtnl_lock();\n+\t\ti40e_do_reset(pf, reset_flags, true);\n+\t\trtnl_unlock();\n+\t}\n }\n \n /**\n@@ -6864,10 +6871,12 @@ static void i40e_fdir_teardown(struct i40e_pf *pf)\n /**\n * i40e_prep_for_reset - prep for the core to reset\n * @pf: board private structure\n+ * @lock_acquired: indicates whether or not the lock has been acquired\n+ * before this function was called.\n *\n * Close up the VFs and other things in prep for PF Reset.\n **/\n-static void i40e_prep_for_reset(struct i40e_pf *pf)\n+static void i40e_prep_for_reset(struct i40e_pf *pf, bool lock_acquired)\n {\n \tstruct i40e_hw *hw = &pf->hw;\n \ti40e_status ret = 0;\n@@ -6882,7 +6891,12 @@ static void i40e_prep_for_reset(struct i40e_pf *pf)\n \tdev_dbg(&pf->pdev->dev, \"Tearing down internal switch for reset\\n\");\n \n \t/* quiesce the VSIs and their queues that are not already DOWN */\n+\t/* pf_quiesce_all_vsi modifies netdev structures -rtnl_lock needed */\n+\tif (!lock_acquired)\n+\t\trtnl_lock();\n \ti40e_pf_quiesce_all_vsi(pf);\n+\tif (!lock_acquired)\n+\t\trtnl_unlock();\n \n \tfor (v = 0; v < pf->num_alloc_vsi; v++) {\n \t\tif (pf->vsi[v])\n@@ -6917,29 +6931,39 @@ static void i40e_send_version(struct i40e_pf *pf)\n }\n \n /**\n- * i40e_reset_and_rebuild - reset and rebuild using a saved config\n+ * i40e_reset - wait for core reset to finish reset, reset pf if corer not seen\n * @pf: board private structure\n- * @reinit: if the Main VSI needs to re-initialized.\n **/\n-static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)\n+static int i40e_reset(struct i40e_pf *pf)\n {\n \tstruct i40e_hw *hw = &pf->hw;\n-\tu8 set_fc_aq_fail = 0;\n \ti40e_status ret;\n-\tu32 val;\n-\tu32 v;\n \n-\t/* Now we wait for GRST to settle out.\n-\t * We don't have to delete the VEBs or VSIs from the hw switch\n-\t * because the reset will make them disappear.\n-\t */\n \tret = i40e_pf_reset(hw);\n \tif (ret) {\n \t\tdev_info(&pf->pdev->dev, \"PF reset failed, %d\\n\", ret);\n \t\tset_bit(__I40E_RESET_FAILED, &pf->state);\n-\t\tgoto clear_recovery;\n+\t\tclear_bit(__I40E_RESET_RECOVERY_PENDING, &pf->state);\n+\t} else {\n+\t\tpf->pfr_count++;\n \t}\n-\tpf->pfr_count++;\n+\treturn ret;\n+}\n+\n+/**\n+ * i40e_rebuild - rebuild using a saved config\n+ * @pf: board private structure\n+ * @reinit: if the Main VSI needs to re-initialized.\n+ * @lock_acquired: indicates whether or not the lock has been acquired\n+ * before this function was called.\n+ **/\n+static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)\n+{\n+\tstruct i40e_hw *hw = &pf->hw;\n+\tu8 set_fc_aq_fail = 0;\n+\ti40e_status ret;\n+\tu32 val;\n+\tint v;\n \n \tif (test_bit(__I40E_DOWN, &pf->state))\n \t\tgoto clear_recovery;\n@@ -6984,9 +7008,11 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)\n \t}\n #endif /* CONFIG_I40E_DCB */\n \t/* do basic switch setup */\n+\tif (!lock_acquired)\n+\t\trtnl_lock();\n \tret = i40e_setup_pf_switch(pf, reinit);\n \tif (ret)\n-\t\tgoto end_core_reset;\n+\t\tgoto end_unlock;\n \n \t/* The driver only wants link up/down and module qualification\n \t * reports from firmware. Note the negative logic.\n@@ -7057,7 +7083,7 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)\n \t\tif (ret) {\n \t\t\tdev_info(&pf->pdev->dev,\n \t\t\t\t \"rebuild of Main VSI failed: %d\\n\", ret);\n-\t\t\tgoto end_core_reset;\n+\t\t\tgoto end_unlock;\n \t\t}\n \t}\n \n@@ -7108,6 +7134,9 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)\n \t/* tell the firmware that we're starting */\n \ti40e_send_version(pf);\n \n+end_unlock:\n+if (!lock_acquired)\n+\trtnl_unlock();\n end_core_reset:\n \tclear_bit(__I40E_RESET_FAILED, &pf->state);\n clear_recovery:\n@@ -7115,16 +7144,38 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit)\n }\n \n /**\n+ * i40e_reset_and_rebuild - reset and rebuild using a saved config\n+ * @pf: board private structure\n+ * @reinit: if the Main VSI needs to re-initialized.\n+ * @lock_acquired: indicates whether or not the lock has been acquired\n+ * before this function was called.\n+ **/\n+static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit,\n+\t\t\t\t bool lock_acquired)\n+{\n+\tint ret;\n+\t/* Now we wait for GRST to settle out.\n+\t * We don't have to delete the VEBs or VSIs from the hw switch\n+\t * because the reset will make them disappear.\n+\t */\n+\tret = i40e_reset(pf);\n+\tif (!ret)\n+\t\ti40e_rebuild(pf, reinit, lock_acquired);\n+}\n+\n+/**\n * i40e_handle_reset_warning - prep for the PF to reset, reset and rebuild\n * @pf: board private structure\n *\n * Close up the VFs and other things in prep for a Core Reset,\n * then get ready to rebuild the world.\n+ * @lock_acquired: indicates whether or not the lock has been acquired\n+ * before this function was called.\n **/\n-static void i40e_handle_reset_warning(struct i40e_pf *pf)\n+static void i40e_handle_reset_warning(struct i40e_pf *pf, bool lock_acquired)\n {\n-\ti40e_prep_for_reset(pf);\n-\ti40e_reset_and_rebuild(pf, false);\n+\ti40e_prep_for_reset(pf, lock_acquired);\n+\ti40e_reset_and_rebuild(pf, false, lock_acquired);\n }\n \n /**\n@@ -8421,6 +8472,7 @@ static int i40e_pf_config_rss(struct i40e_pf *pf)\n *\n * returns 0 if rss is not enabled, if enabled returns the final rss queue\n * count which may be different from the requested queue count.\n+ * Note: expects to be called while under rtnl_lock()\n **/\n int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)\n {\n@@ -8436,11 +8488,11 @@ int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)\n \t\tu16 qcount;\n \n \t\tvsi->req_queue_pairs = queue_count;\n-\t\ti40e_prep_for_reset(pf);\n+\t\ti40e_prep_for_reset(pf, true);\n \n \t\tpf->alloc_rss_size = new_rss_size;\n \n-\t\ti40e_reset_and_rebuild(pf, true);\n+\t\ti40e_reset_and_rebuild(pf, true, true);\n \n \t\t/* Discard the user configured hash keys and lut, if less\n \t\t * queues are enabled.\n@@ -8816,6 +8868,7 @@ static void i40e_clear_rss_lut(struct i40e_vsi *vsi)\n * i40e_set_features - set the netdev feature flags\n * @netdev: ptr to the netdev being adjusted\n * @features: the feature set that the stack is suggesting\n+ * Note: expects to be called while under rtnl_lock()\n **/\n static int i40e_set_features(struct net_device *netdev,\n \t\t\t netdev_features_t features)\n@@ -8839,7 +8892,7 @@ static int i40e_set_features(struct net_device *netdev,\n \tneed_reset = i40e_set_ntuple(pf, features);\n \n \tif (need_reset)\n-\t\ti40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED));\n+\t\ti40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED), true);\n \n \treturn 0;\n }\n@@ -9034,6 +9087,8 @@ static int i40e_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],\n * is to change the mode then that requires a PF reset to\n * allow rebuild of the components with required hardware\n * bridge mode enabled.\n+ *\n+ * Note: expects to be called while under rtnl_lock()\n **/\n static int i40e_ndo_bridge_setlink(struct net_device *dev,\n \t\t\t\t struct nlmsghdr *nlh,\n@@ -9089,7 +9144,8 @@ static int i40e_ndo_bridge_setlink(struct net_device *dev,\n \t\t\t\tpf->flags |= I40E_FLAG_VEB_MODE_ENABLED;\n \t\t\telse\n \t\t\t\tpf->flags &= ~I40E_FLAG_VEB_MODE_ENABLED;\n-\t\t\ti40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED));\n+\t\t\ti40e_do_reset(pf, BIT_ULL(__I40E_PF_RESET_REQUESTED),\n+\t\t\t\t true);\n \t\t\tbreak;\n \t\t}\n \t}\n@@ -11494,7 +11550,7 @@ static pci_ers_result_t i40e_pci_error_detected(struct pci_dev *pdev,\n \t/* shutdown all operations */\n \tif (!test_bit(__I40E_SUSPENDED, &pf->state)) {\n \t\trtnl_lock();\n-\t\ti40e_prep_for_reset(pf);\n+\t\ti40e_prep_for_reset(pf, true);\n \t\trtnl_unlock();\n \t}\n \n@@ -11563,7 +11619,7 @@ static void i40e_pci_error_resume(struct pci_dev *pdev)\n \t\treturn;\n \n \trtnl_lock();\n-\ti40e_handle_reset_warning(pf);\n+\ti40e_handle_reset_warning(pf, true);\n \trtnl_unlock();\n }\n \n@@ -11626,7 +11682,7 @@ static void i40e_shutdown(struct pci_dev *pdev)\n \tset_bit(__I40E_SUSPENDED, &pf->state);\n \tset_bit(__I40E_DOWN, &pf->state);\n \trtnl_lock();\n-\ti40e_prep_for_reset(pf);\n+\ti40e_prep_for_reset(pf, true);\n \trtnl_unlock();\n \n \twr32(hw, I40E_PFPM_APM, (pf->wol_en ? I40E_PFPM_APM_APME_MASK : 0));\n@@ -11645,7 +11701,7 @@ static void i40e_shutdown(struct pci_dev *pdev)\n \t\ti40e_enable_mc_magic_wake(pf);\n \n \trtnl_lock();\n-\ti40e_prep_for_reset(pf);\n+\ti40e_prep_for_reset(pf, true);\n \trtnl_unlock();\n \n \twr32(hw, I40E_PFPM_APM,\n@@ -11679,7 +11735,7 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state)\n \t\ti40e_enable_mc_magic_wake(pf);\n \n \trtnl_lock();\n-\ti40e_prep_for_reset(pf);\n+\ti40e_prep_for_reset(pf, true);\n \trtnl_unlock();\n \n \twr32(hw, I40E_PFPM_APM, (pf->wol_en ? I40E_PFPM_APM_APME_MASK : 0));\n@@ -11727,7 +11783,7 @@ static int i40e_resume(struct pci_dev *pdev)\n \tif (test_and_clear_bit(__I40E_SUSPENDED, &pf->state)) {\n \t\tclear_bit(__I40E_DOWN, &pf->state);\n \t\trtnl_lock();\n-\t\ti40e_reset_and_rebuild(pf, false);\n+\t\ti40e_reset_and_rebuild(pf, false, true);\n \t\trtnl_unlock();\n \t}\n \n", "prefixes": [ "next", "S66", "v2", "03/11" ] }