summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerin Jacob <jerin.jacob@caviumnetworks.com>2017-05-02 00:11:55 +0530
committerThomas Monjalon <thomas@monjalon.net>2017-05-01 22:23:57 +0200
commitb31eb105463fa1844c19fde382dd6bd294329831 (patch)
treec7c04a83a44236ff97934a4c40e9b783ba9f5d29
parent939abaf96a72e31a053c26cd825252e4ba77375f (diff)
downloaddpdk-stable-b31eb105463fa1844c19fde382dd6bd294329831.zip
dpdk-stable-b31eb105463fa1844c19fde382dd6bd294329831.tar.gz
dpdk-stable-b31eb105463fa1844c19fde382dd6bd294329831.tar.xz
net/thunderx: fix deadlock in Rx path
RBDR buffers are refilled when SW consumes the buffers from CQ. This creates deadlock case when CQ buffers exhausted due to lack of RBDR buffers. Fix is to refill the RBDR when rx_free_thresh meet, irrespective of the number of CQ buffers consumed. Fixes: e2d7fc9f0a24 ("net/thunderx: add single and multi-segment Rx") Cc: stable@dpdk.org Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
-rw-r--r--drivers/net/thunderx/nicvf_rxtx.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index 003ab06..6cae834 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -464,11 +464,10 @@ nicvf_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
rxq->head = cqe_head;
nicvf_addr_write(rxq->cq_door, to_process);
rxq->recv_buffers += to_process;
- if (rxq->recv_buffers > rxq->rx_free_thresh) {
- rxq->recv_buffers -= nicvf_fill_rbdr(rxq,
- rxq->rx_free_thresh);
- NICVF_RX_ASSERT(rxq->recv_buffers >= 0);
- }
+ }
+ if (rxq->recv_buffers > rxq->rx_free_thresh) {
+ rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh);
+ NICVF_RX_ASSERT(rxq->recv_buffers >= 0);
}
return to_process;
@@ -555,11 +554,10 @@ nicvf_recv_pkts_multiseg(void *rx_queue, struct rte_mbuf **rx_pkts,
rxq->head = cqe_head;
nicvf_addr_write(rxq->cq_door, to_process);
rxq->recv_buffers += buffers_consumed;
- if (rxq->recv_buffers > rxq->rx_free_thresh) {
- rxq->recv_buffers -=
- nicvf_fill_rbdr(rxq, rxq->rx_free_thresh);
- NICVF_RX_ASSERT(rxq->recv_buffers >= 0);
- }
+ }
+ if (rxq->recv_buffers > rxq->rx_free_thresh) {
+ rxq->recv_buffers -= nicvf_fill_rbdr(rxq, rxq->rx_free_thresh);
+ NICVF_RX_ASSERT(rxq->recv_buffers >= 0);
}
return to_process;