From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [RFC PATCH 0/8] reduce header dependency on rte_mbuf.h Date: Mon, 11 May 2015 15:34:57 +0200 Message-ID: <7341132.VBipIkNxS3@xps13> References: <1429794237-9498-1-git-send-email-bruce.richardson@intel.com> <55472B4F.8080507@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org To: Bruce Richardson Return-path: Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 76874C41A for ; Mon, 11 May 2015 15:35:39 +0200 (CEST) Received: by wgbhc8 with SMTP id hc8so28140924wgb.2 for ; Mon, 11 May 2015 06:35:39 -0700 (PDT) In-Reply-To: <55472B4F.8080507@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > > 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 Applied, thanks