net/virtio: fix segment length in mergeable packed Rx
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Wed, 5 Jun 2019 10:00:38 +0000 (12:00 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 13 Jun 2019 14:54:29 +0000 (23:54 +0900)
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 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>
Reviewed-by: Jens Freimann <jfreimann@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

index e23cd04..8dccd69 100644 (file)
@@ -1870,7 +1870,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;
@@ -1907,7 +1906,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;