numam-dpdk/lib/librte_gso
Yi Yang c0d002aed9 gso: fix mbuf freeing responsibility
rte_gso_segment decreased refcnt of pkt by one, but
it is wrong if pkt is external mbuf, pkt won't be
freed because of incorrect refcnt, the result is
application can't allocate mbuf from mempool because
mbufs in mempool are run out of.

One correct way is application should call
rte_pktmbuf_free after calling rte_gso_segment to free
pkt explicitly. rte_gso_segment must not handle it, this
should be responsibility of application.

This commit changed rte_gso_segment in functional behavior
and return value, so the application must take appropriate
actions according to return values, "ret < 0" means it
should free and drop 'pkt', "ret == 0" means 'pkt' isn't
GSOed but 'pkt' can be transmitted as a normal packet,
"ret > 0" means 'pkt' has been GSOed into two or multiple
segments, it should use "pkts_out" to transmit these
segments. The application must free 'pkt' after call
rte_gso_segment when return value isn't equal to 0.

Fixes: 119583797b ("gso: support TCP/IPv4 GSO")
Cc: stable@dpdk.org

Signed-off-by: Yi Yang <yangyi01@inspur.com>
Acked-by: Jiayu Hu <jiayu.hu@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2020-11-03 22:45:02 +01:00
..
gso_common.c lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
gso_common.h net: add rte prefix to UDP structure 2019-05-24 13:34:46 +02:00
gso_tcp4.c gso: fix mbuf freeing responsibility 2020-11-03 22:45:02 +01:00
gso_tcp4.h lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
gso_tunnel_tcp4.c gso: fix mbuf freeing responsibility 2020-11-03 22:45:02 +01:00
gso_tunnel_tcp4.h lib: use SPDX tag for Intel copyright files 2018-01-04 22:41:39 +01:00
gso_udp4.c gso: fix mbuf freeing responsibility 2020-11-03 22:45:02 +01:00
gso_udp4.h gso: support UDP/IPv4 fragmentation 2018-07-11 23:45:20 +02:00
meson.build gso: support UDP/IPv4 fragmentation 2018-07-11 23:45:20 +02:00
rte_gso.c gso: fix mbuf freeing responsibility 2020-11-03 22:45:02 +01:00
rte_gso.h gso: fix mbuf freeing responsibility 2020-11-03 22:45:02 +01:00
version.map build: remove library name from version map file name 2020-10-19 22:13:59 +02:00