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 EC758A0561; Mon, 20 Apr 2020 19:35:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF4091D702; Mon, 20 Apr 2020 19:34:53 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 4D12B1D713 for ; Mon, 20 Apr 2020 19:34:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587404091; 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=U6D5clPdGslk1lOVCrmcNPFk+ORklO1dNvMjJ1SptvI=; b=eqZNGnS5lmdkGGIxHlW0IjqG6SSYCuUzK8TuSLK0/mhfivOwq25gq5bixlZlo7SG0sT4/q PUGKqlA1P07+6LwqqRQQsz/PLG1zo0EYD21XtJ3Vfxls7Ag/bWgWwKo49EWz1rKuTMHrxh yogwW8g8bbmO46V0yal9boJQBGlDi1M= 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-400-nvZHd9K9OHahZ19vD2zxtw-1; Mon, 20 Apr 2020 13:34:46 -0400 X-MC-Unique: nvZHd9K9OHahZ19vD2zxtw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A7765801E53; Mon, 20 Apr 2020 17:34:44 +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 9615BBEA65; Mon, 20 Apr 2020 17:34:40 +0000 (UTC) From: Aaron Conole To: "Burakov\, Anatoly" Cc: dev@dpdk.org, Konstantin Ananyev , Pavan Nikhilesh , Bruce Richardson , David Marchand , Ferruh Yigit , Lukasz Wojciechowski References: <20200415172547.1421587-1-aconole@redhat.com> <20200417131410.1343135-1-aconole@redhat.com> <20200417131410.1343135-4-aconole@redhat.com> Date: Mon, 20 Apr 2020 13:34:39 -0400 In-Reply-To: (Anatoly Burakov's message of "Mon, 20 Apr 2020 17:03:43 +0100") 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.15 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 3/3] ipfrag: add unit test case 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" "Burakov, Anatoly" writes: > On 17-Apr-20 2:14 PM, Aaron Conole wrote: >> Initial IP fragmentation unit test. >> >> Signed-off-by: Aaron Conole >> --- > > > >> +=09if (!pkt_pool) >> +=09=09pkt_pool =3D rte_pktmbuf_pool_create("FRAG_MBUF_POOL", >> +=09=09=09=09=09=09 NUM_MBUFS, BURST, 0, >> +=09=09=09=09=09=09 RTE_MBUF_DEFAULT_BUF_SIZE, >> +=09=09=09=09=09=09 SOCKET_ID_ANY); >> +=09if (pkt_pool =3D=3D NULL) { >> +=09=09printf("%s: Error creating pkt mempool\n", __func__); >> +=09=09goto bad_setup; >> +=09} >> + >> +=09if (!direct_pool) >> +=09=09direct_pool =3D rte_pktmbuf_pool_create("FRAG_D_MBUF_POOL", >> +=09=09=09=09=09=09 NUM_MBUFS, BURST, 0, >> +=09=09=09=09=09=09 RTE_MBUF_DEFAULT_BUF_SIZE, >> +=09=09=09=09=09=09 SOCKET_ID_ANY); >> +=09if (!direct_pool) { >> +=09=09printf("%s: Error creating direct mempool\n", __func__); >> +=09=09goto bad_setup; >> +=09} >> + >> +=09if (!indirect_pool) >> +=09=09indirect_pool =3D rte_pktmbuf_pool_create("FRAG_I_MBUF_POOL", >> +=09=09=09=09=09=09=09NUM_MBUFS, BURST, 0, >> +=09=09=09=09=09=09=090, SOCKET_ID_ANY); >> +=09if (!indirect_pool) { >> +=09=09printf("%s: Error creating indirect mempool\n", __func__); >> +=09=09goto bad_setup; >> +=09} > > Nitpicking, but i believe the coding style guide discourages using > boolean syntax for anything other than boolean checks, and it is > better to use a more explicit `if (x =3D=3D NULL)`. I see, it does. Looking at the code-base, I see it mixed all over, some places using 'if (!ptr)' and others 'if (ptr =3D=3D NULL)'. Actually, even in the flow_filtering.rst doc, it implies that if (!ptr) is acceptable. Since I'm spinning a v6 with the constants, I'll fold this change in - maybe it makes sense to clean it up everywhere to help mitigate the confusion (for example, I most recently did work in the eal and the !ptr is all over there). WDYT?