diff mbox series

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

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

Checks

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

Commit Message

Maxime Coquelin June 5, 2019, 8: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>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_rxtx.c | 1 -
 1 file changed, 1 deletion(-)

Comments

David Marchand June 5, 2019, 9:34 a.m. UTC | #1
On Wed, Jun 5, 2019 at 10:11 AM Maxime Coquelin <maxime.coquelin@redhat.com>
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.
>
> Fixes: a76290c8f1cf ("net/virtio: implement Rx path for packed queues")
> Cc: stable@dpdk.org
>
> Reported-by: Yaroslav Brustinov <ybrustin@cisco.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  drivers/net/virtio/virtio_rxtx.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/virtio/virtio_rxtx.c
> b/drivers/net/virtio/virtio_rxtx.c
> index 9469ecb743..33dbc78906 100644
> --- a/drivers/net/virtio/virtio_rxtx.c
> +++ b/drivers/net/virtio/virtio_rxtx.c
> @@ -1914,7 +1914,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;
> --
> 2.21.0
>

And another one, line 1880 :-)
Reviewed-by: David Marchand <david.marchand@redhat.com>
diff mbox series

Patch

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 9469ecb743..33dbc78906 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -1914,7 +1914,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;