Imported Upstream version 17.05
[deb_dpdk.git] / drivers / net / fm10k / base / fm10k_common.c
index a90d2f0..29f35d7 100644 (file)
@@ -230,6 +230,9 @@ s32 fm10k_disable_queues_generic(struct fm10k_hw *hw, u16 q_cnt)
        /* clear tx_ready to prevent any false hits for reset */
        hw->mac.tx_ready = false;
 
+       if (FM10K_REMOVED(hw->hw_addr))
+               return FM10K_SUCCESS;
+
        /* clear the enable bit for all rings */
        for (i = 0; i < q_cnt; i++) {
                reg = FM10K_READ_REG(hw, FM10K_TXDCTL(i));
@@ -542,7 +545,7 @@ s32 fm10k_get_host_state_generic(struct fm10k_hw *hw, bool *host_ready)
                goto out;
 
        /* if we somehow dropped the Tx enable we should reset */
-       if (hw->mac.tx_ready && !(txdctl & FM10K_TXDCTL_ENABLE)) {
+       if (mac->tx_ready && !(txdctl & FM10K_TXDCTL_ENABLE)) {
                ret_val = FM10K_ERR_RESET_REQUESTED;
                goto out;
        }
@@ -558,8 +561,12 @@ s32 fm10k_get_host_state_generic(struct fm10k_hw *hw, bool *host_ready)
                goto out;
 
        /* interface cannot receive traffic without logical ports */
-       if (mac->dglort_map == FM10K_DGLORTMAP_NONE)
+       if (mac->dglort_map == FM10K_DGLORTMAP_NONE) {
+               if (mac->ops.request_lport_map)
+                       ret_val = mac->ops.request_lport_map(hw);
+
                goto out;
+       }
 
        /* if we passed all the tests above then the switch is ready and we no
         * longer need to check for link