|
@@ -105,8 +105,10 @@ static s32 fm10k_init_hw_vf(struct fm10k_hw *hw)
|
|
|
|
|
|
/* verify we have at least 1 queue */
|
|
/* verify we have at least 1 queue */
|
|
if (!~fm10k_read_reg(hw, FM10K_TXQCTL(0)) ||
|
|
if (!~fm10k_read_reg(hw, FM10K_TXQCTL(0)) ||
|
|
- !~fm10k_read_reg(hw, FM10K_RXQCTL(0)))
|
|
|
|
- return FM10K_ERR_NO_RESOURCES;
|
|
|
|
|
|
+ !~fm10k_read_reg(hw, FM10K_RXQCTL(0))) {
|
|
|
|
+ err = FM10K_ERR_NO_RESOURCES;
|
|
|
|
+ goto reset_max_queues;
|
|
|
|
+ }
|
|
|
|
|
|
/* determine how many queues we have */
|
|
/* determine how many queues we have */
|
|
for (i = 1; tqdloc0 && (i < FM10K_MAX_QUEUES_POOL); i++) {
|
|
for (i = 1; tqdloc0 && (i < FM10K_MAX_QUEUES_POOL); i++) {
|
|
@@ -124,7 +126,7 @@ static s32 fm10k_init_hw_vf(struct fm10k_hw *hw)
|
|
/* shut down queues we own and reset DMA configuration */
|
|
/* shut down queues we own and reset DMA configuration */
|
|
err = fm10k_disable_queues_generic(hw, i);
|
|
err = fm10k_disable_queues_generic(hw, i);
|
|
if (err)
|
|
if (err)
|
|
- return err;
|
|
|
|
|
|
+ goto reset_max_queues;
|
|
|
|
|
|
/* record maximum queue count */
|
|
/* record maximum queue count */
|
|
hw->mac.max_queues = i;
|
|
hw->mac.max_queues = i;
|
|
@@ -134,6 +136,11 @@ static s32 fm10k_init_hw_vf(struct fm10k_hw *hw)
|
|
FM10K_TXQCTL_VID_MASK) >> FM10K_TXQCTL_VID_SHIFT;
|
|
FM10K_TXQCTL_VID_MASK) >> FM10K_TXQCTL_VID_SHIFT;
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
|
+
|
|
|
|
+reset_max_queues:
|
|
|
|
+ hw->mac.max_queues = 0;
|
|
|
|
+
|
|
|
|
+ return err;
|
|
}
|
|
}
|
|
|
|
|
|
/* This structure defines the attibutes to be parsed below */
|
|
/* This structure defines the attibutes to be parsed below */
|