[dpdk-dev] [PATCH v1] Move rte_mbuf macros to common header file

Stephen Hemminger stephen at networkplumber.org
Fri Sep 25 01:25:37 CEST 2015


On Thu, 24 Sep 2015 15:50:41 -0700
Ravi Kerur <rkerur at gmail.com> wrote:

> Macros RTE_MBUF_DATA_DMA_ADDR and RTE_MBUF_DATA_DMA_ADDR_DEFAULT
> are defined in each PMD driver file. Move those macros into common
> lib/librte_mbuf/rte_mbuf.h file. All PMD drivers include rte_mbuf.h
> file directly/indirectly hence no additionl header file inclusion
> is necessary.
> 
> Compiled for:
>     > x86_64-native-linuxapp-clang
>     > x86_64-native-linuxapp-gcc
>     > i686-native-linuxapp-gcc
>     > x86_64-native-bsdapp-gcc
>     > x86_64-native-bsdapp-clang  
> 
> Tested on:
>     > x86_64 Ubuntu 14.04, testpmd and 'make test'
>     > FreeBSD 10.1, testpmd  
> 
> Signed-off-by: Ravi Kerur <rkerur at gmail.com>

I like the idea, should have been done long ago.

My only gripe is that you should do this as inline functions
rather than macros. Inline functions are type safe, macros are not.


More information about the dev mailing list