[dpdk-dev] [PATCH 4/7] vhost: translate iovas at vectors fill time

Maxime Coquelin maxime.coquelin at redhat.com
Thu Jun 21 16:45:39 CEST 2018



On 06/08/2018 12:39 PM, Maxime Coquelin wrote:
> @@ -584,7 +578,8 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id,
>   			vq->last_avail_idx + num_buffers);
>   
>   		if (copy_mbuf_to_desc(dev, vq, pkts[pkt_idx],
> -						buf_vec, num_buffers) < 0) {
> +						buf_vec, num_buffers,
> +						nr_vec) < 0) {

FYI,there is a bug here. num_buffers and nr_vec must be swapped:

static __rte_always_inline int
copy_mbuf_to_desc(struct virtio_net *dev, struct vhost_virtqueue *vq,
			    struct rte_mbuf *m, struct buf_vector *buf_vec,
			    uint16_t num_buffers)

It can be reproduce with Kernel driver with mrg OFF and with offloads
ON.

Maxime
>   			vq->shadow_used_idx -= num_buffers;



More information about the dev mailing list