From 005e4d50416d15368a6687076c7c934f89470f72 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 2 Nov 2018 16:28:52 -0700 Subject: vmxnet3: reduce calling vmxnet3_reg_write_inline In output.c, we buffer the descriptors and call vmxnet3_reg_write_inline once outside the loop. This change improves the performance dramatically. When refilling the ring, there is no need to inform the device unless explicitly specified by the device (ctrl.update_prod == 1) Change-Id: I7031d58bff0d249e913d14236d416c91eb6ab94a Signed-off-by: Steven --- src/plugins/vmxnet3/vmxnet3.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/plugins/vmxnet3/vmxnet3.h') diff --git a/src/plugins/vmxnet3/vmxnet3.h b/src/plugins/vmxnet3/vmxnet3.h index 87ccd407073..a3306895ec0 100644 --- a/src/plugins/vmxnet3/vmxnet3.h +++ b/src/plugins/vmxnet3/vmxnet3.h @@ -590,6 +590,7 @@ vmxnet3_rxq_refill_ring0 (vlib_main_t * vm, vmxnet3_device_t * vd, vmxnet3_rx_desc *rxd; u16 n_refill, n_alloc; vmxnet3_rx_ring *ring; + vmxnet3_queues *q; ring = &rxq->rx_ring[0]; n_refill = rxq->size - ring->fill; @@ -620,7 +621,9 @@ vmxnet3_rxq_refill_ring0 (vlib_main_t * vm, vmxnet3_device_t * vd, n_alloc--; } - vmxnet3_reg_write_inline (vd, 0, VMXNET3_REG_RXPROD, ring->produce); + q = &vd->dma->queues; + if (PREDICT_FALSE (q->rx.ctrl.update_prod)) + vmxnet3_reg_write_inline (vd, 0, VMXNET3_REG_RXPROD, ring->produce); return 0; } @@ -632,6 +635,7 @@ vmxnet3_rxq_refill_ring1 (vlib_main_t * vm, vmxnet3_device_t * vd, vmxnet3_rx_desc *rxd; u16 n_refill, n_alloc; vmxnet3_rx_ring *ring; + vmxnet3_queues *q; ring = &rxq->rx_ring[1]; n_refill = rxq->size - ring->fill; @@ -662,7 +666,9 @@ vmxnet3_rxq_refill_ring1 (vlib_main_t * vm, vmxnet3_device_t * vd, n_alloc--; } - vmxnet3_reg_write_inline (vd, 0, VMXNET3_REG_RXPROD2, ring->produce); + q = &vd->dma->queues; + if (PREDICT_FALSE (q->rx.ctrl.update_prod)) + vmxnet3_reg_write_inline (vd, 0, VMXNET3_REG_RXPROD2, ring->produce); return 0; } -- cgit 1.2.3-korg