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 CF5ACC62C for ; Mon, 4 May 2015 10:18:33 +0200 (CEST) Received: from was59-1-82-226-113-214.fbx.proxad.net ([82.226.113.214] helo=[192.168.0.10]) by mail.droids-corp.org with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YpBeS-0004uz-Ob; Mon, 04 May 2015 10:22:59 +0200 Message-ID: <55472B4F.8080507@6wind.com> Date: Mon, 04 May 2015 10:18:23 +0200 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0 MIME-Version: 1.0 To: Bruce Richardson , dev@dpdk.org References: <1429794237-9498-1-git-send-email-bruce.richardson@intel.com> In-Reply-To: <1429794237-9498-1-git-send-email-bruce.richardson@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC PATCH 0/8] reduce header dependency on rte_mbuf.h 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: Mon, 04 May 2015 08:18:34 -0000 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