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 63145A00C4; Sat, 6 Aug 2022 00:01:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9CEC742C9C; Sat, 6 Aug 2022 00:00:44 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id AECA640697 for ; Sat, 6 Aug 2022 00:00:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659736837; x=1691272837; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=KwJoE32OviBspvMQplNuoy8xoKheS55ft5ouYGAvgJE=; b=JIQITuteZV5vQCz7rBeR8z0R2hOAPMBC6nysJE3sqDGsCS467iZPgo95 o4GZPFuRd7l3dVayv2OXeZ8RHIwG/MFYMWJfY+9M1Ab9i5ukogLRRiMmZ u7TX/0xlu7BpoQpRBJ1GPqQfoJWc9eLWYDu4nSGm3eNd7/P0PVEfF1oFv +UBjceLR3cV2Y2wSjD0fsA+rpRTEXABTfDRIvKmSnAB8ky3Trx0uyLvQ0 3D3eqKMmyePkXLzHbosGqECKEy9CkaTRDTdFDC2c41aCLMz1kqVWHOzcU PGli9j5gZExdXOhjrbxSpuPJPnifh9Qihkwz9zQt9eacOoS1MWWxqvpFY w==; X-IronPort-AV: E=McAfee;i="6400,9594,10430"; a="273348511" X-IronPort-AV: E=Sophos;i="5.93,217,1654585200"; d="scan'208";a="273348511" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Aug 2022 15:00:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,217,1654585200"; d="scan'208";a="693137546" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com.) ([10.237.223.157]) by FMSMGA003.fm.intel.com with ESMTP; 05 Aug 2022 15:00:31 -0700 From: Cristian Dumitrescu To: dev@dpdk.org Subject: [PATCH 02/10] port: adjust the sink port counters Date: Fri, 5 Aug 2022 22:00:21 +0000 Message-Id: <20220805220029.1096212-3-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805220029.1096212-1-cristian.dumitrescu@intel.com> References: <20220805220029.1096212-1-cristian.dumitrescu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The sink port is tasked to drop all packets, hence the packet and byte counters should be named to reflect the drop operation. Signed-off-by: Cristian Dumitrescu --- lib/port/rte_swx_port_source_sink.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/port/rte_swx_port_source_sink.c b/lib/port/rte_swx_port_source_sink.c index d3cf42c30b..757a2c4a2e 100644 --- a/lib/port/rte_swx_port_source_sink.c +++ b/lib/port/rte_swx_port_source_sink.c @@ -299,8 +299,8 @@ sink_pkt_tx(void *port, struct rte_swx_pkt *pkt) m->pkt_len = pkt->length; m->data_off = (uint16_t)pkt->offset; - p->stats.n_pkts++; - p->stats.n_bytes += pkt->length; + p->stats.n_pkts_drop++; + p->stats.n_bytes_drop += pkt->length; #ifdef RTE_PORT_PCAP if (p->f_dump) { @@ -335,8 +335,8 @@ __sink_pkt_clone_tx(void *port, struct rte_swx_pkt *pkt, uint32_t truncation_len m->pkt_len = pkt->length; m->data_off = (uint16_t)pkt->offset; - p->stats.n_pkts++; - p->stats.n_bytes += pkt->length; + p->stats.n_pkts_drop++; + p->stats.n_bytes_drop += pkt->length; p->stats.n_pkts_clone++; #ifdef RTE_PORT_PCAP -- 2.34.1