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 CF7CE45EF0; Fri, 20 Dec 2024 00:59:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C9BC40290; Fri, 20 Dec 2024 00:59:07 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 66B144025F for ; Fri, 20 Dec 2024 00:59:05 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2166360285dso13254285ad.1 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=HKkijpeggJvsPMMa5lzoDyHwKYohiDV7Ecsvn+5QET7n5wdpWDHhAlZH7ygfl8vRh1 fTb9C8GgBUdrMqt5Rv37VrCaTXpINp8BerJsmTBX+64g/2RKv9B3E2u0YiwZ/hMRoj1J HiFiUB3VOnsklDonXpEzSJt8539G2x3zOF3jXc+bY1aiSQ/ukb5xy0PDeZs1ogu8KcM/ C3K6piCGiFRLULrZ0b+5vsr3C9rKPS6Y0YrAvFMB8G3xssKS5yiiaNSzL3ysymou2foO XBu0zfnsmOLTNMTC5f7jO/Rtsl3E/EkgKGCsoS9I+pPHZ6k17uNXzkZMeZFyh5rpzmDe +S8Q== X-Gm-Message-State: AOJu0YwpLtVHg/QtE8Oc6lVEr7oxXhIIK76En/pYFiv9AUP5D6/lV9Ze 9YjtzUlXRuWITxjv3DMgFQ5iZ7uuU+ND5jB91qi5jl1qiZNb154RgCW/qnctjjCZv1q6IGThSoy Juak= X-Gm-Gg: ASbGncvXbde9QNwSTOOSiEj7Jo//MdCprAUVnDtINVOZkdF88looS7nWv8QAY9pWyjx mwAkCiaLIMgj63ReXAIz71DtTwHaJk7Nvzyn3YPNl6uXnrW/86CNc51qt9tvZACLO2+hhPv3PLt 8MhtccS49Y5w5FlURGVmEh1/mylizZcg/CkNhhOfQdNzbuZ2SjTioNIMVcFRkERkr1wCZv0trGx SJDSm3zRufTYJTnbFyiVpeZUDvJxS22L7MLh1H+Yq23qp7vH1fOe7n4l720p9JPkOkN7FApx5qc ekpktC6FG7yiddPKmbd9DBhb9+pcv0CFLA== 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: 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 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