numam-dpdk/drivers/net/dpaa
Gagandeep Singh 0bf99a02cc net/dpaa: fix buffer freeing in slow path
If there is any error in packet or taildrop feature is enabled,
HW can reject those packets and put them in error queue. Driver
poll this error queue to free the buffers.
DPAA driver has an issue while freeing these rejected buffers. In
case of scatter gather packets, it is preparing the mbuf SG list
by scanning the HW descriptors and once the mbuf SG list prepared,
it free only first segment of the mbuf SG list by calling the
API rte_pktmbuf_free_seg(), This will leak the memory of other
segments and mempool can be empty.

Also there is one more issue, external buffer's memory may not
belong to mempool so driver itself free the external buffer
after successfully send the packet to HW to transmit instead of
let the HW to free it. So transmit function free all the external
buffers. But driver has no check for external buffers
while freeing the rejected buffers and this can do double free the
memory which can corrupt the user pool and crashes and undefined
behaviour of system can be seen.

This patch fixes the above mentioned issue by checking each
and every segment and freeing all the segments except external.

Fixes: 9124e65dd3 ("net/dpaa: enable Tx queue taildrop")
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
..
fmlib remove unnecessary null checks 2022-02-12 12:07:48 +01:00
dpaa_ethdev.c net/dpaa: use internal mempool for SG table 2022-10-07 17:19:03 +02:00
dpaa_ethdev.h net/dpaa: fix buffer freeing on SG Tx 2022-10-07 17:19:03 +02:00
dpaa_flow.c net/dpaa: fix jumbo packet Rx in case of VSP 2022-10-07 17:19:03 +02:00
dpaa_flow.h net/dpaa: fix jumbo packet Rx in case of VSP 2022-10-07 17:19:03 +02:00
dpaa_fmc.c net/dpaa: explain behaviour with FMC policy 2021-10-07 14:47:35 +02:00
dpaa_rxtx.c net/dpaa: fix buffer freeing in slow path 2022-10-07 17:19:03 +02:00
dpaa_rxtx.h net/dpaa: support ESP type in packet parsing 2022-10-07 17:19:03 +02:00
meson.build drivers: change indentation in build files 2021-04-21 14:04:09 +02:00
rte_pmd_dpaa.h net/dpaa: fix port ID type in API 2020-09-18 18:55:10 +02:00
version.map version: 22.11-rc0 2022-07-21 12:13:48 +02:00