> snet_send_ctrl_msg() reads the error code the DPU reports when it ACKs
> a control message, but then overwrites it with the return value of
> snet_wait_for_dpu_completion(). As a result, a DESTROY, SUSPEND or
> RESUME that the DPU rejects is reported to the caller as a success as
> long as the DPU clears the opcode register in time.
>
> For SUSPEND this means vhost-vdpa marks the device as suspended and
> lets userspace reprogram the vrings while the DPU is still running
> them; for DESTROY, snet_reset_dev() never even sees that the device
> failed to stop.
>
> Return the error from the saved ACK value once the completion wait
> itself has succeeded.
>
> Fixes: 3f3a1675b731 ("vdpa/snet: support getting and setting VQ state")
> Cc: [email protected]
> Signed-off-by: Yuho Choi <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review ยท
https://sashiko.dev/#/patchset/[email protected]?part=1