[dpdk-dev] [PATCH v3] Move rte_mbuf macros to common header file
Stephen Hemminger
stephen at networkplumber.org
Thu Oct 1 00:13:08 CEST 2015
On Wed, 30 Sep 2015 14:55:03 -0700
Ravi Kerur <rkerur at gmail.com> wrote:
> +static inline uint64_t rte_mbuf_data_dma_addr(struct rte_mbuf *mb)
> +{
> + return ((uint64_t)((mb)->buf_physaddr + (mb)->data_off));
> +}
> +
> +static inline uint64_t rte_mbuf_data_dma_addr_default(struct rte_mbuf *mb)
> +{
> + return ((uint64_t)((mb)->buf_physaddr + RTE_PKTMBUF_HEADROOM));
> +}
> +
Some nits:
* extra () on return is an unnecessary BSDism
* cast to (uint64_t) is probably not needed since C does that anyway.
* functions should take "const struct rte_mbuf *" since they don't modify it.
More information about the dev
mailing list