From patchwork Thu Jan 21 17:31:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Haiyue" X-Patchwork-Id: 87042 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 436E7A09E4; Thu, 21 Jan 2021 18:47:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A07C140E00; Thu, 21 Jan 2021 18:47:38 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id E291D140DF7; Thu, 21 Jan 2021 18:47:36 +0100 (CET) IronPort-SDR: cIK2cMr63XIdX9N80HVj8agQi2ah31akUfgPYXZFl/rUyp340ah7xtdbcLotvLQsqZpPJley7m +69CyRYjQGjg== X-IronPort-AV: E=McAfee;i="6000,8403,9871"; a="166408697" X-IronPort-AV: E=Sophos;i="5.79,364,1602572400"; d="scan'208";a="166408697" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2021 09:47:35 -0800 IronPort-SDR: d9DX79IYB/YJWmBS8KuM8vETsMzltmUn4XN+dc3CQeBbZJb3HjJNRiIFyEHqvlMF9vkJGJ4llb rVJ91NMpKGnA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,364,1602572400"; d="scan'208";a="356563262" Received: from npg-dpdk-haiyue-3.sh.intel.com ([10.67.118.189]) by fmsmga008.fm.intel.com with ESMTP; 21 Jan 2021 09:47:33 -0800 From: Haiyue Wang To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, qi.fu@intel.com, Haiyue Wang , stable@dpdk.org Date: Fri, 22 Jan 2021 01:31:37 +0800 Message-Id: <20210121173137.108599-1-haiyue.wang@intel.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <220210121141804.83855-1-haiyue.wang@intel.com> References: <220210121141804.83855-1-haiyue.wang@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3] net/ice: drain out DCF AdminQ command queue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The virtchnl message is handled one by one by checking opcode to match the response for the request. The DCF AdminQ command with buffer needs two virtchnl commands, one is to handle the AdminQ descriptor, the other is to the handle AdminQ buffer. If both of them are sent to PF successfully, it needs to wait two responses from PF, even if the AdminQ descriptor command gets the failure response. Since PF will handle them one by one, and send back the response for each. If not wait for the buffer message response until timeout to drain out the virtchnl command queue, it will cause the next AdminQ command with buffer to get the stall buffer response from previous. Fixes: daa714d55c72 ("net/ice: handle AdminQ command by DCF") Cc: stable@dpdk.org Signed-off-by: Haiyue Wang Acked-by: Qi Zhang --- v3: Reword the commit message, and remove the no needed checking. v2: Fix the commit message typo : 'matchiing' should be 'matching' --- drivers/net/ice/ice_dcf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c index 4a9af3292c..d947d02c5b 100644 --- a/drivers/net/ice/ice_dcf.c +++ b/drivers/net/ice/ice_dcf.c @@ -505,9 +505,7 @@ ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc, } do { - if ((!desc_cmd.pending && !buff_cmd.pending) || - (!desc_cmd.pending && desc_cmd.v_ret != IAVF_SUCCESS) || - (!buff_cmd.pending && buff_cmd.v_ret != IAVF_SUCCESS)) + if (!desc_cmd.pending && !buff_cmd.pending) break; rte_delay_ms(ICE_DCF_ARQ_CHECK_TIME);