[dpdk-stable] patch 'net/ena: cleanup if refilling of Rx descriptors fails' has been queued to LTS release 16.11.2

Yuanhan Liu yuanhan.liu at linux.intel.com
Fri Apr 21 08:19:33 CEST 2017


Hi,

FYI, your patch has been queued to LTS release 16.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable
yet. It will be pushed if I get no objections before 04/26/17.
So please shout if anyone has objections.

Thanks.

	--yliu

---
>From 32c782c5926d9c922e04346906198674c74f8cbc Mon Sep 17 00:00:00 2001
From: Michal Krawczyk <mk at semihalf.com>
Date: Mon, 10 Apr 2017 16:28:10 +0200
Subject: [PATCH] net/ena: cleanup if refilling of Rx descriptors fails

[ upstream commit 2732e07ad1e54c648c8ca5bc6965af5bf607ba10 ]

If wrong number of descriptors for refilling was passed to the Rx
repopulate function, there was memory leak which caused memory pool to
run out of resources in longer go.

In case of fail when refilling Rx descriptors, all additional mbufs
have to be released.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")

Signed-off-by: Michal Krawczyk <mk at semihalf.com>
Reviewed-by: Jakub Palider <jpalider at gmail.com>
Acked-by: Jan Medala <jan.medala at outlook.com>
---
 drivers/net/ena/ena_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index c1fd7bb..a62db65 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -1160,6 +1160,8 @@ static int ena_populate_rx_queue(struct ena_ring *rxq, unsigned int count)
 		rc = ena_com_add_single_rx_desc(rxq->ena_com_io_sq,
 						&ebuf, next_to_use_masked);
 		if (unlikely(rc)) {
+			rte_mempool_put_bulk(rxq->mb_pool, (void **)(&mbuf),
+					     count - i);
 			RTE_LOG(WARNING, PMD, "failed adding rx desc\n");
 			break;
 		}
-- 
1.9.0



More information about the stable mailing list