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 BB935A04DD; Tue, 24 Dec 2019 06:16:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9F3C81252; Tue, 24 Dec 2019 06:16:49 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id EC972F72; Tue, 24 Dec 2019 06:16:47 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Dec 2019 21:16:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,350,1571727600"; d="scan'208";a="249712009" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga002.fm.intel.com with ESMTP; 23 Dec 2019 21:16:46 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 23 Dec 2019 21:16:46 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 23 Dec 2019 21:16:45 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 23 Dec 2019 21:16:45 -0800 Received: from shsmsx105.ccr.corp.intel.com ([169.254.11.72]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.222]) with mapi id 14.03.0439.000; Tue, 24 Dec 2019 13:16:43 +0800 From: "Zhang, Qi Z" To: "Cao, Yahui" , "Wu, Jingjing" , "Lu, Wenzhuo" CC: "dev@dpdk.org" , "stable@dpdk.org" , "Ye, Xiaolong" , "Su, Simei" Thread-Topic: [PATCH v3] net/iavf: fix virtual channel return value error Thread-Index: AQHVuhCcyx8BXrw+TU6nDp7/9y4KfKfIvjYQ Date: Tue, 24 Dec 2019 05:16:42 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153DF2DF1@SHSMSX105.ccr.corp.intel.com> References: <20191219055601.78490-1-yahui.cao@intel.com> <20191224041313.85175-1-yahui.cao@intel.com> In-Reply-To: <20191224041313.85175-1-yahui.cao@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGE1Y2NhOTEtMDI5ZC00Y2Y3LWJiNjctZmIxNzZlMTQwYjUyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiT3I1VGpScDRDWktQVXhHYWU3MGR6eEVpMU1ycWROVExiMnJYc01GZk1EMzJhdURIRlNIdVA4bFozK0NYcHl4ciJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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" > -----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 ; Ca= o, > Yahui ; Ye, Xiaolong ; Su, > Simei > Subject: [PATCH v3] net/iavf: fix virtual channel return value error >=20 > 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() contain= s > rte_wmb(), rte_compiler_barrier() is not necessary. >=20 > Sending msg from VF to PF is mainly by calling iavf_execute_vf_cmd(), the > whole virtchnl msg process is like, >=20 > 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 =3D=3D > VIRTCHNL_OP_UNKNOWN)" >=20 > When reply msg is returned by pf, iavf_handle_virtchnl_msg() in isr will = read > msg return value by "vf->cmd_retval =3D msg_ret" and immediately set the = cmd > done flag by calling _clear_cmd() to notify the iavf_execute_vf_cmd(). >=20 > iavf_execute_vf_cmd() find the cmd done flag is set and then check whethe= r > command return value vf->cmd_retval is success or not. >=20 > However _clear_cmd() also resets the vf->cmd_retval to success, overwriti= ng > the actual return value which is used for diagnosis. > So iavf_execute_vf_cmd() will always find vf->cmd_retval is success and t= hen > return success. >=20 > Fixes: 22b123a36d07 ("net/avf: initialize PMD") > Cc: stable@dpdk.org >=20 > Signed-off-by: Yahui Cao Acked-by: Qi Zhang