File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,7 @@ function get_reboot_status()
197197function 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
285289function parse_options()
You can’t perform that action at this time.
0 commit comments