From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 5E8C25587 for ; Thu, 21 Jul 2016 18:46:26 +0200 (CEST) Received: from alille-653-1-293-182.w90-1.abo.wanadoo.fr ([90.1.53.182] helo=[192.168.1.13]) by mail.droids-corp.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1bQH9c-0007rE-Al; Thu, 21 Jul 2016 18:48:57 +0200 To: Don Provan , "Ananyev, Konstantin" , "dev@dpdk.org" , "yuanhan.liu@linux.intel.com" References: <1469088510-7552-1-git-send-email-olivier.matz@6wind.com> <1469088510-7552-5-git-send-email-olivier.matz@6wind.com> <2601191342CEEE43887BDE71AB97725836B804B3@irsmsx105.ger.corp.intel.com> Cc: "Chandran, Sugesh" , "Richardson, Bruce" , "Tan, Jianfeng" , "adrien.mazarguil@6wind.com" From: Olivier Matz Message-ID: Date: Thu, 21 Jul 2016 18:46:14 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 04/12] mbuf: add function to calculate a checksum X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2016 16:46:26 -0000 Dear Don, On 07/21/2016 06:26 PM, Don Provan wrote: >> -----Original Message----- >> From: Ananyev, Konstantin [mailto:konstantin.ananyev@intel.com] >> Sent: Thursday, July 21, 2016 3:51 AM >> Subject: Re: [dpdk-dev] [PATCH 04/12] mbuf: add function to calculate a >> checksum >> >> ... >>> + Added a new function ``rte_pktmbuf_cksum()`` to process the checksum >>> + of data embedded in an mbuf chain. >>> ... >>> +#include >> >> As a nit, do we need to introduce a dependency for librte_mbuf on librte_net? >> Might be better to put this functionality into librte_net? > > That's not a nit at all. This is clearly a net function that has no place in the mbuf code. > That should be obvious even before we notice this circular dependency. The function is called rte_pktmbuf_cksum(), and takes a mbuf as a parameter. You cannot haughtily say "it no place in the mbuf code". As you can see, librte_net only contains headers files. The initial goal of librte_net was to contain network headers and nothing more. See: http://dpdk.org/browse/dpdk/commit/lib/librte_net?id=af75078fece3615088e561357c1e97603e43a5fe To me, the question of having a dependency in one direction or another (librte_net needs librte_mbuf, or librte_mbuf needs librte_net) is an open debate. I've asked myself the same question when software packet type parsing, that needs definitions of network headers. As packet_type is a pure mbuf notion, my choice was to have this parse in mbuf library, and using network headers definitions provided by librte_net.