]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Refactor bnxt_close_nic().
authorMichael Chan <michael.chan@broadcom.com>
Wed, 17 Jan 2018 08:21:04 +0000 (03:21 -0500)
committerJack Vogel <jack.vogel@oracle.com>
Fri, 9 Mar 2018 05:04:22 +0000 (21:04 -0800)
Orabug: 2764835527648339

Add a new __bnxt_close_nic() function to do all the work previously done
in bnxt_close_nic() except waiting for SRIOV configuration.  The new
function will be used in the next patch as part of SRIOV cleanup.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 86e953db0114f396f916344395160aa267bf2627)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Conflicts:
drivers/net/ethernet/broadcom/bnxt/bnxt.c

drivers/net/ethernet/broadcom/bnxt/bnxt.c

index e08f54c597493c5c3e5954cabb19e735b05bf074..bcf581917a22b79d2ca45fa79f7390c1ba5124f2 100644 (file)
@@ -6413,19 +6413,11 @@ static int bnxt_open(struct net_device *dev)
        return __bnxt_open_nic(bp, true, true);
 }
 
-int bnxt_close_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
-{
-       int rc = 0;
 
-#ifdef CONFIG_BNXT_SRIOV
-       if (bp->sriov_cfg) {
-               rc = wait_event_interruptible_timeout(bp->sriov_cfg_wait,
-                                                     !bp->sriov_cfg,
-                                                     BNXT_SRIOV_CFG_WAIT_TMO);
-               if (rc)
-                       netdev_warn(bp->dev, "timeout waiting for SRIOV config operation to complete!\n");
-       }
-#endif
+
+static void __bnxt_close_nic(struct bnxt *bp, bool irq_re_init,
+                            bool link_re_init)
+{
        /* Change device state to avoid TX queue wake up's */
        bnxt_tx_disable(bp);
 
@@ -6448,6 +6440,22 @@ int bnxt_close_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
                bnxt_del_napi(bp);
        }
        bnxt_free_mem(bp, irq_re_init);
+}
+
+int bnxt_close_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
+{
+       int rc = 0;
+
+#ifdef CONFIG_BNXT_SRIOV
+       if (bp->sriov_cfg) {
+               rc = wait_event_interruptible_timeout(bp->sriov_cfg_wait,
+                                                     !bp->sriov_cfg,
+                                                     BNXT_SRIOV_CFG_WAIT_TMO);
+               if (rc)
+                       netdev_warn(bp->dev, "timeout waiting for SRIOV config operation to complete!\n");
+       }
+#endif
+       __bnxt_close_nic(bp, irq_re_init, link_re_init);
        return rc;
 }