Skip to content

[watermarkstat] show queue watermark all / persistent-watermark all errors with "Object map is empty!" on DNX/VOQ platforms #4594

@pinky-nexthop

Description

@pinky-nexthop

Description

On Broadcom DNX (VOQ) platforms, show queue watermark all and
show queue persistent-watermark all fail with a hard error:

admin@sonic:~$ show queue watermark all
Object map is empty!

(exit code 1)

These platforms type their queues as UC/MC and do not expose
SAI_QUEUE_TYPE_ALL queues, so the q_shared_all object map built from
COUNTERS_QUEUE_NAME_MAP is empty. watermarkstat treats an empty object
map for q_shared_all as a fatal error.

show queue watermark unicast works fine and reports real values, so this
is specifically the all aggregation that is broken on these platforms.

Steps to reproduce

  1. On a Broadcom DNX / VOQ platform (e.g. Q3D / Jericho family):
  2. show queue watermark all
  3. show queue persistent-watermark all

Expected behavior

Either emit a friendly message and exit 0 (consistent with the
q_shared_multi behavior added in #2408), e.g.:

Object map from the COUNTERS_DB is empty because queue type ALL is not configured in the CONFIG_DB!

…or otherwise degrade gracefully rather than erroring out.

Actual behavior

Object map is empty! printed to stderr, command exits 1.

Root cause

In scripts/watermarkstat, build_header() only special-cases the empty
object map for q_shared_multi; every other type (including q_shared_all)
falls through to sys.exit(1):

if len(header_idx_set) == 0:
    if counter_type != 'q_shared_multi':
        print("Object map is empty!", file=sys.stderr)
        sys.exit(1)
    else:
        print("Object map from the COUNTERS_DB is empty because the multicast queues are not configured in the CONFIG_DB!")
        sys.exit(0)

Suggested fix: extend the graceful branch to also cover q_shared_all.

Affected commands

  • show queue watermark all
  • show queue persistent-watermark all

Platform / version

  • ASIC: Broadcom DNX (VOQ), e.g. Qumran3D (BCM8887X)
  • Reproduced on a 202511-based image

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions