diff options
author | Mintz, Yuval <Yuval.Mintz@cavium.com> | 2017-01-01 13:57:04 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-01 21:02:14 -0500 |
commit | e3eef7ee0201dbe5f4fc011b58d26228b57736ce (patch) | |
tree | 6d4c2f2cc6cab6bd563ffc3a3f10d4f5827b82c2 /drivers/net/ethernet/qlogic/qede/qede_main.c | |
parent | e1d32acbcbd35af5264acc70ff03bf8da9e447a8 (diff) | |
download | linux-e3eef7ee0201dbe5f4fc011b58d26228b57736ce.tar.gz linux-e3eef7ee0201dbe5f4fc011b58d26228b57736ce.tar.bz2 linux-e3eef7ee0201dbe5f4fc011b58d26228b57736ce.zip |
qede: Postpone reallocation until NAPI end
During Rx flow driver allocates a replacement buffer each time
it consumes an Rx buffer. Failing to do so, it would consume the
currently processed buffer and re-post it on the ring.
As a result, the Rx ring is always completely full [from driver POV].
We now allow the Rx ring to shorten by doing the re-allocations
at the end of the NAPI run. The only limitation is that we still want to
make sure each time we reallocate that we'd still have sufficient
elements in the Rx ring to guarantee that FW would be able to post
additional data and trigger an interrupt.
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qede/qede_main.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qede/qede_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c index a679d4296cd8..be4121c867c3 100644 --- a/drivers/net/ethernet/qlogic/qede/qede_main.c +++ b/drivers/net/ethernet/qlogic/qede/qede_main.c @@ -1154,8 +1154,9 @@ static int qede_alloc_mem_rxq(struct qede_dev *edev, struct qede_rx_queue *rxq) goto err; /* Allocate buffers for the Rx ring */ + rxq->filled_buffers = 0; for (i = 0; i < rxq->num_rx_buffers; i++) { - rc = qede_alloc_rx_buffer(rxq); + rc = qede_alloc_rx_buffer(rxq, false); if (rc) { DP_ERR(edev, "Rx buffers allocation failed at index %d\n", i); |