From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [RFC PATCH 0/8] reduce header dependency on rte_mbuf.h Date: Mon, 04 May 2015 10:18:23 +0200 Message-ID: <55472B4F.8080507@6wind.com> References: <1429794237-9498-1-git-send-email-bruce.richardson@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: Bruce Richardson , dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1429794237-9498-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi Bruce, On 04/23/2015 03:03 PM, Bruce Richardson wrote: > A large number of our header files and libraries are dependent on one another, > which can lead to problems with circular dependencies if trying to tie some of > those libraries together, e.g. when prototyping with pktdev, or other schemes > to get a common API for ethdev/rings/KNI. :-) > > One small way to reduce issues when doing this is to eliminate #includes when > they are not needed. While most includes in our headers are necessary, one > common pattern seen is where a library just takes mbufs as part of it's API, > but does not de-reference those in the header file. In cases like this, it's > not necessary to include the whole mbuf header file just to allow pointers to > mbuf structures - a forward declaration of "struct rte_mbuf" will do. > Including the mbuf header file, also triggers inclusion of the mempool headers > which causes the inclusion of the ring headers amongst others. > > Therefore, I propose changing the header files for our libraries to just use > the forward declaration instead of the full header inclusion where possible. Series Acked-by: Olivier Matz