net/virtio: fix mergeable Rx with segmented packet
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Wed, 5 Jun 2019 10:00:37 +0000 (12:00 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 13 Jun 2019 14:54:29 +0000 (23:54 +0900)
commit366599450dd4a85025360f1154f5d664b486e831
treed5a6da8b769c383c9e4a822683641636c951ee71
parent61d0bec3ba28c11dbc2c53390ef9ed9d5807a788
net/virtio: fix mergeable Rx with segmented packet

After having dequeued a burst of descriptors, there may be a
need to dequeue a few more if the last packet was segmented
and not complete. When it happens, the extra segments were
not properly attached to the mbuf chain, and so were lost.

Also, head segment data_len field is wrongly summed with
the length of all the segments of the chain.

This patch fixes both the mbuf chaining and head segment's
data_len field

Fixes: bcac5aa207f8 ("net/virtio: improve batching in mergeable path")
Cc: stable@dpdk.org
Reported-by: Yaroslav Brustinov <ybrustin@cisco.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_rxtx.c