DPDK patches and discussions
 help / color / mirror / Atom feed
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	[thread overview]
Message-ID: <bug-1604-3@http.bugs.dpdk.org/> (raw)

[-- Attachment #1: Type: text/plain, Size: 2430 bytes --]

https://bugs.dpdk.org/show_bug.cgi?id=1604

            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 = (uint64_t *)total;
        unsigned int i;
        uint64_t val;
        uint16_t qid;

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

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

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #2: Type: text/html, Size: 4335 bytes --]

                 reply	other threads:[~2024-12-17  8:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-1604-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).