From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v2 08/15] net/avp: device initialization Date: Tue, 28 Feb 2017 17:27:12 +0530 Message-ID: <20170228115711.GB29607@localhost.localdomain> References: <1487985795-136044-1-git-send-email-allain.legacy@windriver.com> <1488136143-116389-1-git-send-email-allain.legacy@windriver.com> <1488136143-116389-9-git-send-email-allain.legacy@windriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: ferruh.yigit@intel.com, dev@dpdk.org To: Allain Legacy Return-path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0057.outbound.protection.outlook.com [104.47.32.57]) by dpdk.org (Postfix) with ESMTP id AEF7039EA for ; Tue, 28 Feb 2017 12:57:29 +0100 (CET) Content-Disposition: inline In-Reply-To: <1488136143-116389-9-git-send-email-allain.legacy@windriver.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > Signed-off-by: Matt Peters > --- > 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 > + */