On Jan 9 11:35, Beata Michalska wrote: > Hi Klaus, > Hi Beata,
Your reviews are, as always, much appreciated! Thanks! > On Thu, 19 Dec 2019 at 13:09, Klaus Jensen <k.jen...@samsung.com> wrote: > > @@ -1595,7 +1611,12 @@ static void nvme_process_sq(void *opaque) > > > > while (!(nvme_sq_empty(sq) || QTAILQ_EMPTY(&sq->req_list))) { > > addr = sq->dma_addr + sq->head * n->sqe_size; > > - nvme_addr_read(n, addr, (void *)&cmd, sizeof(cmd)); > > + if (nvme_addr_read(n, addr, (void *)&cmd, sizeof(cmd))) { > > + trace_nvme_dev_err_addr_read(addr); > > + timer_mod(sq->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + > > + 100 * SCALE_MS); > > + break; > > + } > > Is there a chance we will end up repeatedly triggering the read error here > as this will come back to the same memory location each time (the sq->head > is not moving here) ? > Absolutely, and that was the point. Not being able to read the submission queue is pretty bad, so the device just keeps retrying every 100 ms. This is the same for when writing to the completion queue fails. But... It would probably be prudent to track how long it has been since a successful DMA transfer was done and timeout, shutting down the device. Say maybe after 60 seconds. I'll try to add something like that. Thanks, Klaus