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 EEADC45EF0 for ; Fri, 20 Dec 2024 00:59:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D2A894025F; Fri, 20 Dec 2024 00:59:06 +0100 (CET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 700CE40265 for ; Fri, 20 Dec 2024 00:59:05 +0100 (CET) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2156e078563so12495515ad.2 for ; Thu, 19 Dec 2024 15:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1734652744; x=1735257544; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0pnhS222E9gwwAnm9BqUwXU4lJ+wnZgjGVqwZ/ZIg+Q=; b=bcbh252O1pXbRu3RYMayoKieDCEjBXPRP/llLqBKx4AfK4iDdFPZdKsBnidxM2NIBG 3YMZCWbXnCZJnKmoSmNSpjmOt2CwLUnXArNfXhcFhx+hhbL+Dt/EGWmSgtSZJc/UWQ+s TXKezxOQXiBqrclCdVREUjAqeCmKXhFGXtHRy3/c/h7Il6IbDEJI/rWiraPMWOZ9BYQy b6oeEB9ilstDYOICthfwu85mEMQgYC891ST2VJMzXgh2B5qnGx5+6dpMkZZWfgE855B6 aUyeWDzinCMUoxIS2s0sFe9mZG8qOIRbQoEFkjr0dHWfzxo7VL299KftkM/PjCh9efYm eogQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734652744; x=1735257544; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0pnhS222E9gwwAnm9BqUwXU4lJ+wnZgjGVqwZ/ZIg+Q=; b=DS+Qjf7nSTDUPxr4K+p+5m/PUKDYEtSvnnhgDQKbi+BsBoYb5zrFiUvJwIpG/LTuF1 d5GTLJL1Y9DX+ZwZzKvHrTnAPU1oeskG+/RNqefIx8YezYzTIBDMTvqsB+7jezFfPkKY Lg0mhpBEj526dICwPnxTvCN6WaJ2u0IRhgbth2OasXyPV0A5qf0IBqICwPPEqhnT2pQC MSy9weP+JnNE7q90u0OKzD+wrLe55p8l9FF4SuU0DqVZ562z2tD8OnJ+niaSulBAzkEk zZQ8UWzuZbFJEEHLSP4c/9fZCmHaxtrKygVv/oYTeoYGoFJ5HdagFTb/fkzW5wQMpyMF I0Mw== X-Forwarded-Encrypted: i=1; AJvYcCWAqbQE+QhZYU0BFH/YE3drP6J8t7PJNnUItXfeN8oLTGUal+C9TLeZyH2hEnfGFOhtBAJaiyc=@dpdk.org X-Gm-Message-State: AOJu0YwGz1pBh3u/Q50ChE3WK6jsQyKxixSki7b6DVudyxyDhfk8er5O nZPeiEtA2aJ7mldfYEXJ75LzejzywbMezzHmyg9MTk0gL2MwZU7U5JTyBYFhVgE= X-Gm-Gg: ASbGncubffC8sxfjNFhFTsG4oKHpO2A0s0rvLoUXOYP3NKQcTpMOD7QDCb1EmQfwxzu ImbH5WavmqN//tLgOxsmNH6Lzql4YWDEN/wkEbpDhK2cxqM2i4qXl7AnAA+DG3ds+9/9wn71GiV Ce4y78Qq4MNCCK8yLfnwYa7gcQbEo37IC0OHIojQzhnMiUVRR7wwb2q3753IeM7I0ulm27USMB2 usukj8P2GyGK1t5AQC0bqDvD+XLVt/gJdS7VClHsKBGweegQrjZOk70BPduD23sr56UET+a5gZb vEchQEX1rQjQgqQLXAH+eaNL9Kui3QohBg== X-Google-Smtp-Source: AGHT+IGoHAIk+nlwHk/ciut1E+q+qox7spDil/MoyvpLcfjebvDkkwOIDma1qlMNt4/osT5vEHm+aA== X-Received: by 2002:a17:903:230e:b0:215:781a:9183 with SMTP id d9443c01a7336-219e6f1094dmr9769075ad.38.1734652744399; Thu, 19 Dec 2024 15:59:04 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc97432dsm17982565ad.110.2024.12.19.15.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 15:59:04 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , stable@dpdk.org Subject: [PATCH] pdump: clear statistics when enabled Date: Thu, 19 Dec 2024 15:58:53 -0800 Message-ID: <20241219235853.854132-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org The pdump statistics are used to keep track of the number of packets captured, filtered, etc. These need not be cumalative and instead should be start counting when capture starts. This fixes the issue where multiple invocations of dumpcap would include counts from previous invocations. Bugzilla ID: 1604 Fixes: 10f726efe26c ("pdump: support pcapng and filtering") Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- lib/pdump/rte_pdump.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/pdump/rte_pdump.c b/lib/pdump/rte_pdump.c index 679c3dd0b5..0e6ffc167b 100644 --- a/lib/pdump/rte_pdump.c +++ b/lib/pdump/rte_pdump.c @@ -199,6 +199,8 @@ pdump_register_rx_callbacks(enum pdump_version ver, rte_errno); return rte_errno; } + + memset(&pdump_stats->rx[port][qid], 0, sizeof(struct rte_pdump_stats)); } else if (operation == DISABLE) { int ret; @@ -257,6 +259,7 @@ pdump_register_tx_callbacks(enum pdump_version ver, rte_errno); return rte_errno; } + memset(&pdump_stats->tx[port][qid], 0, sizeof(struct rte_pdump_stats)); } else if (operation == DISABLE) { int ret; -- 2.45.2