diff mbox series

[04/10] port: free buffered packets on Ethernet device output port free

Message ID 20220805220029.1096212-5-cristian.dumitrescu@intel.com (mailing list archive)
State Accepted
Delegated to: Thomas Monjalon
Headers show
Series port: implement output port non-blocking behavior | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Dumitrescu, Cristian Aug. 5, 2022, 10 p.m. UTC
Free the buffered packets as opposed to retrying to send them when the
output port is freed.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 lib/port/rte_swx_port_ethdev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/port/rte_swx_port_ethdev.c b/lib/port/rte_swx_port_ethdev.c
index eae20d34ce..8a1da71003 100644
--- a/lib/port/rte_swx_port_ethdev.c
+++ b/lib/port/rte_swx_port_ethdev.c
@@ -371,11 +371,17 @@  static void
 writer_free(void *port)
 {
 	struct writer *p = port;
+	int i;
 
 	if (!p)
 		return;
 
-	writer_flush(p);
+	for (i = 0; i < p->n_pkts; i++) {
+		struct rte_mbuf *m = p->pkts[i];
+
+		rte_pktmbuf_free(m);
+	}
+
 	free(p->pkts);
 	free(port);
 }