Skip to content

Conversation

gpunathilell
Copy link
Contributor

The smartswitch CHASSIS_STATE_DB is hosted on the redis-chassis IP address, which needs to still accept traffic on addition of control plane ACLs (DBs should be accessible at any point of time) this ip is also needed for DPU access as well. So we have a check for smartswitch to allow traffic to the bridge-midplane IP address

##Tests
Manual tests to confirm that addition of control plane ACLs does not render the CHASSIS_STATE_DB inaccesible

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

scripts/caclmgrd Outdated

if device_info.is_smartswitch():
# Allow traffic to the chassis midplane IP
allow_internal_chassis_midplane_traffic.append(['iptables', '-A', 'INPUT', '-d', '169.254.200.254','-j', 'ACCEPT'])
Copy link
Contributor

Choose a reason for hiding this comment

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

169.254.200.254

Can we get the IP from ConfigDB.
The path is "MID_PLANE_BRIDGE"/"GLOBAL"/"ip_prefix"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a hard-coded IP Address which will never change (since it should belong in the same network as the DPU midplane ip, these are hardcoded as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@qiluo-msft please confirm, if this is okay as the IP is hard-coded, otherwise I can parse from CONFIG_DB

Copy link
Contributor

Choose a reason for hiding this comment

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

If it is already in CONFIG_DB, then get from there.

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

scripts/caclmgrd Outdated
if "ip_prefix" in global_config:
self.log_info("Retrieved midplane bridge IP prefix from ConfigDB: {}".format(global_config["ip_prefix"]))
return global_config["ip_prefix"].split("/")[0]
except Exception as e:
Copy link
Contributor

@qiluo-msft qiluo-msft Oct 2, 2025

Choose a reason for hiding this comment

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

Exception

Could you use more specific exception type? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

specified exception as runtimeerror, if there are any connectivity issues and raised exception

return global_config["ip_prefix"].split("/")[0]
except Exception as e:
self.log_error("Failed to get midplane bridge IP from ConfigDB: {}".format(str(e)))
return "169.254.200.254"
Copy link
Contributor

@qiluo-msft qiluo-msft Oct 2, 2025

Choose a reason for hiding this comment

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

return

Is it better to raise Exception or return empty string if unexpected happens? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

raised the exception, the return cannot be empty string since in 202505 (where this PR is required) the MID_PLANE_BRIDGE table is not configured by default, but the interface has this IP address:
https://github.com/sonic-net/sonic-buildimage/blob/414e4740a6ef3dcbc2b2b5ae72d00ef91c941d5a/files/image_config/midplane-network/bridge-midplane.network#L7
The ip address is where the CHASSIS DBs are hosted which are accessible from the DPU

@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft requested a review from ZhaohuiS October 6, 2025 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants