[dpdk-dev] [RFC 4/6] net/virtio: revert the changes in 18dc1b1ac

Tiwei Bie tiwei.bie at intel.com
Tue Jul 18 17:40:19 CEST 2017


Revert the changes in 18dc1b1ac, because we want to test the
performance similar to the real world case.

Signed-off-by: Tiwei Bie <tiwei.bie at intel.com>
---
 drivers/net/virtio/virtio_rxtx.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 3983626..7be9aae 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -139,9 +139,7 @@ virtqueue_dequeue_burst_rx(struct virtqueue *vq, struct rte_mbuf **rx_pkts,
 		}
 
 		rte_prefetch0(cookie);
-#if 0
 		rte_packet_prefetch(rte_pktmbuf_mtod(cookie, void *));
-#endif
 		rx_pkts[i]  = cookie;
 		vq->vq_used_cons_idx++;
 		vq_ring_free_chain(vq, desc_idx);
@@ -512,9 +510,7 @@ static void
 virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf)
 {
 	uint32_t s = mbuf->pkt_len;
-#if 0
 	struct ether_addr *ea;
-#endif
 
 	if (s == 64) {
 		stats->size_bins[1]++;
@@ -533,7 +529,6 @@ virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf)
 			stats->size_bins[7]++;
 	}
 
-#if 0
 	ea = rte_pktmbuf_mtod(mbuf, struct ether_addr *);
 	if (is_multicast_ether_addr(ea)) {
 		if (is_broadcast_ether_addr(ea))
@@ -541,7 +536,6 @@ virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf)
 		else
 			stats->multicast++;
 	}
-#endif
 }
 
 /* Optionally fill offload information in structure */
@@ -664,6 +658,9 @@ virtio_recv_pkts_1_1(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts
 
 		dxp = &vq->vq_descx[used_idx & (vq->vq_nentries - 1)];
 
+		rte_packet_prefetch(rte_pktmbuf_mtod(
+				(struct rte_mbuf *)dxp->cookie, void *));
+
 		len = desc->len;
 		rxm = dxp->cookie;
 		dxp->cookie = nmb;
-- 
2.7.4



More information about the dev mailing list