Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SmartSwitch] DPU Management Traffic Forwarding script #19431

Merged
merged 6 commits into from
Aug 5, 2024

Conversation

gpunathilell
Copy link
Contributor

Why I did it

This script is added in order to enable or disable the management traffic generated from DPUs to be forwarded through the smartswitch. When we enable the traffic the following actions are taken:

  • ip_table forwarding rule is added to forward traffic from DPU (connected to the bridge-midplane interface) to the management port on the switch - eth0
  • ip_table forwarding rule is added to forward traffic from management port on the switch - eth0 to the DPU (connected to the bridge-midplane interface) for established or related connections
  • ip_table masquerading rule so that SNAT is performed for traffic from the DPU
    The opposite actions are taken when we disable the traffic
Work item tracking
  • Microsoft ADO (number only):

How I did it

Wrote script dpu-mgmt-traffic.sh which will be present in the switch image, this script can be used to enable/disable the DPU management traffic forwarding

How to verify it

The following commands can be executed on the smart switch:
dpu-mgmt-traffic.sh --enable
dpu-mgmt-traffic.sh --disable
dpu-mgmt-traffic.sh -d
dpu-mgmt-traffic.sh -e

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

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

fi
}

mgmt_iface=eth0
Copy link
Contributor

Choose a reason for hiding this comment

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

Is mgmt_iface eth0 common for all vendor SKUs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes in SONiC all vendors use eth0 as the management interface

files/scripts/sonic-dpu-mgmt-traffic.sh Show resolved Hide resolved

command_name=$0

usage(){
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is the trigger to execute this script with enable/disable option? Is this part of pmon?

Copy link
Contributor Author

@gpunathilell gpunathilell Aug 5, 2024

Choose a reason for hiding this comment

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

There is no trigger for this script, this is just a utility script which would be helpful for enabling DPU traffic to reach the internet in cases where connectivity is required, Example Usage:
SONiC to SONiC upgrade on the dpu can be performed easily if we enable DPU management traffic forwarding using this script, as the DPU can download the image directly, instead of first transferring the image to switch and then to DPU

@kperumalbfn kperumalbfn merged commit 427f911 into sonic-net:master Aug 5, 2024
22 checks passed
matiAlfaro pushed a commit to Marvell-switching/sonic-buildimage that referenced this pull request Aug 6, 2024
[SmartSwitch] DPU Management Traffic Forwarding script
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.

3 participants