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 0D520A0A0B; Mon, 1 Feb 2021 12:49:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A79140693; Mon, 1 Feb 2021 12:48:59 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 9A5E240687 for ; Mon, 1 Feb 2021 12:48:57 +0100 (CET) IronPort-SDR: l+sWrzkgIr2ecsOmb7ghCtG1jFvYzvixcldxhma1P6cAA5WSTZDNU2Wn7xIPESgtScbnaxSyxW j7bXJ0no0xnQ== X-IronPort-AV: E=McAfee;i="6000,8403,9881"; a="179894597" X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="179894597" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 03:48:55 -0800 IronPort-SDR: CJBtOvR8DOA31BQbzgUDfXEFl2EI0X0vKK6L1d/rZ0gyqAt0NBvJsKjA34gtUDaoMSxZEwUhXs KMEUR3LHtt/w== X-IronPort-AV: E=Sophos;i="5.79,392,1602572400"; d="scan'208";a="390874645" 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 03:48:54 -0800 To: Ido Goshen Cc: dev@dpdk.org References: <20210201083012.28544-1-ido@cgstowernetworks.com> From: Ferruh Yigit Message-ID: <732a3fe2-1a64-1861-4360-2df996e2b5f3@intel.com> Date: Mon, 1 Feb 2021 11:48:49 +0000 MIME-Version: 1.0 In-Reply-To: <20210201083012.28544-1-ido@cgstowernetworks.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2] 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:30 AM, Ido Goshen wrote: > Signed-off-by: Ido Goshen > --- > v2: > * sum all queues (rx_missed_total += fix) > * null pcap protection > * inter stop/start persistancy (counter won't reset on stop) > > drivers/net/pcap/rte_eth_pcap.c | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c > index a32b1f3f3..18c59d61c 100644 > --- a/drivers/net/pcap/rte_eth_pcap.c > +++ b/drivers/net/pcap/rte_eth_pcap.c > @@ -58,6 +58,8 @@ struct queue_stat { > volatile unsigned long pkts; > volatile unsigned long bytes; > volatile unsigned long err_pkts; > + volatile unsigned long missed_reset; > + volatile unsigned long missed_mnemonic; Can you please put some comments why 'missed_mnemonic' is required? <...> > @@ -695,6 +715,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_pcap_stats_missed_get(dev, i) + > + internal->rx_queue[i].rx_stat.missed_mnemonic - > + internal->rx_queue[i].rx_stat.missed_reset; Instead of including the 'missed_mnemonic' to the regular calculation, what do you think to save the 'imissed' value to 'missed_mnemonic' in 'port_stop' and load it back in the 'eth_dev_start'? This balanced usage can simplify the code I think.