Skip to content

Commit c502957

Browse files
committed
Minor changes
1 parent 11a1d1a commit c502957

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/reboot

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ function get_reboot_status()
197197
function reboot_dpu_module()
198198
{
199199
local DPU_NAME=$1
200+
local DPU_INDEX=${DPU_NAME//[!0-9]/}
200201

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

@@ -266,7 +267,7 @@ function reboot_dpu_module()
266267
fi
267268

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

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

281282
# Rescan the PCIe
282283
echo 1 > /sys/bus/pci/rescan
284+
285+
# Update STATE_DB to delete DPU PCIe key
286+
sonic-db-cli state_db del "PCIE_DETACH_INFO|${DPU_NAME}"
283287
}
284288

285289
function parse_options()

0 commit comments

Comments
 (0)