diff mbox series

net/fm10k: add imissed stats

Message ID 20180910155035.23638-1-julien.meunier@nokia.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers show
Series net/fm10k: add imissed stats | expand

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Julien Meunier Sept. 10, 2018, 3:50 p.m. UTC
Add support of imissed and q_errors statistics, reported by PCIE_QPRDC
register (see datasheet, section 11.27.2.60), which exposes the number
of receive packets dropped for a queue.

Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
---
 drivers/net/fm10k/fm10k_ethdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Wang, Xiao W Sept. 11, 2018, 1:51 a.m. UTC | #1
Hi,

-----Original Message-----
From: Julien Meunier [mailto:julien.meunier@nokia.com] 
Sent: Monday, September 10, 2018 11:51 PM
To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Xiao W <xiao.w.wang@intel.com>
Cc: dev@dpdk.org
Subject: [PATCH] net/fm10k: add imissed stats

Add support of imissed and q_errors statistics, reported by PCIE_QPRDC
register (see datasheet, section 11.27.2.60), which exposes the number
of receive packets dropped for a queue.

Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
---
 drivers/net/fm10k/fm10k_ethdev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 541a49b..a9af6c2 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1325,7 +1325,7 @@ fm10k_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 static int
 fm10k_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 {
-	uint64_t ipackets, opackets, ibytes, obytes;
+	uint64_t ipackets, opackets, ibytes, obytes, imissed;
 	struct fm10k_hw *hw =
 		FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct fm10k_hw_stats *hw_stats =
@@ -1336,22 +1336,25 @@ fm10k_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 
 	fm10k_update_hw_stats(hw, hw_stats);
 
-	ipackets = opackets = ibytes = obytes = 0;
+	ipackets = opackets = ibytes = obytes = imissed = 0;
 	for (i = 0; (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) &&
 		(i < hw->mac.max_queues); ++i) {
 		stats->q_ipackets[i] = hw_stats->q[i].rx_packets.count;
 		stats->q_opackets[i] = hw_stats->q[i].tx_packets.count;
 		stats->q_ibytes[i]   = hw_stats->q[i].rx_bytes.count;
 		stats->q_obytes[i]   = hw_stats->q[i].tx_bytes.count;
+		stats->q_errors[i]   = hw_stats->q[i].rx_drops.count;
 		ipackets += stats->q_ipackets[i];
 		opackets += stats->q_opackets[i];
 		ibytes   += stats->q_ibytes[i];
 		obytes   += stats->q_obytes[i];
+		imissed  += stats->q_errors[i];
 	}
 	stats->ipackets = ipackets;
 	stats->opackets = opackets;
 	stats->ibytes = ibytes;
 	stats->obytes = obytes;
+	stats->imissed = imissed;
 	return 0;
 }

Acked-by: Xiao Wang <xiao.w.wang@intel.com>
Julien Meunier Sept. 11, 2018, 8:22 a.m. UTC | #2
Hi,

Please, do not merge this patch. I need to check and readapt this patch. A version 2 will be sent later.

Thanks,

--
Julien Meunier

