[dpdk-stable] [PATCH v3] net/iavf: fix virtual channel return value error

Zhang, Qi Z qi.z.zhang at intel.com
Tue Dec 24 06:16:42 CET 2019



> -----Original Message-----
> From: Cao, Yahui <yahui.cao at intel.com>
> Sent: Tuesday, December 24, 2019 12:13 PM
> To: Wu, Jingjing <jingjing.wu at intel.com>; Lu, Wenzhuo
> <wenzhuo.lu at intel.com>
> Cc: dev at dpdk.org; stable at dpdk.org; Zhang, Qi Z <qi.z.zhang at intel.com>; Cao,
> Yahui <yahui.cao at intel.com>; Ye, Xiaolong <xiaolong.ye at intel.com>; Su,
> Simei <simei.su at intel.com>
> 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 at dpdk.org
> 
> Signed-off-by: Yahui Cao <yahui.cao at intel.com>

Acked-by: Qi Zhang <qi.z.zhang at intel.com>



More information about the stable mailing list