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 5555EA0561; Mon, 20 Apr 2020 17:26:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 39AD11D698; Mon, 20 Apr 2020 17:26:15 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 0B2911D686 for ; Mon, 20 Apr 2020 17:26:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587396373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RCOgMRdnNoF5eIUGq0pR08vQOdY9i68IeNw5Umi7E78=; b=HoTVi+u8onpPCV2g+aZBUKUgyMu+s6LTJTHrD2yhulYo/LoWO84ERnpePpST3Vdj16Pl+G 2psoQ4vP+bHTkgr1dEMklMQMRyBJOlbzIaG0yRtF8BNO5OUCAl8kQg0RoZKhYmmqZ/s1Fr tpTCQ1iPjtzv94fNjq2ob9O/TU+zSnI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-447-vRbp7BkUOQ6Ii3ADVzA08g-1; Mon, 20 Apr 2020 11:26:10 -0400 X-MC-Unique: vRbp7BkUOQ6Ii3ADVzA08g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 89AE28018AB; Mon, 20 Apr 2020 15:26:08 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-114-167.rdu2.redhat.com [10.10.114.167]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1614860FC6; Mon, 20 Apr 2020 15:26:02 +0000 (UTC) From: Aaron Conole To: "Ananyev\, Konstantin" Cc: "dev\@dpdk.org" , Pavan Nikhilesh , "Richardson\, Bruce" , David Marchand , "Yigit\, Ferruh" , "Burakov\, Anatoly" , Lukasz Wojciechowski References: <20200415172547.1421587-1-aconole@redhat.com> <20200417131410.1343135-1-aconole@redhat.com> <20200417131410.1343135-3-aconole@redhat.com> Date: Mon, 20 Apr 2020 11:26:01 -0400 In-Reply-To: (Konstantin Ananyev's message of "Mon, 20 Apr 2020 12:53:43 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v5 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" "Ananyev, Konstantin" writes: >>=20 >> In addition, do a formal parameter check. >>=20 >> Acked-by: Lukasz Wojciechowski >> Signed-off-by: Aaron Conole >> --- >> lib/librte_ip_frag/rte_ipv6_fragmentation.c | 9 +++++++++ >> 1 file changed, 9 insertions(+) >>=20 >> diff --git a/lib/librte_ip_frag/rte_ipv6_fragmentation.c b/lib/librte_ip= _frag/rte_ipv6_fragmentation.c >> index 43449970e5..ee984aed82 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, >> =09uint16_t fragment_offset, frag_size; >> =09uint64_t frag_bytes_remaining; >>=20 >> +=09/* >> +=09 * Formal parameter checking. >> +=09 */ >> +=09if (unlikely(pkt_in =3D=3D NULL) || unlikely(pkts_out =3D=3D NULL) |= | >> +=09 unlikely(nb_pkts_out =3D=3D 0) || >> +=09 unlikely(pool_direct =3D=3D NULL) || unlikely(pool_indirect =3D= =3D NULL) || >> +=09 unlikely(mtu_size < 1280)) > > Same as for ipv4 - LGTM in general, but please avoid hard-coded constants= for MTU values. > Here I couldn't find an existing macro ro min ipv6 mtu, so probably worth= to add a new one > in librte_net/. I plan to add it in rte_ip.h as RTE_IPV6_MIN_MTU since it seems to fit there. I don't think it looks right to add RTE_ETHER_IPV6_MIN_MTU in the rte_ether.h file (but if you think it looks better I will change to that). > With that nit fixed: > Acked-by: Konstantin Ananyev Thanks! >> +=09=09return -EINVAL; >> + >> =09/* >> =09 * Ensure the IP payload length of all fragments (except the >> =09 * the last fragment) are a multiple of 8 bytes per RFC2460. >> -- >> 2.25.1