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 A1F10A0561; Mon, 20 Apr 2020 18:03:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4CBF41D6C7; Mon, 20 Apr 2020 18:03:52 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 2FDBE1D5BA for ; Mon, 20 Apr 2020 18:03:50 +0200 (CEST) IronPort-SDR: ntQaFn2aMUzPbWdDhq4wJGLznmL/mHJzArI2jHDbwAB7AWo1TknrJsASPk7CPbT5RwABH17Oa0 5U7RogwdFGLg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2020 09:03:48 -0700 IronPort-SDR: yL8XrSovyzEeDszHhVsyiMVf+jX1+/QSUw/G7twCehitKVe+ah09HhXrUbsYcBi3cK1jaWAIkQ ippicmCy/Wmg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,407,1580803200"; d="scan'208";a="246931035" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.193.28]) ([10.213.193.28]) by fmsmga008.fm.intel.com with ESMTP; 20 Apr 2020 09:03:44 -0700 To: Aaron Conole , dev@dpdk.org Cc: 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> From: "Burakov, Anatoly" Message-ID: Date: Mon, 20 Apr 2020 17:03:43 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200417131410.1343135-4-aconole@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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" On 17-Apr-20 2:14 PM, Aaron Conole wrote: > Initial IP fragmentation unit test. > > Signed-off-by: Aaron Conole > --- > + if (!pkt_pool) > + pkt_pool = rte_pktmbuf_pool_create("FRAG_MBUF_POOL", > + NUM_MBUFS, BURST, 0, > + RTE_MBUF_DEFAULT_BUF_SIZE, > + SOCKET_ID_ANY); > + if (pkt_pool == NULL) { > + printf("%s: Error creating pkt mempool\n", __func__); > + goto bad_setup; > + } > + > + if (!direct_pool) > + direct_pool = rte_pktmbuf_pool_create("FRAG_D_MBUF_POOL", > + NUM_MBUFS, BURST, 0, > + RTE_MBUF_DEFAULT_BUF_SIZE, > + SOCKET_ID_ANY); > + if (!direct_pool) { > + printf("%s: Error creating direct mempool\n", __func__); > + goto bad_setup; > + } > + > + if (!indirect_pool) > + indirect_pool = rte_pktmbuf_pool_create("FRAG_I_MBUF_POOL", > + NUM_MBUFS, BURST, 0, > + 0, SOCKET_ID_ANY); > + if (!indirect_pool) { > + printf("%s: Error creating indirect mempool\n", __func__); > + goto bad_setup; > + } 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 == NULL)`. -- Thanks, Anatoly