[dpdk-dev] [PATCH v2 09/32] rte: add APIs for VF stats get/reset

Zhang, Qi Z qi.z.zhang at intel.com
Thu Dec 8 04:23:59 CET 2016


Hi Ferruh:

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, December 7, 2016 9:52 PM
> To: Lu, Wenzhuo <wenzhuo.lu at intel.com>; dev at dpdk.org
> Cc: Zhang, Qi Z <qi.z.zhang at intel.com>; Thomas Monjalon
> <thomas.monjalon at 6wind.com>
> Subject: Re: [dpdk-dev] [PATCH v2 09/32] rte: add APIs for VF stats get/reset
> 
> 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 at 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?

OK, will move to rte_pmd_i40 APIs.

> CC: Thomas
> 
> <...>

Thanks
Qi


More information about the dev mailing list