From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 59BFCA0597; Tue, 21 Apr 2020 13:04:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3541D1D98C; Tue, 21 Apr 2020 13:04:31 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by dpdk.org (Postfix) with ESMTP id 99B7E1D986 for ; Tue, 21 Apr 2020 13:04:29 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200421110429euoutp01006a6b84987321a29150a62542dbcc2f~H0ON31U262551825518euoutp01E for ; Tue, 21 Apr 2020 11:04:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200421110429euoutp01006a6b84987321a29150a62542dbcc2f~H0ON31U262551825518euoutp01E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1587467069; bh=5MUHIyezYPj/fELU/xTPKJOqbmzFLz/C7Ub/prduJdQ=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=PhrlNVOFaMWi4gYQA1M3WAf/811z1lAhxEtVJDYY4bH6yyX2gPFKKnJPanQErnXZz 5FbdbhCs+dXR+zOWPcU1Ew0z5EniIZnvAhXFchohrIUFVOvSEdiCDbHFmtpi5xAgPF xD5LT/HdOvVE+bm0x3gLbG51QOrjEQqItXky7EVM= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200421110428eucas1p2a60b6d5d5687c2e88c2843f655eb07de~H0ONwFwQX0731207312eucas1p2N; Tue, 21 Apr 2020 11:04:28 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 14.94.60679.C33DE9E5; Tue, 21 Apr 2020 12:04:28 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200421110428eucas1p2093ca2c5831ee34ca5ab6113b37db891~H0ONiQh9d0731207312eucas1p2M; Tue, 21 Apr 2020 11:04:28 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200421110428eusmtrp2d0a1065028d0c6bf6dd5a64205cef3c6~H0ONhjirR0919909199eusmtrp2v; Tue, 21 Apr 2020 11:04:28 +0000 (GMT) X-AuditID: cbfec7f4-0e5ff7000001ed07-ff-5e9ed33c0d47 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 65.51.08375.C33DE9E5; Tue, 21 Apr 2020 12:04:28 +0100 (BST) Received: from [106.210.88.70] (unknown [106.210.88.70]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200421110427eusmtip2965eb4aab52627f888f004dd2e2603a1~H0OM4iQ191045710457eusmtip2R; Tue, 21 Apr 2020 11:04:27 +0000 (GMT) To: Aaron Conole , dev@dpdk.org Cc: Pavan Nikhilesh , Bruce Richardson , David Marchand , Ferruh Yigit , Anatoly Burakov From: Lukasz Wojciechowski Message-ID: Date: Tue, 21 Apr 2020 13:04:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200420192523.2546909-3-aconole@redhat.com> Content-Transfer-Encoding: 8bit Content-Language: pl X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrOKsWRmVeSWpSXmKPExsWy7djPc7o2l+fFGbx9YWbx680DdotH9xYz W9xYZW+xfUUXm8W7T9uZLO7sPc1ucbznI4sDu8evBUtZPRbvecnkMXnhRWaP9/uusgWwRHHZ pKTmZ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JxCAksZZTY2b2TsYuRAyghI/HhkgBEjbDEn2td bBA1rxklOnrPsoAkhAW8JfZeOM0EYosIGEvs+HCeCaSIWeApo0TnrX2sIAkhgbeMEl1X7UFs NgFbiSMzv4LFeQXcJOZ92MwGYrMIqEr8+3UTbLGoQKxEy0VNiBJBiZMzn4Dt4hSwktjR8YMZ xGYWMJOYt/khlC0v0bx1NpQtInHjUQvjBEahWUjaZyFpmYWkZRaSlgWMLKsYRVJLi3PTc4sN 9YoTc4tL89L1kvNzNzECI23bsZ+bdzBe2hh8iFGAg1GJh/fG+XlxQqyJZcWVuYcYJTiYlUR4 LbSAQrwpiZVVqUX58UWlOanFhxhNgX6byCwlmpwPTAJ5JfGGpobmFpaG5sbmxmYWSuK8HQIH Y4QE0hNLUrNTUwtSi2D6mDg4pRoYpSXrrG/o7Z/9XOiO495JVf+u3BV233HnysGOXU2mEhbi hbWZtZu4Ww55CHUXVp1RXxNyhOvI9LlOO9/krH9xu7ZMwPvK8usPFj76bP+2kN1h/cLrEQZe VRcj7nkGbEirWfCzteP8RJ+uKXfW35i52vvSq2LJ+71MnnOzbiq05jCz/t74QU40VYmlOCPR UIu5qDgRAA59xAvKAgAA X-CMS-MailID: 20200421110428eucas1p2093ca2c5831ee34ca5ab6113b37db891 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200420192541eucas1p1a282cda981d004818bf67bed5721a833 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200420192541eucas1p1a282cda981d004818bf67bed5721a833 References: <20200417131410.1343135-1-aconole@redhat.com> <20200420192523.2546909-1-aconole@redhat.com> <20200420192523.2546909-3-aconole@redhat.com> Subject: Re: [dpdk-dev] [PATCH v6 2/3] ip_frag: ensure minimum v6 fragmentation length 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" W dniu 20.04.2020 o 21:25, Aaron Conole pisze: > In addition, do a formal parameter check. > > Acked-by: Konstantin Ananyev > Acked-by: Lukasz Wojciechowski > Signed-off-by: Aaron Conole > --- > lib/librte_ip_frag/rte_ipv6_fragmentation.c | 9 +++++++++ > lib/librte_net/rte_ip.h | 2 ++ > 2 files changed, 11 insertions(+) > > diff --git a/lib/librte_ip_frag/rte_ipv6_fragmentation.c b/lib/librte_ip_frag/rte_ipv6_fragmentation.c > index 43449970e5..5d67336f2d 100644 > --- a/lib/librte_ip_frag/rte_ipv6_fragmentation.c > +++ b/lib/librte_ip_frag/rte_ipv6_fragmentation.c > @@ -79,6 +79,15 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in, > uint16_t fragment_offset, frag_size; > uint64_t frag_bytes_remaining; > > + /* > + * Formal parameter checking. > + */ > + if (unlikely(pkt_in == NULL) || unlikely(pkts_out == NULL) || > + unlikely(nb_pkts_out == 0) || > + unlikely(pool_direct == NULL) || unlikely(pool_indirect == NULL) || > + unlikely(mtu_size < RTE_IPV6_MIN_MTU)) > + return -EINVAL; > + > /* > * Ensure the IP payload length of all fragments (except the > * the last fragment) are a multiple of 8 bytes per RFC2460. > diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h > index 1ceb7b7931..d50edec572 100644 > --- a/lib/librte_net/rte_ip.h > +++ b/lib/librte_net/rte_ip.h > @@ -371,6 +371,8 @@ struct rte_ipv6_hdr { > #define RTE_IPV6_HDR_ECN_MASK (0x03 << RTE_IPV6_HDR_TC_SHIFT) > #define RTE_IPV6_HDR_ECN_CE RTE_IPV6_HDR_ECN_MASK > > +#define RTE_IPV6_MIN_MTU 1280 /**< Minimum MTU for IPv6, see RFC 8200. */ > + > /** > * Process the pseudo-header checksum of an IPv6 header. > * Acked-by: Lukasz Wojciechowski -- Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Office +48 22 377 88 25 l.wojciechow@partner.samsung.com