From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58644A04B3; Sat, 4 Jan 2020 11:26:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7F3281D16A; Sat, 4 Jan 2020 11:26:32 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 1FB631D166; Sat, 4 Jan 2020 11:26:30 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jan 2020 02:26:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,394,1571727600"; d="scan'208";a="252847370" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by fmsmga002.fm.intel.com with ESMTP; 04 Jan 2020 02:26:28 -0800 Date: Sat, 4 Jan 2020 18:20:55 +0800 From: Ye Xiaolong To: "Zhang, Qi Z" Cc: "Cao, Yahui" , "Wu, Jingjing" , "Lu, Wenzhuo" , "dev@dpdk.org" , "stable@dpdk.org" , "Su, Simei" Message-ID: <20200104102055.GN14498@intel.com> References: <20191219055601.78490-1-yahui.cao@intel.com> <20191224041313.85175-1-yahui.cao@intel.com> <039ED4275CED7440929022BC67E7061153DF2DF1@SHSMSX105.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <039ED4275CED7440929022BC67E7061153DF2DF1@SHSMSX105.ccr.corp.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH v3] net/iavf: fix virtual channel return value error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On 12/24, Zhang, Qi Z wrote: > > >> -----Original Message----- >> From: Cao, Yahui >> Sent: Tuesday, December 24, 2019 12:13 PM >> To: Wu, Jingjing ; Lu, Wenzhuo >> >> Cc: dev@dpdk.org; stable@dpdk.org; Zhang, Qi Z ; Cao, >> Yahui ; Ye, Xiaolong ; Su, >> Simei >> Subject: [PATCH v3] net/iavf: fix virtual channel return value error >> >> In iavf_handle_virtchnl_msg(), it is not appropriate for _clear_cmd() to be used >> as a notification to forground thread. So introduce >> _notify_cmd() to fix this error. In addition, since _notify_cmd() contains >> rte_wmb(), rte_compiler_barrier() is not necessary. >> >> Sending msg from VF to PF is mainly by calling iavf_execute_vf_cmd(), the >> whole virtchnl msg process is like, >> >> iavf_execute_vf_cmd() will call iavf_aq_send_msg_to_pf() to send msg and >> then polling the cmd done flag as "if (vf->pend_cmd == >> VIRTCHNL_OP_UNKNOWN)" >> >> When reply msg is returned by pf, iavf_handle_virtchnl_msg() in isr will read >> msg return value by "vf->cmd_retval = msg_ret" and immediately set the cmd >> done flag by calling _clear_cmd() to notify the iavf_execute_vf_cmd(). >> >> iavf_execute_vf_cmd() find the cmd done flag is set and then check whether >> command return value vf->cmd_retval is success or not. >> >> However _clear_cmd() also resets the vf->cmd_retval to success, overwriting >> the actual return value which is used for diagnosis. >> So iavf_execute_vf_cmd() will always find vf->cmd_retval is success and then >> return success. >> >> Fixes: 22b123a36d07 ("net/avf: initialize PMD") >> Cc: stable@dpdk.org >> >> Signed-off-by: Yahui Cao > >Acked-by: Qi Zhang > Acked-by: Xiaolong Ye Applied to dpdk-next-net-intel, Thanks.