numam-dpdk/doc/guides/prog_guide
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
..
img eal: rename lcore master and slave 2020-10-20 13:17:08 +02:00
bbdev.rst doc: update bbdev guide 2020-10-14 21:32:11 +02:00
bpf_lib.rst bpf: support packet data load instructions 2020-06-24 23:42:04 +02:00
build_app.rst build: remove makefiles 2020-09-08 00:09:50 +02:00
build-sdk-meson.rst doc: add SPDX license tag header to meson guide 2020-10-19 18:21:44 +02:00
compressdev.rst doc: update compressdev guide 2019-07-19 14:17:11 +02:00
cryptodev_lib.rst cryptodev: add raw crypto datapath API 2020-10-14 22:22:06 +02:00
efd_lib.rst doc: fix spelling reported by aspell in guides 2019-05-03 00:37:13 +02:00
env_abstraction_layer.rst eal: rename lcore master and slave 2020-10-20 13:17:08 +02:00
event_crypto_adapter.rst doc: add notes about eventdev producer/consumer dependency 2019-03-15 06:46:50 +01:00
event_ethernet_rx_adapter.rst eventdev: remove software Rx timestamp 2020-11-03 15:28:26 +01:00
event_ethernet_tx_adapter.rst eventdev: add Tx flag for packets with same destination 2019-10-18 10:03:08 +02:00
event_timer_adapter.rst doc: fix internal links for older releases 2019-11-15 09:58:01 +01:00
eventdev.rst devtools: forbid variable declaration inside for 2020-07-03 10:04:15 +02:00
flow_classify_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
generic_receive_offload_lib.rst gro: support VXLAN UDP/IPv4 2020-10-06 21:51:03 +02:00
generic_segmentation_offload_lib.rst gso: fix mbuf freeing responsibility 2020-11-03 22:45:02 +01:00
glossary.rst eal: rename lcore master and slave 2020-10-20 13:17:08 +02:00
graph_lib.rst doc: remove trailing white space 2020-10-06 00:42:21 +02:00
hash_lib.rst hash: implement RCU resources reclamation 2020-10-24 09:25:13 +02:00
index.rst build: remove makefiles 2020-09-08 00:09:50 +02:00
intro.rst build: remove makefiles 2020-09-08 00:09:50 +02:00
ip_fragment_reassembly_lib.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
ipsec_lib.rst ipsec: support CPU crypto mode 2020-02-05 15:29:59 +01:00
kernel_nic_interface.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
link_bonding_poll_mode_drv_lib.rst doc: fix driver names 2020-11-03 16:23:03 +01:00
lpm6_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
lpm_lib.rst lpm: implement RCU rule reclamation 2020-07-10 13:41:29 +02:00
lto.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
mbuf_lib.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
member_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
mempool_lib.rst doc: add stack mempool guide 2020-10-08 09:34:58 +02:00
meson_ut.rst doc: add a guide to run unit tests with meson 2020-02-16 11:30:30 +01:00
metrics_lib.rst metrics: add function to deinitialise library 2019-07-16 12:45:30 +02:00
multi_proc_support.rst ipc: add warnings about correct API usage 2019-05-09 17:50:59 +02:00
overview.rst build: remove makefiles 2020-09-08 00:09:50 +02:00
packet_classif_access_ctrl.rst acl: check max SIMD bitwidth 2020-10-19 16:45:02 +02:00
packet_distrib_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
packet_framework.rst port: add symmetric crypto 2018-10-12 19:33:02 +02:00
pdump_lib.rst pdump: remove deprecated APIs 2018-12-19 01:25:56 +01:00
perf_opt_guidelines.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
poll_mode_drv.rst ethdev: remove underscore prefix from internal API 2020-09-18 18:55:08 +02:00
power_man.rst doc: fix references in power management guide 2019-01-20 13:17:48 +01:00
profile_app.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
qos_framework.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
rawdev.rst doc: fix a grammar mistake in rawdev guide 2019-07-08 20:21:34 +02:00
rcu_lib.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
regexdev.rst doc: remove trailing white space 2020-10-06 00:42:21 +02:00
reorder_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
ring_lib.rst ring: add zero copy API 2020-10-29 14:13:31 +01:00
rte_flow.rst ethdev: add tunnel offload model 2020-10-16 19:48:19 +02:00
rte_security.rst security: switch metadata to dynamic mbuf field 2020-10-31 16:13:11 +01:00
service_cores.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
source_org.rst doc: fix driver names 2020-11-03 16:23:03 +01:00
stack_lib.rst doc: add stack mempool guide 2020-10-08 09:34:58 +02:00
switch_representation.rst doc: fix internal links for older releases 2019-11-15 09:58:01 +01:00
telemetry_lib.rst doc: add more detail to telemetry guides 2020-07-30 20:32:49 +02:00
thread_safety_dpdk_functions.rst doc: fix reference to master process 2020-08-07 13:02:04 +02:00
timer_lib.rst doc: convert Intel license headers to SPDX tags 2018-02-06 23:27:08 +01:00
trace_lib.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00
traffic_management.rst doc: fix spelling reported by aspell in guides 2019-05-03 00:37:13 +02:00
traffic_metering_and_policing.rst ethdev: rename folder to library name 2018-04-27 18:01:00 +01:00
vhost_lib.rst vhost: remove dequeue zero-copy support 2020-09-30 23:16:56 +02:00
writing_efficient_code.rst doc: remove references to make from prog guide 2020-10-01 16:51:24 +02:00