fm10k/base: fix VF queues counting

During initialization, the VF counts its rings by walking the TQDLOC
registers. This only works if the TQMAP/RQMAP registers are set to map
the out-of-bound rings to the first one, so the VF driver can detect when
it has run out of queues cleanly. Update the PF to reset the empty
TQMAP/RQMAP registers post-VFLR to prevent innocent VF drivers from
triggering malicious events.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
This commit is contained in:
Wang Xiao W 2015-09-10 12:38:20 +08:00 committed by Thomas Monjalon
parent e78a599651
commit 46e018c501

View File

@ -1102,6 +1102,12 @@ STATIC s32 fm10k_iov_reset_resources_pf(struct fm10k_hw *hw,
FM10K_WRITE_REG(hw, FM10K_RQMAP(qmap_idx + i), vf_q_idx + i);
}
/* repeat the first ring for all of the remaining VF rings */
for (i = queues_per_pool; i < qmap_stride; i++) {
FM10K_WRITE_REG(hw, FM10K_TQMAP(qmap_idx + i), vf_q_idx);
FM10K_WRITE_REG(hw, FM10K_RQMAP(qmap_idx + i), vf_q_idx);
}
return FM10K_SUCCESS;
}