<html>
    <head>
      <base href="https://bugs.dpdk.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8" class="bz_new_table">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Issues with packet capture counting in dpdk-dumpcap"
   href="https://bugs.dpdk.org/show_bug.cgi?id=1604">1604</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Issues with packet capture counting in dpdk-dumpcap
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DPDK
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>23.11
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>other
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dev@dpdk.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>junwang01@cestc.cn
          </td>
        </tr>

        <tr>
          <th>Target Milestone</th>
          <td>---
          </td>
        </tr></table>
      <p>
        <div class="bz_comment_block">
          <pre class="bz_comment_text">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;
                }
        }
}
          </pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
      <div itemscope itemtype="http://schema.org/EmailMessage">
        <div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
          
          <link itemprop="url" href="https://bugs.dpdk.org/show_bug.cgi?id=1604">
          <meta itemprop="name" content="View bug">
        </div>
        <meta itemprop="description" content="Bugzilla bug update notification">
      </div>
    </body>
</html>