DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Wenzhuo Lu <wenzhuo.lu@intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix wrong return value when handling PF message
Date: Thu, 22 Dec 2016 16:59:18 +0000	[thread overview]
Message-ID: <3f15d1e2-7fad-21c4-cc1e-122e4cadf2de@intel.com> (raw)
In-Reply-To: <1482308980-76777-1-git-send-email-wenzhuo.lu@intel.com>

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@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;
> 

  reply	other threads:[~2016-12-22 16:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21  8:29 Wenzhuo Lu
2016-12-22 16:59 ` Ferruh Yigit [this message]
2017-01-03  2:58   ` Lu, Wenzhuo
2017-01-03 17:13 ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3f15d1e2-7fad-21c4-cc1e-122e4cadf2de@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=wenzhuo.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).