aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ena
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2017-08-30 15:07:26 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2017-08-30 15:08:21 +0100
commitfdd2322bb45e83d3fd96b06ea32a4afbb60bcb6f (patch)
treec28b354e5687537e9e5729c625a378b9f46cab37 /drivers/net/ena
parentaab0c291a90f701b60f8c9a88cbcc265cba0ec8b (diff)
New upstream version 16.11.3
Change-Id: Ieb0ca817d9390060d3f128db691dc76bc0494727 Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
Diffstat (limited to 'drivers/net/ena')
-rw-r--r--drivers/net/ena/ena_ethdev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 1fc3654e..6efe0c3c 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -677,11 +677,10 @@ static void ena_rx_queue_release_bufs(struct ena_ring *ring)
static void ena_tx_queue_release_bufs(struct ena_ring *ring)
{
- unsigned int ring_mask = ring->ring_size - 1;
+ unsigned int i;
- while (ring->next_to_clean != ring->next_to_use) {
- struct ena_tx_buffer *tx_buf =
- &ring->tx_buffer_info[ring->next_to_clean & ring_mask];
+ for (i = 0; i < ring->ring_size; ++i) {
+ struct ena_tx_buffer *tx_buf = &ring->tx_buffer_info[i];
if (tx_buf->mbuf)
rte_pktmbuf_free(tx_buf->mbuf);
@@ -1683,6 +1682,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
/* Free whole mbuf chain */
mbuf = tx_info->mbuf;
rte_pktmbuf_free(mbuf);
+ tx_info->mbuf = NULL;
/* Put back descriptor to the ring for reuse */
tx_ring->empty_tx_reqs[next_to_clean & ring_mask] = req_id;