Skip to content

[SmartSwitch] Restore DPU gNMI midplane connectivity#28564

Open
hdwhdw wants to merge 4 commits into
sonic-net:masterfrom
hdwhdw:fix/28540-dpu-gnmi-midplane
Open

[SmartSwitch] Restore DPU gNMI midplane connectivity#28564
hdwhdw wants to merge 4 commits into
sonic-net:masterfrom
hdwhdw:fix/28540-dpu-gnmi-midplane

Conversation

@hdwhdw

@hdwhdw hdwhdw commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Why I did it

SmartSwitch DPUs normally run gNMI/gNOI without certificate configuration so
the NPU can proxy plaintext RPCs over the chassis-internal midplane. After
sonic-gnmi#712 and sonic-buildimage#28110, both DPU services bind only to
127.0.0.1, so the NPU gets connection refused at the DPU's IPv4 link-local
address.

Fixes #28540.

Work item tracking
  • Microsoft ADO (number only):

How I did it

  • Detect SmartSwitch DPUs using either DEVICE_METADATA.type=SmartSwitchDPU
    or switch_type=dpu in the existing single sonic-cfggen template render.
  • For a DPU without certificates, pass only
    --noTLS --no_tls_link_local_interface eth0-midplane.
  • Let the telemetry binary resolve, validate, and bind the concrete IPv4
    link-local address, including bounded address-readiness handling.
  • Keep all other no-certificate devices bound to loopback.
  • Avoid direct sonic-db-cli calls, ip/awk parsing, and polling in both
    launch scripts.
  • Pin sonic-gnmi PR telemetry: resolve no-TLS link-local bind by interface sonic-gnmi#721.

How to verify it

Native arm64 SONiC build succeeded for the gNMI package and both affected
containers.

Physical SmartSwitch validation:

  • Baseline post-regression images listened only on loopback; NPU connections to
    both DPU ports were refused and direct gNOI System.Time failed.
  • Fixed images listened only on the concrete DPU IPv4 link-local address at
    ports 50052 and 8080.
  • NPU TCP probes passed for both ports.
  • Direct plaintext gNOI System.Time passed on 50052.
  • The real NPU UDS call with x-sonic-ss-target-type=dpu and index metadata
    passed through DPUProxy.
  • Negative probes confirmed neither service listened on the DPU management
    address or loopback.
  • The DPU was restored to its original images after testing; all DPUs remained
    reachable and the baseline direct RPC passed.

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

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • 202608

Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): #28540
Failure type: regression

Tested branch

  • master
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202512
  • 202605
  • 202608
  • N/A

Test result

  • master: native arm64 build passed; physical SmartSwitch direct and proxied
    gNOI validation passed.

Description for the changelog

Restore SmartSwitch NPU-to-DPU gNMI/gNOI connectivity over the link-local midplane.

Link to config_db schema for YANG module changes

N/A

hdwhdw added 2 commits July 21, 2026 22:40
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
@hdwhdw
hdwhdw requested a review from lguohan as a code owner July 22, 2026 04:19
Copilot AI review requested due to automatic review settings July 22, 2026 04:19
@azure-pipelines

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

Copilot AI left a comment

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.

Pull request overview

Restores SmartSwitch NPU→DPU gNMI/gNOI (and legacy telemetry) reachability over the chassis midplane by binding the DPU services to the DPU’s midplane IPv4 address when running without certificates, while keeping non-DPU/no-cert devices bound to loopback.

Changes:

  • Detect SmartSwitch DPU role via DEVICE_METADATA.type=SmartSwitchDPU or switch_type=dpu when no cert config is present.
  • Poll up to 30 seconds for eth0-midplane IPv4 and bind gNMI/telemetry to that address with explicit no-TLS link-local opt-in.
  • Fail closed (exit) when a SmartSwitch DPU has no midplane IPv4 address.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
dockers/docker-sonic-telemetry/telemetry.sh On no-cert SmartSwitch DPUs, bind legacy telemetry to midplane IPv4 instead of loopback; fail closed if missing.
dockers/docker-sonic-gnmi/gnmi-native.sh On no-cert SmartSwitch DPUs, bind gNMI/gNOI to midplane IPv4 instead of loopback; fail closed if missing.

SWITCH_TYPE=$(sonic-db-cli CONFIG_DB hget "DEVICE_METADATA|localhost" "switch_type")
if [[ x"${DEVICE_TYPE}" == x"SmartSwitchDPU" || x"${SWITCH_TYPE}" == x"dpu" ]]; then
for _ in {1..30}; do
MIDPLANE_ADDRESS=$(ip -4 -o addr show dev eth0-midplane 2>/dev/null | awk '{sub(/\/.*/, "", $4); print $4; exit}')
SWITCH_TYPE=$(sonic-db-cli CONFIG_DB hget "DEVICE_METADATA|localhost" "switch_type")
if [[ x"${DEVICE_TYPE}" == x"SmartSwitchDPU" || x"${SWITCH_TYPE}" == x"dpu" ]]; then
for _ in {1..30}; do
MIDPLANE_ADDRESS=$(ip -4 -o addr show dev eth0-midplane 2>/dev/null | awk '{sub(/\/.*/, "", $4); print $4; exit}')
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Copilot AI review requested due to automatic review settings July 22, 2026 14:55
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

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

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

"certs": {% if TELEMETRY is defined and "certs" in TELEMETRY %}{{ TELEMETRY["certs"] }}{% else %}""{% endif %},
"gnmi" : {% if TELEMETRY is defined and "gnmi" in TELEMETRY %}{{ TELEMETRY["gnmi"] }}{% else %}""{% endif %},
"x509" : {% if "x509" in DEVICE_METADATA.keys() %}{{ DEVICE_METADATA["x509"] }}{% else %}""{% endif %},
"is_smart_switch_dpu": {{ (DEVICE_METADATA["localhost"].get("type") == "SmartSwitchDPU" or DEVICE_METADATA["localhost"].get("switch_type") == "dpu") | lower }}
"certs": {% if GNMI is defined and "certs" in GNMI %}{{ GNMI["certs"] }}{% else %}""{% endif %},
"gnmi" : {% if GNMI is defined and "gnmi" in GNMI %}{{ GNMI["gnmi"] }}{% else %}""{% endif %},
"x509" : {% if "x509" in DEVICE_METADATA.keys() %}{{ DEVICE_METADATA["x509"] }}{% else %}""{% endif %},
"is_smart_switch_dpu": {{ (DEVICE_METADATA["localhost"].get("type") == "SmartSwitchDPU" or DEVICE_METADATA["localhost"].get("switch_type") == "dpu") | lower }}
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Copilot AI review requested due to automatic review settings July 22, 2026 16:24
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

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

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@hdwhdw

hdwhdw commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

/azpw ms_conflict

1 similar comment
@hdwhdw

hdwhdw commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

/azpw ms_conflict

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.

Bug: [SmartSwitch] DPU gNMI/gNOI service binds to loopback only after sonic-gnmi#712, breaking NPU proxy connectivity

3 participants