fm10k/base: fix max queues on VF initialization failure
fm10k/base: fix max queues on VF initialization failure

VF drivers must detect how many queues are available. Previously, the
driver assumed that each VF has at minimum 1 queue. This assumption is
incorrect, since it is possible that the PF has not yet assigned the
queues to the VF by the time the VF checks.

To resolve this, we added a check first to ensure that the first queue
is, in fact, owned by the VF at init_hw_vf time.
However, the code flow did not reset hw->mac.max_queues to 0.
In some cases, such as during reinit flows, we call init_hw_vf
without clearing the previous value of hw->mac.max_queues. Due to this,
when init_hw_vf errors out, if its error code is not properly handled
the VF driver may still believe it has queues which no longer belong to
it. Fix this by clearing the hw->mac.max_queues on exit due to errors.

Fixes: 8b8264bdb90d ("fm10k/base: check VF has a queue")

Signed-off-by: Wang Xiao W <28aecb4e45c1566b6185c24680691da84bd4fcf8@intel.com>
Tested-by: Heng Ding <0890068dadda1adb9d516c96bec4c9b1e705b0d4@intel.com>
Acked-by: Jing Chen <2b730c2e01419ef3cbe586e212d13b674b74d017@intel.com>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk