Skip to content
Merged
4 changes: 2 additions & 2 deletions dockers/docker-orchagent/orch_zmq_tables.conf.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% if DEVICE_METADATA.localhost.orch_dash_zmq_enabled == "false" %}
{% if DEVICE_METADATA.localhost.orch_northbond_dash_zmq_enabled != "false" %}
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this be checked against "true"? If the config is disabled, we don't want all these tables in orch_zmq_tables.conf.

Please check all 4 combinations of dash_zmq_disabled/route_zmq_disabled, dash_zmq_enabled/route_zmq_disabled, dash_zmq_disabled/route_zmq_enabled, dash_zmq_enabled/route_zmq_enabled to make sure orch_zmq_tables.conf looks correct in all cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verified all combinations with deploy mini graph, this file can be rendered correctly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. This looks good to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

btw @liuh-80 it looks like there are some new tables that are not in this list. @zjswhhh and @theasianpianist could you pls double check if all recent tables added by you are here? It looks like some are missing to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zjswhhh , @theasianpianist , if your new tables want to have swssconfig and swsssplayer command support when ZMQ enabled, please also update those tables to orch_zmq_tables.conf.j2

DASH_VNET_TABLE
DASH_QOS_TABLE
DASH_ENI_TABLE
Expand All @@ -23,7 +23,7 @@ DASH_METER_RULE_TABLE
DASH_ROUTING_APPLIANCE_TABLE
DASH_ENI_FORWARD_TABLE
{% endif %}
{% if DEVICE_METADATA.localhost.orch_route_zmq_enabled == "true" %}
{% if DEVICE_METADATA.localhost.orch_northbond_route_zmq_enabled == "true" %}
ROUTE_TABLE
LABEL_ROUTE_TABLE
{% endif %}
11 changes: 7 additions & 4 deletions dockers/docker-orchagent/orchagent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,20 +93,23 @@ else
ORCHAGENT_ARGS+="-m $MAC_ADDRESS"
fi

# Enable ZMQ for SmartSwitch
# Enable ZMQ
LOCALHOST_SUBTYPE=`sonic-db-cli CONFIG_DB hget "DEVICE_METADATA|localhost" "subtype"`
if [[ x"${LOCALHOST_SUBTYPE}" == x"SmartSwitch" ]]; then
midplane_mgmt_state=$( ip -json -4 addr show eth0-midplane | jq -r ".[0].operstate" )
mgmt_ip=$( ip -json -4 addr show eth0 | jq -r ".[0].addr_info[0].local" )
if [[ $midplane_mgmt_state == "UP" ]]; then
# Enable ZMQ with eth0-midplane interface name
ORCHAGENT_ARGS+=" -q tcp://eth0-midplane:8100"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand why ORCH_ZMQ_PORT is being removed. Could you clarify please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change in sonic-net/sonic-swss#3619 modifies how orchagent handles ZMQ addresses for support multiple namespaces:

If the address includes a port, then create ZMQ client with the address.

If not, the ZMQ client will be created using the default ZMQ port along with the namespace ID. For the default namespace, the port will still be set to 8100.

code: https://github.com/sonic-net/sonic-swss/blob/27391fcf1785d6e5d9a765219f5c0f2dfcfe751c/lib/orch_zmq_config.cpp#L56

I couldn’t find the code for the 202506 branch. However, if PR #3619 and PR #3632 are not included in that branch, this change should not be cherry-picked into 202506.

Copy link
Contributor

@prabhataravind prabhataravind Jul 15, 2025

Choose a reason for hiding this comment

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

Okay, that makes sense. The 202506 branch is here: https://github.com/Azure/sonic-buildimage-msft/tree/202506. We will have the labels for this branch soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to the code of 202506branch, this PR should cherry-pick to it.

ORCHAGENT_ARGS+=" -q tcp://eth0-midplane"
elif [[ $mgmt_ip != "" ]] && [[ $mgmt_ip != "null" ]]; then
# If eth0-midplane interface does not up, enable ZMQ with eth0 address
ORCHAGENT_ARGS+=" -q tcp://${mgmt_ip}:8100"
ORCHAGENT_ARGS+=" -q tcp://${mgmt_ip}"
else
ORCHAGENT_ARGS+=" -q tcp://127.0.0.1:8100"
ORCHAGENT_ARGS+=" -q tcp://127.0.0.1"
fi
else
# For other platforms, use the default ZMQ address
ORCHAGENT_ARGS+=" -q tcp://127.0.0.1"
fi

# Add VRF parameter when mgmt-vrf enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"orch_dash_zmq_enabled": true
"orch_northbond_dash_zmq_enabled": true
}
}
}
Expand All @@ -683,7 +683,7 @@
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"orch_route_zmq_enabled": true
"orch_northbond_route_zmq_enabled": true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,13 @@ module sonic-device_metadata {
description "Set source of anchor route";
}

leaf orch_dash_zmq_enabled {
leaf orch_northbond_dash_zmq_enabled {
type boolean;
description "Enable ZMQ feature on APPL_DB DASH tables.";
default "true";
}

leaf orch_route_zmq_enabled {
leaf orch_northbond_route_zmq_enabled {
type boolean;
description "Enable ZMQ feature on APPL_DB ROUTE tables.";
default "false";
Expand Down
Loading