From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id E1B49A0096 for ; Thu, 6 Jun 2019 13:36:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B63B41B9A6; Thu, 6 Jun 2019 13:36:32 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id AEDA51B99E; Thu, 6 Jun 2019 13:36:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jun 2019 04:36:30 -0700 X-ExtLoop1: 1 Received: from sivswdev08.ir.intel.com ([10.237.217.47]) by fmsmga001.fm.intel.com with ESMTP; 06 Jun 2019 04:36:29 -0700 From: Konstantin Ananyev To: dev@dpdk.org Cc: akhil.goyal@nxp.com, Konstantin Ananyev , stable@dpdk.org Date: Thu, 6 Jun 2019 12:33:28 +0100 Message-Id: <20190606113328.12883-1-konstantin.ananyev@intel.com> X-Mailer: git-send-email 2.18.0 Subject: [dpdk-dev] [PATCH] ip_frag: fix IPv6 fragment size calculation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Take into account IPv6 fragment extension header when calculating data size for each fragment. Fixes: 7a838c8798a9 ("ip_frag: fix IPv6 when MTU sizes not aligned to 8 bytes") Fixes: 0aa31d7a5929 ("ip_frag: add IPv6 fragmentation support") Cc: stable@dpdk.org Signed-off-by: Konstantin Ananyev --- lib/librte_ip_frag/rte_ipv6_fragmentation.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_ip_frag/rte_ipv6_fragmentation.c b/lib/librte_ip_frag/rte_ipv6_fragmentation.c index bfe44d435..43449970e 100644 --- a/lib/librte_ip_frag/rte_ipv6_fragmentation.c +++ b/lib/librte_ip_frag/rte_ipv6_fragmentation.c @@ -83,8 +83,10 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in, * Ensure the IP payload length of all fragments (except the * the last fragment) are a multiple of 8 bytes per RFC2460. */ - frag_size = RTE_ALIGN_FLOOR(mtu_size - sizeof(struct rte_ipv6_hdr), - RTE_IPV6_EHDR_FO_ALIGN); + + frag_size = mtu_size - sizeof(struct rte_ipv6_hdr) - + sizeof(struct ipv6_extension_fragment); + frag_size = RTE_ALIGN_FLOOR(frag_size, RTE_IPV6_EHDR_FO_ALIGN); /* Check that pkts_out is big enough to hold all fragments */ if (unlikely (frag_size * nb_pkts_out < -- 2.17.1