Skip to contentSkip to conversation

Issues with packet capture counting in dpdk-dumpcap

DPDK/other Bug 1604 [email protected] 1 participant 1 message Dec 17, 2024

lore
Share & tools
lore
#0 lore raw

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: [email protected]
          Reporter: [email protected]

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;
                }
        }
}
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.