From: Stephen Hemminger Date: Fri, 4 Dec 2015 01:12:53 +0000 (-0800) Subject: virtio: fix Rx mbuf initialization X-Git-Tag: spdx-start~7874 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c21835fab8efc40dc180a4add29c5adf14bdfebf;p=dpdk.git virtio: fix Rx mbuf initialization The virtio driver was not initializing all the fields in the receive mbuf. This would cause bugs where previous usage of mbuf would leave stale TCI and offload flags. Signed-off-by: Stephen Hemminger Acked-by: Yuanhan Liu --- diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 5770fa2957..466fee693f 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -611,6 +611,8 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rxm->port = rxvq->port_id; rxm->data_off = RTE_PKTMBUF_HEADROOM; + rxm->ol_flags = 0; + rxm->vlan_tci = 0; rxm->nb_segs = 1; rxm->next = NULL; @@ -731,6 +733,8 @@ virtio_recv_mergeable_pkts(void *rx_queue, rxm->data_off = RTE_PKTMBUF_HEADROOM; rxm->nb_segs = seg_num; rxm->next = NULL; + rxm->ol_flags = 0; + rxm->vlan_tci = 0; rxm->pkt_len = (uint32_t)(len[0] - hdr_size); rxm->data_len = (uint16_t)(len[0] - hdr_size);