This series adds --format json support to five more ovs-appctl commands:
fdb/stats-show, upcall/show, dpif-netdev/pmd-sleep-show,
dpif-netdev/pmd-perf-show and dpctl/show.

Changes since v4:
- Only the two tests added in v4 changed, the code is untouched.
- 2/5: the second datapath of the upcall/show test now uses the netdev
  type instead of the system one.  --enable-dummy=override only
  overrides the datapath types that are already registered, and the
  system type is not registered on the platforms without the kernel
  datapath, so the bridge failed to be created there.
- 5/5: the dpctl/show test does not expect the cache statistics
  anymore.  They are reported only when the datapath reports a non zero
  mask cache hit count, which a datapath that has not forwarded any
  packet yet never does, so the check depended on a state the test does
  not create.

Changes since v3:
- Rebased on top of the current main.
- Series wide: no key is reported with a null value anymore.  A key that
  has no value is simply not reported (Ilya).
- Series wide: each patch now carries its own NEWS entry, instead of a
  single combined one in the last patch (Ilya, v1).
- 1/5: dropped the bridge_name argument of both helpers and moved the
  mac_learning rwlock into them (Eelco).
- 2/5: declaration order and blank line fixes (Eelco); added a test
  covering two datapaths at once (Eelco, v1).
- 3/5: declaration order fix, dropped a ds_destroy() on a path where the
  dynamic string is never written (Eelco).
- 4/5: the raw counters and the derived ratios are now computed once by
  pmd_perf_summarize() and shared by the text and the JSON formatter
  (Ilya); reworked the JSON schema (Ilya); all the JSON handling moved
  into the output format check, so the per PMD loop is text only again,
  plus prototype, declaration order and indentation fixes (Eelco).
- 5/5: dropped json_integer_or_null_create(), grouped the cache hit
  statistics and the cache level configuration under a single "cache"
  object (Ilya); include order, declaration order and blank line fixes,
  and dps_for_each() now reports the datapath enumeration failure it
  used to return silently, which answers "is ds set in all error cases
  for json?" with "it was not, now it is" (Eelco).

Changes since v2:
- 4/5: target dpif-netdev/pmd-perf-show instead of
  dpif-netdev/pmd-stats-show, which was removed in favor of
  pmd-perf-show.  The JSON formatter lives in dpif-netdev-perf.c
  beside the text formatter, and reports the aggregated "main" thread
  in addition to the PMD threads.
- 5/5: make "caches" an independent field (null when unavailable),
  matching the "masks" and "cache" fields, so the schema is consistent
  regardless of datapath capabilities.
- 1-3/5 are unchanged since v2.

Changes since v1:
- All patches: split the main handler into separate text and JSON
  helper functions (Eelco).
- All patches: use dashes (not underscores) in JSON field names, and
  full words instead of abbreviations (Eelco, Ilya).
- All patches: validate the complete pretty-printed JSON output in
  tests rather than grepping for individual fields (Eelco).
- 1/5: use bridge name as the top-level key; group statistics into
  "entries" and "events" sub-objects (Eelco, Ilya).
- 2/5: use datapath name as the top-level key; group flow counters
  under "flows"; index revalidators by ID as an object (Eelco).
- 3/5: use "threads" as the container key and thread names (pmd-cXX)
  as keys, matching the names visible in system tools like "top"
  (Ilya, Eelco).  Drop the "_id" suffix from field names (Ilya).
- 4/5: use thread names as keys (matching 3/5); group average metrics
  under an "averages" sub-object (Ilya).
- 5/5: use datapath name as the top-level key and port name as port
  key; use "port-number" field name (Eelco, Ilya).  Make masks, cache,
  and statistics independent fields (null when unavailable) for a
  consistent schema regardless of command-line flags (Eelco).

Three things worth a second look:

- Dropping the null values conflicts with an earlier request on v1, to
  never let the schema depend on the command line flags, and to report
  an empty object or a null for what is not available.  Concretely, the
  per port "statistics" object of dpctl/show is now reported only with
  -s.  Reporting an always empty object without -s would satisfy both
  requests, but it would claim there are no statistics rather than that
  none were asked for, so the key is omitted instead.  Please confirm
  which of the two behaviours is wanted.

- The pmd-perf-show schema sketch posted on v3 only covered part of the
  output, so the "iterations" and "cycles" objects and the transmit side
  of "packets" and "averages" were extended following the same shape.
  The resulting schema is summarized in the commit message of 4/5.
  Please confirm that the extension is what was meant.

- fdb/stats-show still takes exactly one bridge, while fdb/show has
  since grown multi bridge support and an object keyed JSON output.
  Making fdb/stats-show match is left to a separate patch.

Timothy Redaelli (5):
  ofproto-dpif: Add JSON output to fdb/stats-show.
  ofproto-dpif-upcall: Add JSON output to upcall/show.
  dpif-netdev: Add JSON output to pmd-sleep-show.
  dpif-netdev: Add JSON output to pmd-perf-show.
  dpctl: Add JSON output to dpctl/show.

 NEWS                          |   8 +
 lib/dpctl.c                   | 216 +++++++++++++++-
 lib/dpctl.h                   |  11 +
 lib/dpctl.man                 |   8 +
 lib/dpif-netdev-perf.c        | 450 ++++++++++++++++++++++++++++++----
 lib/dpif-netdev-perf.h        |  11 +
 lib/dpif-netdev-unixctl.man   |   9 +
 lib/dpif-netdev.c             | 125 +++++++++-
 ofproto/ofproto-dpif-upcall.c |  95 +++++--
 ofproto/ofproto-dpif.c        |  94 +++++--
 tests/dpctl.at                |  88 +++++++
 tests/ofproto-dpif.at         |  64 ++++-
 tests/pmd.at                  | 111 +++++++++
 tests/system-traffic.at       |  31 +++
 vswitchd/ovs-vswitchd.8.in    |   3 +
 15 files changed, 1225 insertions(+), 99 deletions(-)


base-commit: d6a632a9b16e5dca2e51eefded3a545e68ea6ba3
-- 
2.55.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to