From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ferruh.yigit@intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 5FC372B8E
 for <dev@dpdk.org>; Wed,  7 Dec 2016 14:52:10 +0100 (CET)
Received: from orsmga004.jf.intel.com ([10.7.209.38])
 by fmsmga102.fm.intel.com with ESMTP; 07 Dec 2016 05:52:09 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.33,310,1477983600"; d="scan'208";a="37893851"
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:52:07 -0800
To: Wenzhuo Lu <wenzhuo.lu@intel.com>, 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-10-git-send-email-wenzhuo.lu@intel.com>
Cc: Qi Zhang <qi.z.zhang@intel.com>,
 Thomas Monjalon <thomas.monjalon@6wind.com>
From: Ferruh Yigit <ferruh.yigit@intel.com>
Message-ID: <86fe08d5-6f14-8495-c26c-2f08a5468587@intel.com>
Date: Wed, 7 Dec 2016 13:52:06 +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-10-git-send-email-wenzhuo.lu@intel.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
Subject: Re: [dpdk-dev] [PATCH v2 09/32] rte: add APIs for VF stats get/reset
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Dec 2016 13:52:10 -0000

On 12/7/2016 3:31 AM, Wenzhuo Lu wrote:
> This patch add below two APIs so that VF statistics
> can be get/clear from PF side.
> rte_eth_vf_stats_get.
> rte_eth_vf_stats_reset.

patch subject can have " ... from PF" both to be consistent with other
patches and to clarify what it does: add APIS to get/reset VF stats from PF?

> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---

<...>

> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 9678179..8b564ee 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -1271,6 +1271,15 @@ typedef int (*eth_set_vf_vlan_filter_t)(struct rte_eth_dev *dev,
>  				  uint8_t vlan_on);
>  /**< @internal Set VF VLAN pool filter */
>  
> +typedef int (*eth_vf_stats_get)(struct rte_eth_dev *dev,
> +				uint16_t vf,
> +				struct rte_eth_stats *stats);
> +/**< @internal Get VF statistics */
> +
> +typedef int (*eth_vf_stats_reset)(struct rte_eth_dev *dev,
> +				  uint16_t vf);
> +/**< @internal Clear VF statistics */
> +
>  typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
>  				uint16_t queue_idx,
>  				uint16_t tx_rate);
> @@ -1483,6 +1492,8 @@ struct eth_dev_ops {
>  	eth_set_vf_rx_t            set_vf_rx;  /**< enable/disable a VF receive */
>  	eth_set_vf_tx_t            set_vf_tx;  /**< enable/disable a VF transmit */
>  	eth_set_vf_vlan_filter_t   set_vf_vlan_filter;  /**< Set VF VLAN filter */
> +	eth_vf_stats_get           vf_stats_get; /**< Get VF's statistics */
> +	eth_vf_stats_reset         vf_stats_reset; /**< Reset VF's statistics */

Do we really want to add more ops to the eth_dev_ops?

Although vf_stats_get & vf_stats_reset sounds generic, why not implement
these first in PMD specific manner, and more PMDs implement these, move
to the generic eth_dev_ops layer?

CC: Thomas

<...>