From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH 07/13] mbuf: use macros only to access the mbuf metadata Date: Wed, 10 Sep 2014 17:31:08 +0200 Message-ID: <54106EBC.6040206@6wind.com> References: <1409759378-10113-1-git-send-email-bruce.richardson@intel.com> <1409759378-10113-8-git-send-email-bruce.richardson@intel.com> <540D9B95.3020504@6wind.com> <20140910150914.GA9656@BRICHA3-MOBL> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Bruce Richardson Return-path: In-Reply-To: <20140910150914.GA9656@BRICHA3-MOBL> 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 09/10/2014 05:09 PM, Bruce Richardson wrote: >> Just one question: why not removing RTE_MBUF_METADATA*() macros? >> I'd just provide one macro that gives a (void*) to the first byte >> after the mbuf structure. >> >> The format of the metadata is up to the application, that usually >> casts (m + 1) into a private structure, making the macros not very >> useful. I suggest to move these macros outside rte_mbuf.h, in the >> application-specific or library-specific header, what do you think? >> > > Things look to work if I just move the definitions en-masse into > rte_port.h. Is that the sort of change you would be thinking of? > I was wondering about replacing the typed macros here with a > generic one to access just beyond the definition of the mbuf > structure, but on further thought, I believe that using the > buf_addr pointer in the mbuf data structure is probably enough > for most applications. [An alternative to moving the definitions > into rte_port.h is to move them into rte_table.h and having > port_frag.c use the buf_addr pointer instead of a macro to get at > the metadata. All other references to the macros apart from two > in that port file, are in the tables or in apps that use the > tables lib.] > What do you think? Yes, moving the macros in rte_port.h looks good to me, since the libraries using rte_ports are the users of this specific metadata format. Thanks! Olivier