numam-dpdk/drivers/net/dpaa2
Gagandeep Singh b0074a7ba1 net/dpaa2: fix buffer freeing on SG Tx
When using SG list to TX with external and direct buffers,
HW free the direct buffers and driver free the external buffers.

Software scans the complete SG mbuf list to find the external
buffers to free, but this is wrong as hardware can free the
direct buffers if any present in the list and same can be
re-allocated for other purpose in multi thread or high speed
running traffic environment with new data in it. So the software
which is scanning the SG mbuf list, if that list has any direct
buffer present then that direct buffer's next pointer can give
wrong pointer value, if already freed by hardware which
can do the mempool corruption or memory leak.

In this patch instead of relying on user given SG mbuf list
we are storing the buffers in an internal list which will
be scanned by driver after transmit to free non-direct
buffers.

This patch also fixes 2 more memory leak issues.

Driver is freeing complete SG list by checking external buffer
flag in first segment only, but external buffer can be attached
to any of the segment. Because of which driver either can double
free buffers or there can be memory leak.

In case of indirect buffers, driver is modifying the original
buffer list to free the indirect buffers but this original buffer
list is being used even after transmit packets for software
buffer cleanup. This can cause the buffer leak issue.

Fixes: 6bfbafe18d ("net/dpaa2: support external buffers in Tx")
Cc: stable@dpdk.org

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-10-07 17:19:03 +02:00
..
base dev: hide driver object 2022-09-23 16:14:34 +02:00
mc net/dpaa2: update management complex to 10.32 2022-05-10 15:43:08 +02:00
dpaa2_ethdev.c net/dpaa2: use internal mempool for SG table 2022-10-07 17:19:03 +02:00
dpaa2_ethdev.h net/dpaa2: fix buffer freeing on SG Tx 2022-10-07 17:19:03 +02:00
dpaa2_flow.c ethdev: remove deprecated flow action physical port 2022-09-27 10:26:51 +02:00
dpaa2_mux.c net/dpaa2: fix DPDMUX error behaviour 2022-10-07 17:19:03 +02:00
dpaa2_pmd_logs.h drivers: fix SPDX license id consistency 2019-03-29 00:15:53 +01:00
dpaa2_ptp.c bus/fslmc: make driver-only headers private 2022-09-23 16:14:34 +02:00
dpaa2_recycle.c dev: hide driver object 2022-09-23 16:14:34 +02:00
dpaa2_rxtx.c net/dpaa2: fix buffer freeing on SG Tx 2022-10-07 17:19:03 +02:00
dpaa2_sparser.c dev: hide driver object 2022-09-23 16:14:34 +02:00
dpaa2_sparser.h net/dpaa2: remove useless C++ include guard 2022-02-08 17:13:24 +01:00
dpaa2_tm.c net/dpaa2: support level 2 in traffic management 2022-01-20 16:24:08 +01:00
dpaa2_tm.h net/dpaa2: support level 2 in traffic management 2022-01-20 16:24:08 +01:00
meson.build net/dpaa2: support recycle loopback port 2022-01-20 16:24:09 +01:00
rte_pmd_dpaa2.h net/dpaa2: generate HW hash key 2021-10-07 14:47:25 +02:00
version.map version: 22.11-rc0 2022-07-21 12:13:48 +02:00