[Mellanox] Add config sdk nvidia-bluefield sdk techsupport-ct-dump <enabled|disabled> command. - #4696
Conversation
…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>
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
config sdk nvidia-bluefield sdk techsupport-ct-dump <enabled|disabled> command.config sdk nvidia-bluefield sdk techsupport-ct-dump <enabled|disabled> command.
| echo CT_TABLE_DUMP_ENABLE=true >> "$profile" | ||
| ' | ||
|
|
||
| if docker exec syncd test -f $sdk_techsupport_ct_dump_sentinel; then |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Regarding the second one: added an error message in the failure case.
| 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Good catch. Fixed it to run without the profile file in such a case, with an error message.
… 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.
6d3c417
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Judson Wilson <judsonw@nvidia.com>
6d3c417 to
6da22ea
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Judson Wilson <judsonw@nvidia.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azpw retry |
|
Retrying failed(or canceled) jobs... |
|
Retrying failed(or canceled) stages in build 1183681: ✅Stage Build:
|
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_dumpshould passCT_TABLE_DUMP_ENABLE=truetosaisdkdumpduring techsupport collection.Work item tracking
How I did it
config platform nvidia-bluefield sdk techsupport-ct-dump {enabled|disabled}to create/remove sentinel filesdk-techsupport-ct-dump.enabledin syncd.collect_nvidia_bluefield()ingenerate_dumpto check the sentinel and runsaisdkdump -pwithCT_TABLE_DUMP_ENABLE=truewhen enabled.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 disabledWhich release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Add config platform nvidia-bluefield sdk techsupport-ct-dump command.