From: David Harton Date: Fri, 25 Aug 2017 15:22:11 +0000 (-0400) Subject: net/vmxnet3: replenish ring buffers in Rx X-Git-Tag: spdx-start~1972 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c740ba20c8cb7c334c734c27b0d9e95d266830f7;p=dpdk.git net/vmxnet3: replenish ring buffers in Rx vmxnet3 Rx processing should replenish ring buffers after new buffers are available to prevent the interface from getting stuck in a state that no new work is processed. Signed-off-by: David Harton Acked-by: Shrikrishna Khare --- diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index d9cf437394..9861d35001 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -880,6 +880,23 @@ rcd_done: } } + if (unlikely(nb_rxd == 0)) { + uint32_t avail; + for (ring_idx = 0; ring_idx < VMXNET3_RX_CMDRING_SIZE; ring_idx++) { + avail = vmxnet3_cmd_ring_desc_avail(&rxq->cmd_ring[ring_idx]); + if (unlikely(avail > 0)) { + /* try to alloc new buf and renew descriptors */ + vmxnet3_post_rx_bufs(rxq, ring_idx); + } + } + if (unlikely(rxq->shared->ctrl.updateRxProd)) { + for (ring_idx = 0; ring_idx < VMXNET3_RX_CMDRING_SIZE; ring_idx++) { + VMXNET3_WRITE_BAR0_REG(hw, rxprod_reg[ring_idx] + (rxq->queue_id * VMXNET3_REG_ALIGN), + rxq->cmd_ring[ring_idx].next2fill); + } + } + } + return nb_rx; }