numam-dpdk/lib/librte_ip_frag
Allain Legacy 8d4d3a4f73 ip_frag: handle MTU sizes not aligned to 8 bytes
The rte_ipv4_fragment_packet API expects that the link/interface MTU value
passed in be divisible by 8 bytes.  Given the name of the parameter is
"mtu" rather than "frag_size" it is not necessarily the case that it will
be divisible by 8.  An MTU of 1500 happens to produce a max fragment size
of 1480 (1500 - sizeof(ipv4_hdr)) which is divisible by 8 but other MTU
values such as 1600 or 9000 do not produce values that are divisible by 8.

Unfortunately, the API checks that the frag_size value produced is
divisible by 8 with a call to RTE_ASSERT which is only enabled when the
RTE_LOG_LEVEL >= RTE_LOG_DEBUG.  In cases where the log level is set
normally the code silently continues and produces IP fragments that have
invalid fragment offset values.

An application may not have control over what MTU a user selects and rather
than have each application adjust the MTU to pass a suitable value to the
fragmentation API this change modifies the fragmentation API to handle
cases where the "mtu" argument is not divisible by 8 and automatically
adjust the internal "frag_size".

Signed-off-by: Allain Legacy <allain.legacy@windriver.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2017-06-22 17:59:05 +02:00
..
ip_frag_common.h ip_frag: free mbufs on reassembly table destroy 2017-06-22 17:58:38 +02:00
ip_frag_internal.c remove extra parentheses in return statement 2016-02-10 15:47:50 +01:00
Makefile mk: optimize directory dependencies 2017-03-27 23:28:43 +02:00
rte_ip_frag_common.c ip_frag: free mbufs on reassembly table destroy 2017-06-22 17:58:38 +02:00
rte_ip_frag.h ip_frag: free mbufs on reassembly table destroy 2017-06-22 17:58:38 +02:00
rte_ipfrag_version.map ip_frag: free mbufs on reassembly table destroy 2017-06-22 17:58:38 +02:00
rte_ipv4_fragmentation.c ip_frag: handle MTU sizes not aligned to 8 bytes 2017-06-22 17:59:05 +02:00
rte_ipv4_reassembly.c fix typos using codespell utility 2017-06-14 23:54:13 +02:00
rte_ipv6_fragmentation.c eal: add assert macro for debug 2016-05-02 15:31:17 +02:00
rte_ipv6_reassembly.c fix typos using codespell utility 2017-06-14 23:54:13 +02:00