[dpdk-dev] [PATCH 4/6] vhost: workaround stale vring base

Yuanhan Liu yuanhan.liu at linux.intel.com
Mon May 9 20:23:55 CEST 2016


On Mon, May 09, 2016 at 01:39:25PM +0000, Xie, Huawei wrote:
> On 5/9/2016 6:45 PM, Victor Kaplansky wrote:
> >> diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c
> >> > index c88aaa3..df103aa 100644
> >> > --- a/lib/librte_vhost/virtio-net.c
> >> > +++ b/lib/librte_vhost/virtio-net.c
> >> > @@ -560,6 +560,14 @@ vhost_set_vring_addr(int vid, struct vhost_vring_addr
> >> > *addr)
> >> >  		return -1;
> >> >  	}
> >> >  
> >> > +	if (vq->last_used_idx != vq->used->idx) {
> >> > +		RTE_LOG(WARNING, VHOST_CONFIG,
> >> > +			"last_used_idx (%u) and vq->used->idx (%u) mismatch\n",
> > I agree with this approach. I just would add to the log message that last_user_idx
> > have overrode by used_idx and some packets may be dropped.

Good suggestion. Will do in v2.


> For TX, the packets are resent.
> For RX, the packets are dropped.

Yes.

Thanks.

	--yliu


More information about the dev mailing list