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 5709545ECA; Tue, 17 Dec 2024 09:06:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F259D402A9; Tue, 17 Dec 2024 09:06:21 +0100 (CET) Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178]) by mails.dpdk.org (Postfix) with ESMTP id 8917A402A3 for ; Tue, 17 Dec 2024 09:06:20 +0100 (CET) Received: by inbox.dpdk.org (Postfix, from userid 33) id 6B10A45ECB; Tue, 17 Dec 2024 09:06:20 +0100 (CET) From: bugzilla@dpdk.org To: dev@dpdk.org Subject: [DPDK/other Bug 1604] Issues with packet capture counting in dpdk-dumpcap Date: Tue, 17 Dec 2024 08:06:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: other X-Bugzilla-Version: 23.11 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: junwang01@cestc.cn X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: multipart/alternative; boundary=17344227800.0B1Aa.945884 Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 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 --17344227800.0B1Aa.945884 Date: Tue, 17 Dec 2024 09:06:20 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All https://bugs.dpdk.org/show_bug.cgi?id=3D1604 Bug ID: 1604 Summary: Issues with packet capture counting in dpdk-dumpcap Product: DPDK Version: 23.11 Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: Normal Component: other Assignee: dev@dpdk.org Reporter: junwang01@cestc.cn Target Milestone: --- Is the final count returned during packet capture with DPDK Dumpcap a cumulative value, and could there be any issues with it? [root@dpdk04 /]# /dpdk/app/dpdk-dumpcap -i 0000:1b:00.0 File: /tmp/dpdk-dumpcap_0_0000:1b:00.0_20241217074027.pcapng Capturing on '0000:1b:00.0' Packets captured: 20 ^C Packets received/dropped on interface '0000:1b:00.0': 20/0 (100.0) [root@dpdk04 /]# /dpdk/app/dpdk-dumpcap -i 0000:1b:00.0 File: /tmp/dpdk-dumpcap_0_0000:1b:00.0_20241217074045.pcapng Capturing on '0000:1b:00.0' Packets captured: 13 ^C Packets received/dropped on interface '0000:1b:00.0': 33/0 (100.0) [root@dpdk04 /]# /dpdk/app/dpdk-dumpcap -i 0000:1b:00.0 File: /tmp/dpdk-dumpcap_0_0000:1b:00.0_20241217074055.pcapng Capturing on '0000:1b:00.0' Packets captured: 40 ^C Packets received/dropped on interface '0000:1b:00.0': 73/0 (100.0) I noticed that the final statistics of dpdk-dumpcap for packet capture show that received is a cumulative value. Wouldn't it be more appropriate to have the correct value for each execution instead? After analyzing the code, I confirmed that this cumulative design applies to both received and dropped statistics. static void pdump_sum_stats(uint16_t port, uint16_t nq, struct rte_pdump_stats stats[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT], struct rte_pdump_stats *total) { uint64_t *sum =3D (uint64_t *)total; unsigned int i; uint64_t val; uint16_t qid; for (qid =3D 0; qid < nq; qid++) { const RTE_ATOMIC(uint64_t) *perq =3D (const uint64_t __rte_= atomic *)&stats[port][qid]; for (i =3D 0; i < sizeof(*total) / sizeof(uint64_t); i++) { val =3D rte_atomic_load_explicit(&perq[i], rte_memory_order_relaxed); sum[i] +=3D val; } } } --=20 You are receiving this mail because: You are the assignee for the bug.= --17344227800.0B1Aa.945884 Date: Tue, 17 Dec 2024 09:06:20 +0100 MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All
Bug ID 1604
Summary Issues with packet capture counting in dpdk-dumpcap
Product DPDK
Version 23.11
Hardware All
OS All
Status UNCONFIRMED
Severity normal
Priority Normal
Component other
Assignee dev@dpdk.org
Reporter junwang01@cestc.cn
Target Milestone ---

Is the final count returned during=
 packet capture with DPDK Dumpcap a
cumulative value, and could there be any issues with it?

[root@dpdk04 /]# /dpdk/app/dpdk-dumpcap -i 0000:1b:00.0
File: /tmp/dpdk-dumpcap_0_0000:1b:00.0_20241217074027.pcapng
Capturing on '0000:1b:00.0'
Packets captured: 20 ^C
Packets received/dropped on interface '0000:1b:00.0': 20/0 (100.0)

[root@dpdk04 /]# /dpdk/app/dpdk-dumpcap -i 0000:1b:00.0
File: /tmp/dpdk-dumpcap_0_0000:1b:00.0_20241217074045.pcapng
Capturing on '0000:1b:00.0'
Packets captured: 13 ^C
Packets received/dropped on interface '0000:1b:00.0': 33/0 (100.0)

[root@dpdk04 /]# /dpdk/app/dpdk-dumpcap -i 0000:1b:00.0
File: /tmp/dpdk-dumpcap_0_0000:1b:00.0_20241217074055.pcapng
Capturing on '0000:1b:00.0'
Packets captured: 40 ^C
Packets received/dropped on interface '0000:1b:00.0': 73/0 (100.0)

I noticed that the final statistics of dpdk-dumpcap for packet capture show
that received is a cumulative value. Wouldn't it be more appropriate to have
the correct value for each execution instead? After analyzing the code, I
confirmed that this cumulative design applies to both received and dropped
statistics.

static void
pdump_sum_stats(uint16_t port, uint16_t nq,
                struct rte_pdump_stats
stats[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],
                struct rte_pdump_stats *total)
{
        uint64_t *sum =3D (uint64_t *)total;
        unsigned int i;
        uint64_t val;
        uint16_t qid;

        for (qid =3D 0; qid < nq; qid++) {
                const RTE_ATOMIC(uint64_t) *perq =3D (const uint64_t __rte_=
atomic
*)&stats[port][qid];

                for (i =3D 0; i < sizeof(*total) / sizeof(uint64_t); i++=
) {
                        val =3D rte_atomic_load_explicit(&perq[i],
rte_memory_order_relaxed);
                        sum[i] +=3D val;
                }
        }
}
          


You are receiving this mail because:
  • You are the assignee for the bug.
=20=20=20=20=20=20=20=20=20=20
= --17344227800.0B1Aa.945884--