From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 8027610D7F for ; Thu, 22 Dec 2016 17:59:20 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 22 Dec 2016 08:59:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,389,1477983600"; d="scan'208";a="21733185" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.29]) ([10.237.220.29]) by orsmga002.jf.intel.com with ESMTP; 22 Dec 2016 08:59:19 -0800 To: Wenzhuo Lu , dev@dpdk.org References: <1482308980-76777-1-git-send-email-wenzhuo.lu@intel.com> From: Ferruh Yigit Message-ID: <3f15d1e2-7fad-21c4-cc1e-122e4cadf2de@intel.com> Date: Thu, 22 Dec 2016 16:59:18 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1482308980-76777-1-git-send-email-wenzhuo.lu@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix wrong return value when handling PF message 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: , X-List-Received-Date: Thu, 22 Dec 2016 16:59:21 -0000 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 > --- > 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; >