From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2AD09A0A0B; Mon, 1 Feb 2021 10:25:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D14BC16065F; Mon, 1 Feb 2021 10:25:46 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 38E3940693 for ; Mon, 1 Feb 2021 10:25:45 +0100 (CET) IronPort-SDR: qQXFdJANMkCmp3FHG0iMJHw2L5hUFp95CCPJuFzJIXhmQME3YZmq6erSWP32vt7XiCZkit60RH gpEbh3N0ADcQ== X-IronPort-AV: E=McAfee;i="6000,8403,9881"; a="180803147" X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="180803147" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 01:25:43 -0800 IronPort-SDR: cLQuUB88tZU7UBbbqfmRWe4nAf/pyYnytfjE53RkyP2VwEa1oSnVQ0gqgWGdHvtTTkaODipf1A YPb7nItrH4fA== X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="390826366" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.210.23]) ([10.213.210.23]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 01:25:42 -0800 To: Ido Goshen Cc: "dev@dpdk.org" References: <20210125175836.87200-1-ido@cgstowernetworks.com> <23f32b85-9e81-e16e-4aa0-173e1955a65c@intel.com> From: Ferruh Yigit Message-ID: <7f525cc7-260f-448a-4a05-763e0e84dd8f@intel.com> Date: Mon, 1 Feb 2021 09:25:39 +0000 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 1/1] net/pcap: imissed stats support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 2/1/2021 8:53 AM, Ido Goshen wrote: > > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Thursday, 28 January 2021 20:21 >> To: Ido Goshen >> 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 >> >> <...> >> >>> @@ -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 Agree > 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 > I would go with single rollover assumption, but comment this in the code.