[v3,3/4] net/virtio: fix segment data len in mergeable packed Rx path

Message ID 20190605100039.18029-4-maxime.coquelin@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series et/virtio: Fix packet segmentation bug |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Maxime Coquelin June 5, 2019, 10 a.m. UTC
  Head segment data_len field is wrongly summed with the length
of all the segments of the chain, whereas it should be the
length of of the first segment only.

Fixes: a76290c8f1cf ("net/virtio: implement Rx path for packed queues")
Cc: stable@dpdk.org

Reported-by: Yaroslav Brustinov <ybrustin@cisco.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_rxtx.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Jens Freimann June 5, 2019, 11:16 a.m. UTC | #1
On Wed, Jun 05, 2019 at 12:00:38PM +0200, Maxime Coquelin wrote:
>Head segment data_len field is wrongly summed with the length
>of all the segments of the chain, whereas it should be the
>length of of the first segment only.

s/of of/of/

Reviewed-by: Jens Freimann <jfreimann@redhat.com> 

regards,
Jens
  
Maxime Coquelin June 5, 2019, 11:34 a.m. UTC | #2
On 6/5/19 1:16 PM, Jens Freimann wrote:
> On Wed, Jun 05, 2019 at 12:00:38PM +0200, Maxime Coquelin wrote:
>> Head segment data_len field is wrongly summed with the length
>> of all the segments of the chain, whereas it should be the
>> length of of the first segment only.
> 
> s/of of/of/

Thanks, will fix while applying

> Reviewed-by: Jens Freimann <jfreimann@redhat.com>
> regards,
> Jens
  

Patch

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index acee4fcc07..358cc86627 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -1875,7 +1875,6 @@  virtio_recv_mergeable_pkts_packed(void *rx_queue,
 			rxm->data_len = (uint16_t)(len[i]);
 
 			rx_pkts[nb_rx]->pkt_len += (uint32_t)(len[i]);
-			rx_pkts[nb_rx]->data_len += (uint16_t)(len[i]);
 
 			if (prev)
 				prev->next = rxm;
@@ -1912,7 +1911,6 @@  virtio_recv_mergeable_pkts_packed(void *rx_queue,
 				prev->next = rxm;
 				prev = rxm;
 				rx_pkts[nb_rx]->pkt_len += len[extra_idx];
-				rx_pkts[nb_rx]->data_len += len[extra_idx];
 				extra_idx += 1;
 			}
 			seg_res -= rcv_cnt;