Skip to content

Conversation

@manish1-arista
Copy link

This feature has been tracked at: sonic-net/SONiC#2020

Why I did it

On a linecard, the default namespace database container is only bound to localhost (127.0.0.1).
This prevents other components in the chassis, such as the supervisor card,
from accessing the linecard's default namespace database over the midplane network to aggregate the VOQ counters for Single ASIC Linecards.

Work item tracking
  • Microsoft ADO (number only):

How I did it

Set the protected-mode no and bind the linecard's eth1-midplane IP address to the default namespace database container, allowing for remote access from the supervisor to collect the VOQ counters.

How to verify it

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

  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Tested branch (Please provide the tested image version)

Master

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vivekverma-arista
Copy link
Contributor

vivekverma-arista commented Aug 28, 2025

@qiluo-msft @arlakshm @judyjoseph please review. This is a continuation of: #20803 for single ASIC linecards

cc @kenneth-arista @pandurangan-arista @vmittal-msft

@abdosi
Copy link
Contributor

abdosi commented Sep 17, 2025

can we update PR subject as this is more of infrastructure change

@vmittal-msft
Copy link
Contributor

@manish1-arista Did we make sure it is not impacting exiting T2 VoQ stats aggregation? Also, please update subject as per Abhishek comment.

@manish1-arista manish1-arista changed the title Add Aggregate VOQ counters support for single ASIC linecards Bind default namespace database container to midplane ip Sep 24, 2025
@manish1-arista
Copy link
Author

can we update PR subject as this is more of infrastructure change

Updated

@manish1-arista
Copy link
Author

@manish1-arista Did we make sure it is not impacting exiting T2 VoQ stats aggregation? Also, please update subject as per Abhishek comment.

Yes, we have verified this. The changes do not cause any regressions to the existing T2 VoQ stats aggregation.

{%- if docker_container_name == "database" %}
midplane_ip=""
CHASSISDB_CONF="/usr/share/sonic/device/$PLATFORM/chassisdb.conf"
if [[ -f $CHASSISDB_CONF ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

add check for $DATABASE_TYPE != "dpudb"

Copy link
Author

Choose a reason for hiding this comment

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

Added

if [[ $DEV && $midplane_ip ]]; then
# Binding the midplane ip to the redisdb
if [[ -n "$midplane_ip" ]]; then
IFS=_ read ip port < <(jq -r '.INSTANCES | [.redis.hostname, .redis.port] | join("_")' /var/run/redis$DEV/sonic-db/database_config.json)
Copy link
Contributor

Choose a reason for hiding this comment

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

here we are looking at "/var/run/redis$DEV/sonic-db/database_config.json", $DEV for host is empty? Can you confirm

Copy link
Author

Choose a reason for hiding this comment

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

Yes

@judyjoseph
Copy link
Contributor

@manish1-arista, please add to PR description(How did you verify) before and after test results of this change in communication between LC host database <--> chassis db in sup

@judyjoseph
Copy link
Contributor

/azp run

@judyjoseph
Copy link
Contributor

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

On a linecard, the database container is bound to localhost (127.0.0.1)
by default. This prevents other components in the chassis, such as the
supervisor card, from accessing the linecard's database over the midplane network.
This change exposes the database instance to the midplane, allowing for remote
access from the supervisor.

Signed-off-by: manish <[email protected]>
@manish1-arista manish1-arista force-pushed the bind_linecard_db_to_midplane_ip branch from fcde75e to d23b8db Compare October 29, 2025 06:39
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

6 participants