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

[nvidia] update config_syncd_nvidia_bluefield() #1380

Merged
merged 3 commits into from
May 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions syncd/scripts/syncd_init_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,15 @@ config_syncd_nvidia_bluefield()
# Read MAC addresses
base_mac="$(echo $SYNCD_VARS | jq -r '.mac')"
hwsku=$(sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["hwsku"]')
single_port=$([[ $hwsku == *"-com-dpu" ]] && echo true || echo false)

eth0_mac=$(cat /sys/class/net/Ethernet0/address)
eth4_mac=$(cat /sys/class/net/Ethernet4/address)

cp $HWSKU_DIR/sai.profile /tmp/sai.profile

# Update sai.profile with MAC_ADDRESS
echo "DEVICE_MAC_ADDRESS=$base_mac" >> /tmp/sai.profile
echo "PORT_1_MAC_ADDRESS=$eth0_mac" >> /tmp/sai.profile
echo "PORT_2_MAC_ADDRESS=$eth4_mac" >> /tmp/sai.profile

CMD_ARGS+=" -l -p /tmp/sai.profile -w 180000000"

Expand All @@ -372,17 +372,24 @@ config_syncd_nvidia_bluefield()
mount -t hugetlbfs pagesize=1GB /mnt/huge

devlink dev eswitch set pci/0000:03:00.0 mode legacy
devlink dev eswitch set pci/0000:03:00.1 mode legacy
devlink dev eswitch set pci/0000:03:00.0 mode switchdev
devlink dev eswitch set pci/0000:03:00.1 mode switchdev

if [[ $hwsku != *"-C1" ]]; then
if [[ $hwsku != *"-C1" ]] && [[ $single_port == false ]]; then
devlink dev param set pci/0000:03:00.0 name esw_multiport value 1 cmode runtime
devlink dev param set pci/0000:03:00.1 name esw_multiport value 1 cmode runtime
fi

ethtool -A Ethernet0 rx off tx off
ethtool -A Ethernet4 rx off tx off

if [[ $single_port == false ]]; then
eth4_mac=$(cat /sys/class/net/Ethernet4/address)
echo "PORT_2_MAC_ADDRESS=$eth4_mac" >> /tmp/sai.profile

devlink dev eswitch set pci/0000:03:00.1 mode legacy
devlink dev eswitch set pci/0000:03:00.1 mode switchdev

ethtool -A Ethernet4 rx off tx off
fi
}

config_syncd_xsight()
Expand Down
Loading