[dpdk-dev] [RFC v2 1/2] ethdev: provide device flag to bypass ethdev queue xstats

Xu, Rosen rosen.xu at intel.com
Sun Oct 18 14:09:06 CEST 2020



> -----Original Message-----
> From: Yigit, Ferruh <ferruh.yigit at intel.com>
> Sent: Wednesday, October 14, 2020 10:27
> To: Yigit, Ferruh <ferruh.yigit at intel.com>; John W. Linville
> <linville at tuxdriver.com>; Loftus, Ciara <ciara.loftus at intel.com>; Zhang, Qi Z
> <qi.z.zhang at intel.com>; Shepard Siegel <shepard.siegel at atomicrules.com>;
> Ed Czeck <ed.czeck at atomicrules.com>; John Miller
> <john.miller at atomicrules.com>; Igor Russkikh
> <igor.russkikh at aquantia.com>; Pavel Belous <pavel.belous at aquantia.com>;
> Steven Webster <steven.webster at windriver.com>; Matt Peters
> <matt.peters at windriver.com>; Somalapuram Amaranath
> <asomalap at amd.com>; Rasesh Mody <rmody at marvell.com>; Shahed
> Shaikh <shshaikh at marvell.com>; Ajit Khaparde
> <ajit.khaparde at broadcom.com>; Somnath Kotur
> <somnath.kotur at broadcom.com>; Chas Williams <chas3 at att.com>; Min Hu
> (Connor) <humin29 at huawei.com>; Rahul Lakkireddy
> <rahul.lakkireddy at chelsio.com>; Hemant Agrawal
> <hemant.agrawal at nxp.com>; Sachin Saxena <sachin.saxena at oss.nxp.com>;
> Guo, Jia <jia.guo at intel.com>; Wang, Haiyue <haiyue.wang at intel.com>;
> Marcin Wojtas <mw at semihalf.com>; Michal Krawczyk <mk at semihalf.com>;
> Guy Tzalik <gtzalik at amazon.com>; Evgeny Schemeilin
> <evgenys at amazon.com>; Igor Chauskin <igorch at amazon.com>;
> Gagandeep Singh <g.singh at nxp.com>; John Daley <johndale at cisco.com>;
> Hyong Youb Kim <hyonkim at cisco.com>; Gaetan Rivet <grive at u256.net>;
> Wang, Xiao W <xiao.w.wang at intel.com>; Ziyang Xuan
> <xuanziyang2 at huawei.com>; Xiaoyun Wang
> <cloud.wangxiaoyun at huawei.com>; Guoyang Zhou
> <zhouguoyang at huawei.com>; Wei Hu (Xavier)
> <xavier.huwei at huawei.com>; Yisen Zhuang <yisen.zhuang at huawei.com>;
> Xing, Beilei <beilei.xing at intel.com>; Wu, Jingjing <jingjing.wu at intel.com>;
> Yang, Qiming <qiming.yang at intel.com>; Alfredo Cardigliano
> <cardigliano at ntop.org>; Xu, Rosen <rosen.xu at intel.com>; Shijith Thotton
> <sthotton at marvell.com>; Srisivasubramanian Srinivasan
> <srinivasan at marvell.com>; Jakub Grajciar <jgrajcia at cisco.com>; Matan
> Azrad <matan at nvidia.com>; Shahaf Shuler <shahafs at nvidia.com>;
> Viacheslav Ovsiienko <viacheslavo at nvidia.com>; Zyta Szpak
> <zr at semihalf.com>; Liron Himi <lironh at marvell.com>; Stephen Hemminger
> <sthemmin at microsoft.com>; K. Y. Srinivasan <kys at microsoft.com>;
> Haiyang Zhang <haiyangz at microsoft.com>; Long Li <longli at microsoft.com>;
> Martin Spinler <spinler at cesnet.cz>; Heinrich Kuhn
> <heinrich.kuhn at netronome.com>; Tetsuya Mukawa
> <mtetsuyah at gmail.com>; Harman Kalra <hkalra at marvell.com>; Jerin Jacob
> <jerinj at marvell.com>; Nithin Dabilpuram <ndabilpuram at marvell.com>;
> Kiran Kumar K <kirankumark at marvell.com>; Akhil Goyal
> <akhil.goyal at nxp.com>; Richardson, Bruce <bruce.richardson at intel.com>;
> Andrew Rybchenko <andrew.rybchenko at oktetlabs.ru>; Wiles, Keith
> <keith.wiles at intel.com>; Maciej Czekaj <mczekaj at marvell.com>; Maxime
> Coquelin <maxime.coquelin at redhat.com>; Xia, Chenbo
> <chenbo.xia at intel.com>; Wang, Zhihong <zhihong.wang at intel.com>; Yong
> Wang <yongwang at vmware.com>; Thomas Monjalon
> <thomas at monjalon.net>
> Cc: dev at dpdk.org
> Subject: [RFC v2 1/2] ethdev: provide device flag to bypass ethdev queue
> xstats
> 
> Queue stats are stored in 'struct rte_eth_stats' as array and array size is
> defined by 'RTE_ETHDEV_QUEUE_STAT_CNTRS' compile time flag.
> 
> As a result of technical board discussion, decided to remove the queue
> statistics from 'struct rte_eth_stats' in the long term.
> 
> Instead PMDs should represent the queue statistics via xstats, this gives
> more flexibility on the number of the queues supported.
> 
> Currently queue stats in the xstats are filled by ethdev layer, using some
> basic stats, when queue stats removed from basic stats the responsibility to
> fill the relevant xstats will be pushed to the PMDs.
> 
> During the switch period, temporary
> 'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS'
> device flag is created. Initially all PMDs using xstats set this flag.
> The PMDs implemented queue stats in the xstats should clear the flag.
> 
> When all PMDs switch to the xstats for the queue stats, queue stats related
> fields from 'struct rte_eth_stats' will be removed, as well as
> 'RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS' flag.
> Later 'RTE_ETHDEV_QUEUE_STAT_CNTRS' compile time flag also can be
> removed.
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
> ---
>  drivers/net/af_packet/rte_eth_af_packet.c |  1 +
>  drivers/net/af_xdp/rte_eth_af_xdp.c       |  1 +
>  drivers/net/ark/ark_ethdev.c              |  2 ++
>  drivers/net/atlantic/atl_ethdev.c         |  2 ++
>  drivers/net/avp/avp_ethdev.c              |  1 +
>  drivers/net/axgbe/axgbe_ethdev.c          |  2 ++
>  drivers/net/bnx2x/bnx2x_ethdev.c          |  1 +
>  drivers/net/bnxt/bnxt_ethdev.c            |  1 +
>  drivers/net/bnxt/bnxt_reps.c              |  3 ++-
>  drivers/net/bonding/rte_eth_bond_pmd.c    |  3 ++-
>  drivers/net/cxgbe/cxgbe_ethdev.c          |  2 ++
>  drivers/net/dpaa/dpaa_ethdev.c            |  2 ++
>  drivers/net/dpaa2/dpaa2_ethdev.c          |  2 ++
>  drivers/net/e1000/em_ethdev.c             |  1 +
>  drivers/net/e1000/igb_ethdev.c            |  2 ++
>  drivers/net/ena/ena_ethdev.c              |  2 ++
>  drivers/net/enetc/enetc_ethdev.c          |  2 ++
>  drivers/net/enic/enic_ethdev.c            |  1 +
>  drivers/net/enic/enic_vf_representor.c    |  3 ++-
>  drivers/net/failsafe/failsafe.c           |  3 ++-
>  drivers/net/fm10k/fm10k_ethdev.c          |  1 +
>  drivers/net/hinic/hinic_pmd_ethdev.c      |  2 ++
>  drivers/net/hns3/hns3_ethdev.c            |  2 ++
>  drivers/net/hns3/hns3_ethdev_vf.c         |  2 ++
>  drivers/net/i40e/i40e_ethdev.c            |  1 +
>  drivers/net/i40e/i40e_ethdev_vf.c         |  1 +
>  drivers/net/i40e/i40e_vf_representor.c    |  3 ++-
>  drivers/net/iavf/iavf_ethdev.c            |  1 +
>  drivers/net/ice/ice_dcf_ethdev.c          |  2 ++
>  drivers/net/ice/ice_ethdev.c              |  2 ++
>  drivers/net/igc/igc_ethdev.c              |  1 +
>  drivers/net/ionic/ionic_ethdev.c          |  1 +
>  drivers/net/ipn3ke/ipn3ke_representor.c   |  3 ++-
>  drivers/net/ixgbe/ixgbe_ethdev.c          |  2 ++
>  drivers/net/kni/rte_eth_kni.c             |  1 +
>  drivers/net/liquidio/lio_ethdev.c         |  1 +
>  drivers/net/memif/rte_eth_memif.c         |  1 +
>  drivers/net/mlx4/mlx4.c                   |  1 +
>  drivers/net/mlx5/linux/mlx5_os.c          |  1 +
>  drivers/net/mvneta/mvneta_ethdev.c        |  1 +
>  drivers/net/mvpp2/mrvl_ethdev.c           |  1 +
>  drivers/net/netvsc/hn_ethdev.c            |  2 ++
>  drivers/net/nfb/nfb_ethdev.c              |  2 ++
>  drivers/net/nfp/nfp_net.c                 |  2 ++
>  drivers/net/null/rte_eth_null.c           |  1 +
>  drivers/net/octeontx/octeontx_ethdev.c    |  1 +
>  drivers/net/octeontx2/otx2_ethdev.c       |  1 +
>  drivers/net/pcap/rte_eth_pcap.c           |  1 +
>  drivers/net/pfe/pfe_ethdev.c              |  2 ++
>  drivers/net/qede/qede_ethdev.c            |  1 +
>  drivers/net/ring/rte_eth_ring.c           |  1 +
>  drivers/net/sfc/sfc_ethdev.c              |  1 +
>  drivers/net/szedata2/rte_eth_szedata2.c   |  2 ++
>  drivers/net/tap/rte_eth_tap.c             |  3 ++-
>  drivers/net/thunderx/nicvf_ethdev.c       |  1 +
>  drivers/net/vhost/rte_eth_vhost.c         |  3 ++-
>  drivers/net/virtio/virtio_ethdev.c        |  2 ++
>  drivers/net/vmxnet3/vmxnet3_ethdev.c      |  1 +
>  lib/librte_ethdev/rte_ethdev.c            | 18 ++++++++++++++----
>  lib/librte_ethdev/rte_ethdev.h            |  5 +++++
>  60 files changed, 106 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c
> b/drivers/net/ipn3ke/ipn3ke_representor.c
> index b9fb4d4e46..a8765b5f4e 100644
> --- a/drivers/net/ipn3ke/ipn3ke_representor.c
> +++ b/drivers/net/ipn3ke/ipn3ke_representor.c
> @@ -2964,7 +2964,8 @@ ipn3ke_rpst_init(struct rte_eth_dev *ethdev, void
> *init_params)
>  		return -ENODEV;
>  	}
> 
> -	ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR;
> +	ethdev->data->dev_flags |= RTE_ETH_DEV_REPRESENTOR |
> +
> 	RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS;
> 
>  	rte_spinlock_lock(&ipn3ke_link_notify_list_lk);
>  	TAILQ_INSERT_TAIL(&ipn3ke_rpst_list, rpst, next); diff --git

Acked-by: Rosen Xu<rosen.xu at intel.com>


More information about the dev mailing list