net/virtio: fix indirect desc length
authorMarvin Liu <yong.liu@intel.com>
Thu, 15 Oct 2020 05:46:07 +0000 (13:46 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 16 Oct 2020 17:48:19 +0000 (19:48 +0200)
commit8410c369b452439b75c27b76589b9ca84f3347ab
tree32bb3d96ebde9369a1b14d6636e8188c8edc5815
parenteb666d24085fd21f0a087dcfb2be9baa8287707d
net/virtio: fix indirect desc length

When transmitting indirect descriptors, first desc will store net_hdr
and following descs will be mapped to mbuf segments. Total desc number
will be seg_num plus one. Meaning of variable needed is the number of
used descs in packed ring. This value will always be two for indirect
desc. Now use mbuf segments number for calculating correct desc length.

Fixes: b473061b0e1d ("net/virtio: fix indirect descriptors in packed datapaths")
Cc: stable@dpdk.org
Signed-off-by: Marvin Liu <yong.liu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtqueue.h