Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vvolam committed Oct 3, 2024
1 parent c72fbc0 commit 9d04d4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/reboot
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ function get_reboot_status()
function reboot_dpu_module()
{
local DPU_NAME=$1
local DPU_INDEX=${DPU_NAME//[!0-9]/}

debug "User requested rebooting device ${DPU_NAME} ..."

Expand Down Expand Up @@ -266,7 +267,7 @@ function reboot_dpu_module()
fi

# Update STATE_DB with DPU PCIe key
sonic-db-cli state_db set "PCIE_DETACH_INFO|${DPU_NAME}" '{"dpu_id": "0", "dpu_state": "detaching", "bus_info": ${DPU_BUS_INFO}}'
sonic-db-cli state_db set "PCIE_DETACH_INFO|${DPU_NAME}" '{"dpu_id": "${DPU_INDEX}", "dpu_state": "detaching", "bus_info": ${DPU_BUS_INFO}}'

# Detach the DPU module PCIe
echo 1 > /sys/bus/pci/devices/${DPU_BUS_INFO}/remove
Expand All @@ -280,6 +281,9 @@ function reboot_dpu_module()

# Rescan the PCIe
echo 1 > /sys/bus/pci/rescan

# Update STATE_DB to delete DPU PCIe key
sonic-db-cli state_db del "PCIE_DETACH_INFO|${DPU_NAME}"
}

function parse_options()
Expand Down

0 comments on commit 9d04d4d

Please sign in to comment.