From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: ip_frag: handle MTU sizes not aligned to 8 bytes Date: Thu, 22 Jun 2017 18:00:25 +0200 Message-ID: <3344778.x1AQTSzbEx@xps> References: <1489504487-67456-1-git-send-email-allain.legacy@windriver.com> <2601191342CEEE43887BDE71AB9772583FB058D0@IRSMSX109.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, "Ananyev, Konstantin" To: "Legacy, Allain (Wind River)" Return-path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 7D7B32BF1 for ; Thu, 22 Jun 2017 18:00:27 +0200 (CEST) In-Reply-To: <2601191342CEEE43887BDE71AB9772583FB058D0@IRSMSX109.ger.corp.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > 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 > > Acked-by: Konstantin Ananyev Applied, thanks