[PATCH 04/10] port: free buffered packets on Ethernet device output port free
Cristian Dumitrescu
cristian.dumitrescu at intel.com
Sat Aug 6 00:00:23 CEST 2022
Free the buffered packets as opposed to retrying to send them when the
output port is freed.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu at intel.com>
---
lib/port/rte_swx_port_ethdev.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
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);
}
--
2.34.1
More information about the dev
mailing list