numam-dpdk/drivers
Gagandeep Singh 8716c0ec06 net/dpaa: fix buffer freeing on SG Tx
When using SG list to TX with external and direct buffers,
HW free direct buffers and driver free 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 below 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 this, 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 by driver even after transmit packets for
non-direct buffer cleanup. This can cause the buffer leak issue.

Fixes: f191d5abda ("net/dpaa: 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
..
baseband dev: hide driver object 2022-09-23 16:14:34 +02:00
bus bus/dpaa: move mempool registration before probing 2022-10-07 17:19:03 +02:00
common common/sfc_efx/base: use avail and used terms for indexes 2022-10-04 17:22:56 +02:00
compress dev: hide driver object 2022-09-23 16:14:34 +02:00
crypto crypto/mvsam: fix build after session rework 2022-10-06 12:16:16 +02:00
dma drivers/bus: set device NUMA node to unknown by default 2022-10-06 21:26:55 +02:00
event net/dpaa2: check free enqueue descriptors before Tx 2022-10-07 17:19:03 +02:00
gpu dev: hide driver object 2022-09-23 16:14:34 +02:00
mempool common/cnxk: reserve AURA zero on CN10KA NPA 2022-09-22 10:44:04 +02:00
net net/dpaa: fix buffer freeing on SG Tx 2022-10-07 17:19:03 +02:00
raw raw/skeleton: remove useless check 2022-10-05 21:34:30 +02:00
regex dev: hide driver object 2022-09-23 16:14:34 +02:00
vdpa vdpa/sfc: support multi-queue 2022-10-04 17:23:58 +02:00
meson.build build: export drivers headers 2022-09-23 16:14:34 +02:00