[dpdk-dev] [PATCH v3 2/9] ethdev: Helper to convert to struct rte_pci_device

Stephen Hemminger stephen at networkplumber.org
Tue Dec 20 16:38:59 CET 2016


On Tue, 20 Dec 2016 12:11:48 +0100
Jan Blunck <jblunck at infradead.org> wrote:

> Signed-off-by: Jan Blunck <jblunck at infradead.org>
> Acked-by: Shreyansh Jain <shreyansh.jain at nxp.com>
> ---
>  lib/librte_ether/rte_ethdev.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 9678179..3adbb2b 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -1644,6 +1644,12 @@ struct rte_eth_dev {
>  	uint8_t attached; /**< Flag indicating the port is attached */
>  } __rte_cache_aligned;
>  
> +/**
> + * @internal
> + * Helper for drivers that need to convert from rte_eth_dev to rte_pci_device.
> + */
> +#define ETH_DEV_PCI_DEV(ptr) ((ptr)->pci_dev)
> +
>  struct rte_eth_dev_sriov {
>  	uint8_t active;               /**< SRIOV is active with 16, 32 or 64 pools */
>  	uint8_t nb_q_per_pool;        /**< rx queue number per pool */

An inline might be better than macro, since a function is typed
versus a macro.


More information about the dev mailing list