On 10/12/2015 9:39 AM, Yuanhan Liu wrote: > On Thu, Oct 08, 2015 at 10:51:02PM +0200, Steffen Bauch wrote: >> >> On 10/08/2015 05:32 PM, Nikita Kalyazin wrote: >>> Hi Yuanhan, >>> >>> >>> As I understand, the dead loop happened here (virtio_send_command): >>> while (vq->vq_used_cons_idx == vq->vq_ring.used->idx) {
Nikita: Didn't review the whole patch, but happen to find a serious problem in the code snippet here, as volatile isn't used, compiler will assume the memory will not be changed outside and do only one comparison. Try add volatile prefix, and it might fix your problem. >>> rte_rmb(); >>> usleep(100); >>> } >>> >>> Could you explain why wrong config reading caused that and how correct >>> reading helps to avoid? > Wrong config reading results to wrong config->max_virtqueue_pairs, which > ends up with wrong ctrl vq index being set: > > PMD: virtio_send_command(): vq->vq_queue_index = 37120 > > Note that you need enable CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_INIT to see above > debug log. > > That is to say we are waiting for the backend to consume a non-exist > queue, and that's how the dead loop comes. > > >> Hi, >> >> I just recognized that this dead loop is the same one that I have >> experienced (see >> http://dpdk.org/ml/archives/dev/2015-October/024737.html for >> reference). Just applying the changes in this patch (only 07/12) >> will not fix the dead loop at least in my setup. > Try to enable CONFIG_RTE_LIBRTE_VIRTIO_DEBUG_INIT, and dump more log? > > --yliu >