From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 6B0422BAF for ; Wed, 7 Dec 2016 14:59:56 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP; 07 Dec 2016 05:59:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,310,1477983600"; d="scan'208";a="37896180" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.29]) ([10.237.220.29]) by orsmga004.jf.intel.com with ESMTP; 07 Dec 2016 05:59:54 -0800 To: Wenzhuo Lu , dev@dpdk.org References: <1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com> <1481081535-37448-1-git-send-email-wenzhuo.lu@intel.com> <1481081535-37448-11-git-send-email-wenzhuo.lu@intel.com> Cc: Qi Zhang From: Ferruh Yigit Message-ID: Date: Wed, 7 Dec 2016 13:59:54 +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: <1481081535-37448-11-git-send-email-wenzhuo.lu@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 10/32] net/i40e: implement ops for VF stats get/reset 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: Wed, 07 Dec 2016 13:59:57 -0000 On 12/7/2016 3:31 AM, Wenzhuo Lu wrote: > This patch implement vf_stats_get and vf_stats_reset ops for i40e. > > Signed-off-by: Qi Zhang > --- <...> > +static int > +i40e_vf_stats_get(struct rte_eth_dev *dev, > + uint16_t vf, > + struct rte_eth_stats *stats) > +{ > + struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); > + struct i40e_vsi *vsi; > + > + int ret = 0; > + > + if (pf->vf_num <= vf) { > + PMD_DRV_LOG(ERR, "Invalid VF id %d\n", vf); > + return -EINVAL; > + } Do we need following check as it has been done in prev patches: + rte_eth_dev_info_get(port, &dev_info); + + if (vf_id >= dev_info.max_vfs) + return -EINVAL;