Dear Don, On 07/21/2016 06:26 PM, Don Provan wrote: >> -----Original Message----- >> From: Ananyev, Konstantin [mailto:konstantin.ananyev at 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 <rte_ip.h> >> >> 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.