> -----Original Message-----
> From: Wang, Xiao W <xiao.w.wang@intel.com>
> Sent: Tuesday, September 11, 2018 3:52 AM
> To: Meunier, Julien (Nokia - FR/Paris-Saclay) <julien.meunier@nokia.com>;
> Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH] net/fm10k: add imissed stats
> 
> Hi,
> 
> -----Original Message-----
> From: Julien Meunier [mailto:julien.meunier@nokia.com]
> Sent: Monday, September 10, 2018 11:51 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Xiao W
> <xiao.w.wang@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH] net/fm10k: add imissed stats
> 
> Add support of imissed and q_errors statistics, reported by PCIE_QPRDC
> register (see datasheet, section 11.27.2.60), which exposes the number of
> receive packets dropped for a queue.
> 
> Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
> ---
>  drivers/net/fm10k/fm10k_ethdev.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/fm10k/fm10k_ethdev.c
> b/drivers/net/fm10k/fm10k_ethdev.c
> index 541a49b..a9af6c2 100644
> --- a/drivers/net/fm10k/fm10k_ethdev.c
> +++ b/drivers/net/fm10k/fm10k_ethdev.c
> @@ -1325,7 +1325,7 @@ fm10k_xstats_get(struct rte_eth_dev *dev, struct
> rte_eth_xstat *xstats,  static int  fm10k_stats_get(struct rte_eth_dev *dev,
> struct rte_eth_stats *stats)  {
> -	uint64_t ipackets, opackets, ibytes, obytes;
> +	uint64_t ipackets, opackets, ibytes, obytes, imissed;
>  	struct fm10k_hw *hw =
>  		FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  	struct fm10k_hw_stats *hw_stats =
> @@ -1336,22 +1336,25 @@ fm10k_stats_get(struct rte_eth_dev *dev, struct
> rte_eth_stats *stats)
> 
>  	fm10k_update_hw_stats(hw, hw_stats);
> 
> -	ipackets = opackets = ibytes = obytes = 0;
> +	ipackets = opackets = ibytes = obytes = imissed = 0;
>  	for (i = 0; (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) &&
>  		(i < hw->mac.max_queues); ++i) {
>  		stats->q_ipackets[i] = hw_stats->q[i].rx_packets.count;
>  		stats->q_opackets[i] = hw_stats->q[i].tx_packets.count;
>  		stats->q_ibytes[i]   = hw_stats->q[i].rx_bytes.count;
>  		stats->q_obytes[i]   = hw_stats->q[i].tx_bytes.count;
> +		stats->q_errors[i]   = hw_stats->q[i].rx_drops.count;
>  		ipackets += stats->q_ipackets[i];
>  		opackets += stats->q_opackets[i];
>  		ibytes   += stats->q_ibytes[i];
>  		obytes   += stats->q_obytes[i];
> +		imissed  += stats->q_errors[i];
>  	}
>  	stats->ipackets = ipackets;
>  	stats->opackets = opackets;
>  	stats->ibytes = ibytes;
>  	stats->obytes = obytes;
> +	stats->imissed = imissed;
>  	return 0;
>  }
> 
> Acked-by: Xiao Wang <xiao.w.wang@intel.com>
> 
> 
> --
> 2.10.2
Julien Meunier Sept. 20, 2018, 10:08 a.m. UTC | #3
Sorry the delay. False alert, I thought that imissed was counted also in ipackets, but it's not the case :)

So you can integrate this patch.

Thanks in advance !

--
Julien Meunier

> -----Original Message-----
> From: Meunier, Julien (Nokia - FR/Paris-Saclay)
> Sent: Tuesday, September 11, 2018 10:22 AM
> To: Wang, Xiao W <xiao.w.wang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH] net/fm10k: add imissed stats
> 
> Hi,
> 
> Please, do not merge this patch. I need to check and readapt this patch. A
> version 2 will be sent later.
> 
> Thanks,
> 
> --
> Julien Meunier
> 
> > -----Original Message-----
> > From: Wang, Xiao W <xiao.w.wang@intel.com>
> > Sent: Tuesday, September 11, 2018 3:52 AM
> > To: Meunier, Julien (Nokia - FR/Paris-Saclay)
> > <julien.meunier@nokia.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org
> > Subject: RE: [PATCH] net/fm10k: add imissed stats
> >
> > Hi,
> >
> > -----Original Message-----
> > From: Julien Meunier [mailto:julien.meunier@nokia.com]
> > Sent: Monday, September 10, 2018 11:51 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Xiao W
> > <xiao.w.wang@intel.com>
> > Cc: dev@dpdk.org
> > Subject: [PATCH] net/fm10k: add imissed stats
> >
> > Add support of imissed and q_errors statistics, reported by PCIE_QPRDC
> > register (see datasheet, section 11.27.2.60), which exposes the number
> > of receive packets dropped for a queue.
> >
> > Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
> > ---
> >  drivers/net/fm10k/fm10k_ethdev.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/fm10k/fm10k_ethdev.c
> > b/drivers/net/fm10k/fm10k_ethdev.c
> > index 541a49b..a9af6c2 100644
> > --- a/drivers/net/fm10k/fm10k_ethdev.c
> > +++ b/drivers/net/fm10k/fm10k_ethdev.c
> > @@ -1325,7 +1325,7 @@ fm10k_xstats_get(struct rte_eth_dev *dev, struct
> > rte_eth_xstat *xstats,  static int  fm10k_stats_get(struct rte_eth_dev
> > *dev, struct rte_eth_stats *stats)  {
> > -	uint64_t ipackets, opackets, ibytes, obytes;
> > +	uint64_t ipackets, opackets, ibytes, obytes, imissed;
> >  	struct fm10k_hw *hw =
> >  		FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> >  	struct fm10k_hw_stats *hw_stats =
> > @@ -1336,22 +1336,25 @@ fm10k_stats_get(struct rte_eth_dev *dev,
> > struct rte_eth_stats *stats)
> >
> >  	fm10k_update_hw_stats(hw, hw_stats);
> >
> > -	ipackets = opackets = ibytes = obytes = 0;
> > +	ipackets = opackets = ibytes = obytes = imissed = 0;
> >  	for (i = 0; (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) &&
> >  		(i < hw->mac.max_queues); ++i) {
> >  		stats->q_ipackets[i] = hw_stats->q[i].rx_packets.count;
> >  		stats->q_opackets[i] = hw_stats->q[i].tx_packets.count;
> >  		stats->q_ibytes[i]   = hw_stats->q[i].rx_bytes.count;
> >  		stats->q_obytes[i]   = hw_stats->q[i].tx_bytes.count;
> > +		stats->q_errors[i]   = hw_stats->q[i].rx_drops.count;
> >  		ipackets += stats->q_ipackets[i];
> >  		opackets += stats->q_opackets[i];
> >  		ibytes   += stats->q_ibytes[i];
> >  		obytes   += stats->q_obytes[i];
> > +		imissed  += stats->q_errors[i];
> >  	}
> >  	stats->ipackets = ipackets;
> >  	stats->opackets = opackets;
> >  	stats->ibytes = ibytes;
> >  	stats->obytes = obytes;
> > +	stats->imissed = imissed;
> >  	return 0;
> >  }
> >
> > Acked-by: Xiao Wang <xiao.w.wang@intel.com>
> >
> >
> > --
> > 2.10.2
Zhang, Qi Z Sept. 21, 2018, 2:23 p.m. UTC | #4
> -----Original Message-----
> From: Wang, Xiao W
> Sent: Tuesday, September 11, 2018 9:52 AM
> To: Julien Meunier <julien.meunier@nokia.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org
> Subject: RE: [PATCH] net/fm10k: add imissed stats
> 
> Hi,
> 
> -----Original Message-----
> From: Julien Meunier [mailto:julien.meunier@nokia.com]
> Sent: Monday, September 10, 2018 11:51 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Xiao W
> <xiao.w.wang@intel.com>
> Cc: dev@dpdk.org
> Subject: [PATCH] net/fm10k: add imissed stats
> 
> Add support of imissed and q_errors statistics, reported by PCIE_QPRDC
> register (see datasheet, section 11.27.2.60), which exposes the number of
> receive packets dropped for a queue.
> 
> Signed-off-by: Julien Meunier <julien.meunier@nokia.com>
> ---
>  drivers/net/fm10k/fm10k_ethdev.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/fm10k/fm10k_ethdev.c
> b/drivers/net/fm10k/fm10k_ethdev.c
> index 541a49b..a9af6c2 100644
> --- a/drivers/net/fm10k/fm10k_ethdev.c
> +++ b/drivers/net/fm10k/fm10k_ethdev.c
> @@ -1325,7 +1325,7 @@ fm10k_xstats_get(struct rte_eth_dev *dev, struct
> rte_eth_xstat *xstats,  static int  fm10k_stats_get(struct rte_eth_dev *dev,
> struct rte_eth_stats *stats)  {
> -	uint64_t ipackets, opackets, ibytes, obytes;
> +	uint64_t ipackets, opackets, ibytes, obytes, imissed;
>  	struct fm10k_hw *hw =
>  		FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>  	struct fm10k_hw_stats *hw_stats =
> @@ -1336,22 +1336,25 @@ fm10k_stats_get(struct rte_eth_dev *dev, struct
> rte_eth_stats *stats)
> 
>  	fm10k_update_hw_stats(hw, hw_stats);
> 
> -	ipackets = opackets = ibytes = obytes = 0;
> +	ipackets = opackets = ibytes = obytes = imissed = 0;
>  	for (i = 0; (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) &&
>  		(i < hw->mac.max_queues); ++i) {
>  		stats->q_ipackets[i] = hw_stats->q[i].rx_packets.count;
>  		stats->q_opackets[i] = hw_stats->q[i].tx_packets.count;
>  		stats->q_ibytes[i]   = hw_stats->q[i].rx_bytes.count;
>  		stats->q_obytes[i]   = hw_stats->q[i].tx_bytes.count;
> +		stats->q_errors[i]   = hw_stats->q[i].rx_drops.count;
>  		ipackets += stats->q_ipackets[i];
>  		opackets += stats->q_opackets[i];
>  		ibytes   += stats->q_ibytes[i];
>  		obytes   += stats->q_obytes[i];
> +		imissed  += stats->q_errors[i];
>  	}
>  	stats->ipackets = ipackets;
>  	stats->opackets = opackets;
>  	stats->ibytes = ibytes;
>  	stats->obytes = obytes;
> +	stats->imissed = imissed;
>  	return 0;
>  }
> 
> Acked-by: Xiao Wang <xiao.w.wang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
> 
> 
> --
> 2.10.2
diff mbox series

Patch

diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 541a49b..a9af6c2 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -1325,7 +1325,7 @@  fm10k_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,
 static int
 fm10k_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 {
-	uint64_t ipackets, opackets, ibytes, obytes;
+	uint64_t ipackets, opackets, ibytes, obytes, imissed;
 	struct fm10k_hw *hw =
 		FM10K_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	struct fm10k_hw_stats *hw_stats =
@@ -1336,22 +1336,25 @@  fm10k_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 
 	fm10k_update_hw_stats(hw, hw_stats);
 
-	ipackets = opackets = ibytes = obytes = 0;
+	ipackets = opackets = ibytes = obytes = imissed = 0;
 	for (i = 0; (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) &&
 		(i < hw->mac.max_queues); ++i) {
 		stats->q_ipackets[i] = hw_stats->q[i].rx_packets.count;
 		stats->q_opackets[i] = hw_stats->q[i].tx_packets.count;
 		stats->q_ibytes[i]   = hw_stats->q[i].rx_bytes.count;
 		stats->q_obytes[i]   = hw_stats->q[i].tx_bytes.count;
+		stats->q_errors[i]   = hw_stats->q[i].rx_drops.count;
 		ipackets += stats->q_ipackets[i];
 		opackets += stats->q_opackets[i];
 		ibytes   += stats->q_ibytes[i];
 		obytes   += stats->q_obytes[i];
+		imissed  += stats->q_errors[i];
 	}
 	stats->ipackets = ipackets;
 	stats->opackets = opackets;
 	stats->ibytes = ibytes;
 	stats->obytes = obytes;
+	stats->imissed = imissed;
 	return 0;
 }