On 19/01/2023 15:06, Robin Jarry wrote:
Reuse the --record-core-cycles option to account for busy cycles. One
turn of packet_fwd_t is considered "busy" if there was at least one
received or transmitted packet.

Add a new busy_cycles field in struct fwd_stream. Update get_end_cycles
to accept an additional argument for the number of processed packets.
Update fwd_stream.busy_cycles when the number of packets is greater than
zero.

When --record-core-cycles is specified, register a callback with
rte_lcore_register_usage_cb(). In the callback, use the new lcore_id
field in struct fwd_lcore to identify the correct index in fwd_lcores
and return the sum of busy/total cycles of all fwd_streams.

This makes the cycles counters available in rte_lcore_dump() and the
lcore telemetry API:

  testpmd> dump_lcores
  lcore 3, socket 0, role RTE, cpuset 3
  lcore 4, socket 0, role RTE, cpuset 4, busy cycles 1228584096/9239923140
  lcore 5, socket 0, role RTE, cpuset 5, busy cycles 1255661768/9218141538

  --> /eal/lcore/info,4
  {
    "/eal/lcore/info": {
      "lcore_id": 4,
      "socket": 0,
      "role": "RTE",
      "cpuset": [
        4
      ],
      "busy_cycles": 10623340318,
      "total_cycles": 55331167354
    }
  }

Signed-off-by: Robin Jarry <rja...@redhat.com>
Acked-by: Morten Brørup <m...@smartsharesystems.com>
Acked-by: Konstantin Ananyev <konstantin.v.anan...@yandex.ru>
---

Notes:
     v5 -> v6: No change.

  app/test-pmd/5tswap.c         |  5 +++--
  app/test-pmd/csumonly.c       |  6 +++---
  app/test-pmd/flowgen.c        |  2 +-
  app/test-pmd/icmpecho.c       |  6 +++---
  app/test-pmd/iofwd.c          |  5 +++--
  app/test-pmd/macfwd.c         |  5 +++--
  app/test-pmd/macswap.c        |  5 +++--
  app/test-pmd/noisy_vnf.c      |  4 ++++
  app/test-pmd/rxonly.c         |  5 +++--
  app/test-pmd/shared_rxq_fwd.c |  5 +++--
  app/test-pmd/testpmd.c        | 39 ++++++++++++++++++++++++++++++++++-
  app/test-pmd/testpmd.h        | 14 +++++++++----
  app/test-pmd/txonly.c         |  7 ++++---
  13 files changed, 81 insertions(+), 27 deletions(-)

Reviewed-by: Kevin Laatz <kevin.la...@intel.com>


Reply via email to