> -----Original Message----- > From: Ferruh Yigit <ferruh.yi...@intel.com> > Sent: Thursday, 28 January 2021 20:21 > To: Ido Goshen <i...@cgstowernetworks.com> > Cc: dev@dpdk.org > Subject: Re: [PATCH 1/1] net/pcap: imissed stats support > > On 1/25/2021 5:58 PM, Ido Goshen wrote: > > Signed-off-by: Ido Goshen <i...@cgstowernetworks.com> > > <...> > > > @@ -695,6 +708,10 @@ eth_stats_get(struct rte_eth_dev *dev, struct > rte_eth_stats *stats) > > stats->q_ibytes[i] = internal->rx_queue[i].rx_stat.bytes; > > rx_packets_total += stats->q_ipackets[i]; > > rx_bytes_total += stats->q_ibytes[i]; > > + unsigned long rx_missed = eth_stats_get_pcap_missed(dev, i); > > + if (rx_missed) > > + rx_missed_total = rx_missed - > > + internal->rx_queue[i].rx_stat.missed_reset; > > 'ps_drop' seems u_32 type, do you know how it behaves on overflow? Do you > think do we need a check here for overflow?
Right, it may overflow after few hours. I don't see a way to fully solve it w/o periodic sampling which is quite an overhead To compensate and avoid getting weird high ("negative") values I can check if the last retrieved value is higher than the current, then either zero it (restart) which will reflect rollover, or add UINT_MAX hoping there was only one rollover since last sample Please advice