[dpdk-dev] [PATCH v2 09/32] rte: add APIs for VF stats get/reset
Ferruh Yigit
ferruh.yigit at intel.com
Wed Dec 7 14:52:06 CET 2016
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?
CC: Thomas
<...>
More information about the dev
mailing list