Skip to content

[Mellanox] Add config sdk nvidia-bluefield sdk techsupport-ct-dump <enabled|disabled> command. - #4696

Open
judsonwilson-nvidia wants to merge 3 commits into
sonic-net:masterfrom
judsonwilson-nvidia:tech_support_ct_dump
Open

[Mellanox] Add config sdk nvidia-bluefield sdk techsupport-ct-dump <enabled|disabled> command.#4696
judsonwilson-nvidia wants to merge 3 commits into
sonic-net:masterfrom
judsonwilson-nvidia:tech_support_ct_dump

Conversation

@judsonwilson-nvidia

Copy link
Copy Markdown
Contributor

Depends on:

sonic-sairedis#1993 (profile parsing), sonic-sairedis#1994 (sentinel cleanup at syncd startup).

Why I did it

SDK Connection Table dumps in techsupport on NVIDIA BlueField DPUs need a runtime enable/disable control. A sentinel file in the syncd container signals whether generate_dump should pass CT_TABLE_DUMP_ENABLE=true to saisdkdump during techsupport collection.

Work item tracking
  • Microsoft ADO (number only): N/A

How I did it

  • Add config platform nvidia-bluefield sdk techsupport-ct-dump {enabled|disabled} to create/remove sentinel file sdk-techsupport-ct-dump.enabled in syncd.
  • Update collect_nvidia_bluefield() in generate_dump to check the sentinel and run saisdkdump -p with CT_TABLE_DUMP_ENABLE=true when enabled.
  • Add unit tests in tests/config_nvidia_bluefield_test.py.

How to verify it

pytest tests/config_nvidia_bluefield_test.py -k techsupport_ct_dump
config platform nvidia-bluefield sdk techsupport-ct-dump enabled
show techsupport   # on BlueField DPU; confirm CT dump in archive
config platform nvidia-bluefield sdk techsupport-ct-dump disabled

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411

Tested branch (Please provide the tested image version)

  • master (202605–202611)

Description for the changelog

Add config platform nvidia-bluefield sdk techsupport-ct-dump command.

…abled>` command.

The command is for enabling, in `show techsupport` on NVIDIA SmartSwitch
DPUs, a platform-specific sdk dump of the Connection Table through the
saisdkdump utility. This part of the implementation creates or deletes a
sentinel file in the syncd container, which is the signal used by the
`show techsupport` command to determine if the feature is enabled.

Signed-off-by: Judson Wilson <judsonw@nvidia.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

croos12
croos12 previously approved these changes Jul 15, 2026
dgsudharsan
dgsudharsan previously approved these changes Jul 16, 2026
@judsonwilson-nvidia judsonwilson-nvidia changed the title Add config sdk nvidia-bluefield sdk techsupport-ct-dump <enabled|disabled> command. [Mellanox] Add config sdk nvidia-bluefield sdk techsupport-ct-dump <enabled|disabled> command. Jul 18, 2026
Comment thread scripts/generate_dump Outdated
echo CT_TABLE_DUMP_ENABLE=true >> "$profile"
'

if docker exec syncd test -f $sdk_techsupport_ct_dump_sentinel; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bare docker here, unlike every other call in this function (${CMD_PREFIX}docker exec). so in --noop/-n this branch probe runs for real and needs syncd up. it's read-only so no mutation, and you do need something to pick the branch — just flagging the dry-run deviation. also: if syncd is unreachable test returns non-zero and you silently fall through to the plain dump (error treated as disabled). the config plugin distinguishes those cases; here it's a silent degrade. fine, but worth a note.

@judsonwilson-nvidia judsonwilson-nvidia Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bare docker here, unlike every other call in this function (${CMD_PREFIX}docker exec). so in --noop/-n this branch probe runs for real and needs syncd up. bare docker here, unlike every other call in this function (${CMD_PREFIX}docker exec). so in --noop/-n this branch probe runs for real and needs syncd up.

This is intentional. I believe this is used for dry run, and I think it's better to have the dry run have conditional behavior that matches a real-run, in this case. This check is relatively short-running compared to the other things in this dump, so it makes sense to do it in dry run.

also: if syncd is unreachable test returns non-zero and you silently fall through to the plain dump (error treated as disabled). the config plugin distinguishes those cases; here it's a silent degrade. fine, but worth a note.

If syncd is not up, there is no CT table to dump. An error message could be nice, but I opted to keep this code simple, partially to reduce the odds that complexity introduces bugs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the second one: added an error message in the failure case.

Comment thread scripts/generate_dump Outdated
fi

${CMD_PREFIX}docker exec syncd sh -c "$prepare_ct_dump_profile_script" _ "$sdk_techsupport_saisdkdump_profile"
${CMD_PREFIX}docker exec syncd saisdkdump -f $sai_dump_filename -p $sdk_techsupport_saisdkdump_profile

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only saisdkdump's rc feeds the existing if [ $? != 0 ] below. if the profile-prep sh -c on line 2186 fails, saisdkdump still runs with a partial/empty profile and the failure is invisible. a || { echo ...; } on the prep step would surface it. wdyt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed it to run without the profile file in such a case, with an error message.

lolyu pushed a commit to sonic-net/sonic-sairedis that referenced this pull request Aug 2, 2026
… feature. (#1994)

Why I did it
SDK techsupport CT dumps on NVIDIA BlueField SmartSwitch DPUs use a sentinel file to signal that the feature is enabled. The file must not persist across syncd container restarts; its lifetime should match the SDN application.

This PR is required for the parent feature PR sonic-net/sonic-utilities#4696

Work item tracking
Microsoft ADO (number only): N/A
How I did it
In config_syncd_nvidia_bluefield(), create /var/run/sonic-platform-nvidia-bluefield/ at container startup.
Remove sdk-techsupport-ct-dump.enabled on startup so a stale sentinel is not left after restart.
How to verify it
On a BlueField DPU image with the companion sonic-utilities changes:

Enable: config platform nvidia-bluefield sdk techsupport-ct-dump enabled
Confirm sentinel exists: ls /var/run/sonic-platform-nvidia-bluefield/sdk-techsupport-ct-dump.enabled
Restart syncd container; confirm sentinel is gone until re-enabled.
Run show techsupport and confirm CT dump output when enabled.
@judsonwilson-nvidia
judsonwilson-nvidia dismissed stale reviews from dgsudharsan and croos12 via 6d3c417 August 4, 2026 08:40
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Signed-off-by: Judson Wilson <judsonw@nvidia.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Signed-off-by: Judson Wilson <judsonw@nvidia.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@judsonwilson-nvidia

Copy link
Copy Markdown
Contributor Author

/azpw retry

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1183681:

✅Stage Build:

  • Job Python3: retried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants