[dpdk-dev] [PATCH v2 08/15] net/avp: device initialization

Jerin Jacob jerin.jacob at caviumnetworks.com
Tue Feb 28 12:57:12 CET 2017


On Sun, Feb 26, 2017 at 02:08:56PM -0500, Allain Legacy wrote:
> Adds support for initialization newly probed AVP PCI devices.  Initial
> queue translations are setup in preparation for device configuration.
> 
> Signed-off-by: Allain Legacy <allain.legacy at windriver.com>
> Signed-off-by: Matt Peters <matt.peters at windriver.com>
> ---
>  drivers/net/avp/avp_ethdev.c | 757 +++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 757 insertions(+)
> 
> diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
> index 6522555..3bbff33 100644
> --- a/drivers/net/avp/avp_ethdev.c
> +++ b/drivers/net/avp/avp_ethdev.c
> @@ -60,6 +60,8 @@
>  #include "avp_logs.h"
>  
>  
> +static int avp_dev_create(struct rte_pci_device *pci_dev,
> +			  struct rte_eth_dev *eth_dev);
>  
>  static int eth_avp_dev_init(struct rte_eth_dev *eth_dev);
>  static int eth_avp_dev_uninit(struct rte_eth_dev *eth_dev);
> @@ -103,6 +105,16 @@
>  };
>  
>  
> +/**@{ AVP device flags */
> +#define RTE_AVP_F_PROMISC (1 << 1)
> +#define RTE_AVP_F_CONFIGURED (1 << 2)
> +#define RTE_AVP_F_LINKUP (1 << 3)
> +#define RTE_AVP_F_DETACHED (1 << 4)
> +/**@} */
> +
> +/* Ethernet device validation marker */
> +#define RTE_AVP_ETHDEV_MAGIC 0x92972862

I think, we don't need to add RTE_ for internal flags and PMD APIs etc.
> +
>  /*
>   * Defines the AVP device attributes which are attached to an RTE ethernet
>   * device
> @@ -150,11 +162,726 @@ struct avp_adapter {
>  	struct avp_dev avp;
>  } __rte_cache_aligned;
>  
> +
> +/* 32-bit MMIO register write */
> +#define RTE_AVP_WRITE32(_value, _addr) ((*(uint32_t *)_addr) = (_value))
> +
> +/* 32-bit MMIO register read */
> +#define RTE_AVP_READ32(_addr) (*(uint32_t *)(_addr))

Use rte_write32 and rte_read32 API instead.

> +
>  /* Macro to cast the ethernet device private data to a AVP object */
>  #define RTE_AVP_DEV_PRIVATE_TO_HW(adapter) \
>  	(&((struct avp_adapter *)adapter)->avp)
>  
>  /*
> + * Defines the structure of a AVP device queue for the purpose of handling the
> + * receive and transmit burst callback functions
> + */


More information about the dev mailing list