From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wang Xiao W Subject: [PATCH 11/16] fm10k: Re-map all possible VF queues after a VFLR Date: Mon, 27 Jul 2015 16:42:34 +0800 Message-ID: <1437986559-31016-11-git-send-email-xiao.w.wang@intel.com> References: <1437986559-31016-1-git-send-email-xiao.w.wang@intel.com> Cc: Wang Xiao W To: dev@dpdk.org Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 688CCC54E for ; Mon, 27 Jul 2015 10:43:13 +0200 (CEST) In-Reply-To: <1437986559-31016-1-git-send-email-xiao.w.wang@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/fm10k/base/fm10k_pf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/fm10k/base/fm10k_pf.c b/drivers/net/fm10k/base/fm10k_pf.c index 1004018..eb1adc9 100644 --- a/drivers/net/fm10k/base/fm10k_pf.c +++ b/drivers/net/fm10k/base/fm10k_pf.c @@ -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; } -- 1.9.3