[dpdk-dev] [PATCH] net/i40e: fix wrong return value when handling PF message
Ferruh Yigit
ferruh.yigit at intel.com
Thu Dec 22 17:59:18 CET 2016
On 12/21/2016 8:29 AM, Wenzhuo Lu wrote:
> When VF receives a message from PF, it should check the return
> value. But in i40evf_execute_vf_cmd the value is ignored and not
> returned to the caller.
>
> Fixes: 95cd21f45d1b ("i40evf: allocate virtchnl commands buffer per VF")
>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
> ---
> drivers/net/i40e/i40e_ethdev.h | 2 +-
> drivers/net/i40e/i40e_ethdev_vf.c | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
> index 298cef4..28111a7 100644
> --- a/drivers/net/i40e/i40e_ethdev.h
> +++ b/drivers/net/i40e/i40e_ethdev.h
> @@ -527,7 +527,7 @@ struct i40e_vf {
> enum i40e_aq_link_speed link_speed;
> bool vf_reset;
> volatile uint32_t pend_cmd; /* pending command not finished yet */
> - uint32_t cmd_retval; /* return value of the cmd response from PF */
> + int32_t cmd_retval; /* return value of the cmd response from PF */
> u16 pend_msg; /* flags indicates events from pf not handled yet */
> uint8_t *aq_resp; /* buffer to store the adminq response from PF */
>
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
> index 12da0ec..5d25764 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -361,6 +361,7 @@ struct rte_i40evf_xstats_name_off {
> err = -1;
> do {
> ret = i40evf_read_pfmsg(dev, &info);
> + vf->cmd_retval = info.result;
This is for op_version, and op_get_vf_resources! Which seems good.
Is something similar required for other commands (default case of the
switch),
but for them not sure how to get retval (event.desc.cookie_low to
vf->cmd_retval) ?
> if (ret == I40EVF_MSG_CMD) {
> err = 0;
> break;
>
More information about the dev
mailing list