From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=A8n4Bda+1d+sA077mMt4h1RpdkRTE0rQEVRVYQ4L3l0=; b=W3+h2AhjCj+/MlH2Q6q00eYLQxeV22tQma6eDsWZgn2Ro4JEWjen80rdBHUPs2SR5nmoLLgTqhQEL3oKBIWmSxjoW5ckSXNT6zCes0I03Or1Hxm0YLAHu1BkQ/iYH6NYY6lk1sEytYPiRE+P4dFrytHkPhmckKlTbwxhsulhXso= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from localhost.localdomain (171.48.16.70) by BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Tue, 28 Feb 2017 11:57:25 +0000 Date: Tue, 28 Feb 2017 17:27:12 +0530 From: Jerin Jacob To: Allain Legacy Cc: ferruh.yigit@intel.com, dev@dpdk.org 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 Content-Disposition: inline In-Reply-To: <1488136143-116389-9-git-send-email-allain.legacy@windriver.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [171.48.16.70] X-ClientProxiedBy: MAXPR01CA0014.INDPRD01.PROD.OUTLOOK.COM (10.164.147.21) To BLUPR0701MB1713.namprd07.prod.outlook.com (10.163.85.14) X-MS-Office365-Filtering-Correlation-Id: 8973ae59-3341-4209-6dbe-08d45fd0f77e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 3:IVMcu5MTsrba771sUzwrv6cnvvSf8/OQ9cJCtH5Mo09BAroL9fyTWxb8sAP7g+bpr+mvT7PxRkBL59D7edJsf1JGIKSDpM49VBs1yyg7l5Yi2+w6O2F+5PfO2YTickb7zvdqS7ehDUXV1aWaGzFqQDq3Py3bkN9czY7kQRXsxjKMT6NtiszZUqvvit/LqCYss4GlBlmQBfoQSCbs4k/+t35hjOtoadAQSicHBF0UQjEaW4biAmoA0Ce3Jc0g5WW2C1YQSAjowhdlLQpCLIE9SA==; 25:cen2WGvHQdX+YzB1r7Aa7sNN9ODUuZhfUibEI2EBKXKeSuzK00cd5Zy1JXfyUo8c/k/+MF87OZfCztf1ojBvwjeiwWrAAqXQZibbDX0SYEYqYNdaHXjNNJvyj3/MCWsJ0RXwVNpAN0BlLNXwcQUvbYcVuzfgPnAaA0tyZFl0U/W4DKrtGwS2Qz5vcPpfC/si0xZcbLg7a7KTLYSf5JakPZvGwW4HNXqt8dnJXiwGKO1JR5gdvqBFGKZl4zI0lfmwHPJZhO+NZHCnn/Tk0bsoCCuUKLML9euhCz1Mefc7axlGntbPb/4nze4h/STlHYcayD1NrQZcuInuqECehpNpk/cFL85srwZlhUELNg2FxDxBRBuzrS37qhlcPxaQ6bTYhPi+CJwCWOYkbyRlyWtBIQY4e+S6aCrT7gnv0st8V1O2aYZ9I8Fnvgw0sqe4sTM5vYoeXlBioGomD2gM/QXVmg== X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 31:HEnygyzESJ7f59wj2wzfIcfWHNbBnfvEfWGMDTeDR7BDpwonPDWOJ2BsStfWH1c/fHUsGaHGpK47E4l+NsYpfyhiBRVT8Zjlegbcfseh4fmKCdttObdg/lm0fTseJXvXODic5Xjs+2Xjuil0gEK9vuWYntx4RsJE6yJhq/OF3q3NkF3RDKcteASWFTEwFeNusdOxafGisHnqGQtYVeKms+accmOy2h/kE0HrADVsDvmFI/OeES2Zluuv7v/f2EAAwzmHemSRpc/GZjBNMrRhYiRu8pw8L6bUg3NpTAM+Ueg=; 20:yTT5ylrI9KQFXWPI1ggEj/20fgDH7imMP2MlPvIGjOu+9A1U2XpkQkE96y5Y6pXZNkFbHJ9Uy+hE+4sDOozXVmB4X4/cHZR1Po3SL69oIhEjxgMXomoSz5dsrC7SSExtQ8fvWD6yYvHlshj2Ik3ptA+uFVMSH4VRqrc4ZtpYyz0cpHuPBCIPWOr1NoI+Xm6uWV0CyLmdPEPv5TH6xq34ftj/GJJGaohtvPCA6etTPyZ27J+U6C1plC7xWHf+Iy9DIG7mQB2aWlX18CfsVpiYdW2mj9w3j1iTCFwD8UdJCQlbUqFDq5BflT+eH1dK/qvSrBm/fIIwlU2/u9OJxmUOB0NmzHmpDMDPRaCEWRhUDZWxUEw4RJcibNYcSVsPZ4532Vh9wsWGLkFUnaYdZUkcwsXibES+OjpLGz/w6hbBymdm79bQ29qZETke9/k8F31Oy2QkdGzs5qshHDKD+wh1qPPzHs3/3Cip9A114lpc/FrUuguGtVOulz7QGvK1YObKmQZ0UnOLlFxTsA8qDPiR7q5ikZXIRT6CGaINlsA1Y9zgVTJbIv4m1ItVOhdwKvGBGaNaXPqoFkZ2aHG+a2ArSmHf/TrKhgcxGxzgBxffrwk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123558025)(20161123555025)(20161123560025)(20161123562025)(20161123564025)(6072148); SRVR:BLUPR0701MB1713; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1713; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 4:XsInhdCTmb2rJZ1nUZzxRbPV0JSYr1tF/op0i/WJpl5QmCiyuwSV1b2RucV4sHceXdrSKi8okN+JZBEYLlH+xmaBlhMH6pI0nos4Jzqlmg4SBzQmrO8J8yLEJbr+O455kiwmPLyEmMyZKnRNJys+buDD8rssYetpT3OLIyUHEcKdAQEppRQTaI7CFmuZpK59LSe8ITEYxAvi2sS7zQuiz25rmwqg66X8dzHMFn7n4BRcstR0DEl3xrivvUDQnTw4LeSk8+reEaHJduOPozHxSmKlGqvAjUkxq14nG1gs2Cx66dheCMD2iaCe9lOA7j6+mjygOqBKQkfKwDk5gvBs4nEqyn9LYLUi2BcPSQw6VyTLR2ZJQY+pSQ9//VdntJqQ4HZd2Qo1spu168c3iGq+VXzufMqWDmm97kxK06ZFWL3akzixL9fLH2XfDN6LE7Y41/AXR4mWFBlkhi+HAhDCMdU3I+FOmrgrkudXKnonYAZwF2Jd/Qlm4wdxokMbjnsytbcmX1AL4oYifG5QSiaEoAFZEazQYrlrblTl5/4BUkHWGojCOx4BX4jwhmNddoRfrQKGO2bn3C9UPKG70afWmFEHJCm6tiSwXOgdn+8uFwA= X-Forefront-PRVS: 0232B30BBC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(39450400003)(24454002)(189002)(199003)(4001350100001)(8676002)(25786008)(5890100001)(101416001)(47776003)(81166006)(81156014)(92566002)(97736004)(6506006)(9686003)(55016002)(38730400002)(110136004)(6246003)(53936002)(1076002)(33656002)(23726003)(2950100002)(6916009)(42882006)(42186005)(106356001)(105586002)(61506002)(68736007)(7736002)(6666003)(189998001)(2906002)(76176999)(83506001)(305945005)(50986999)(54356999)(66066001)(229853002)(6116002)(5660300001)(3846002)(50466002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1713; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1713; 23:UfKT3oFzfr5Pb4u0fdk/3GXrE82RCdFNUtTgDrP?= =?us-ascii?Q?31ffCiCGCxs6F/dQOb5+UZcHD0jeTzyiOThBGXR2qutc+rwHcaQRfnMlzYzp?= =?us-ascii?Q?s5MdZvB94tmrfokyqm/AGwj0/2WP12CgQX20TRQRRMwEt6FDnfLZYkf09o1C?= =?us-ascii?Q?rlldMmI8MUoplEI7A9Y10To3kCac+USuFJWdmYOG6/6j3B9bm7a0jY3kjY+A?= =?us-ascii?Q?XPq9cgVL0QFlkiTUY+wGLBaAKt48rQjO8pS7x+c2UGJNm3GWmbpFbN9TgWz0?= =?us-ascii?Q?14OWzsltScwNFCGcseJmtApkJcJarC/vA1RD8fcenIbTi+OJ7cTR7/7r5Ps8?= =?us-ascii?Q?1fZAxRSifB69FvyZHQDY8Ybwxpok/0bb89eC9+3/V4lHyAACe6UxP4VuVW+p?= =?us-ascii?Q?tx3Px00DLx+CoCJ7ycL9x/Srq+twqdJG8q1ElGEE0I4LRmsJCwrlPxMuebFP?= =?us-ascii?Q?dBRM0p+CwqPYDP2iFL4/dWdYCzQfrlj3hX8mTQA+rpZbLgRt5G+2rxatGNgH?= =?us-ascii?Q?sOTXPYlzJUSL2X1dcUolu2UExS53D+QaPWOxCU2Tswxc8u814gmkABR7N43m?= =?us-ascii?Q?Otw93OfdjEpEi6v9GtMrIX/lSV9yiKnGRNmnwjadQ5Qfk1UlKkV5Fn+brZcT?= =?us-ascii?Q?hOxa3AC860fCiKd2ibtUsuIaHpEFb0xPYUaLgoDlT7GWK9iOUGVeVhwBsktm?= =?us-ascii?Q?RA5Q5EfktYHtBQjEYHBVxoZyPTTwjDOGa3abzuCr/eYPHVgpQAd7gv0J3w/Z?= =?us-ascii?Q?WTjj24rVaXrlKfUyNLSOMQKgFIFhXOq3aqbW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/yJ92DMvbzHQDqb1HyD5tced2H+deU94+eDa260UriwpUrlQB5b/Z6u6btaSwaH8FZu1R0csLLNJuWlXWVSmOKyARTF0DVoUEn2O+fvfojvPu0G0u9Q==; 24:dEDZYKDx2i6ZT8jmyBQYBkE6ZE7gHjvu05WZMEHP0Kw2jPkn1GFhMrsedwkoQwzlSBMC5Q69Fh8XSDDZqariDkipW2a1JPTfYkcMwf0wa5I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1713; 7:ncWpFFK2zFVfSjRCN+eX0pHALL0t8AUWRoJR5rHoXFhf+112c8DmbfkA5FV7d2gi/0AeXKISGRfJwD0tdXiIrBvA/ZMoANCkcusDYEejsM6EhD8pCGZH+WQwT8Lq3jnCGG+lH/FhKr/+dcPNBk/lDualhVg3b1jhKEhCFl5JGc2qaJSPJ6oqYmpOe7hX40Is10yi8dqdpgGDQ2orHZ+K2ZCdCfY5F6WA4ZZZz11J1Hfvtb5TUgqYw68Uq7FWeitPGn62hzJ9ebdWHobEApVn6DhfeubZU8Wni7zQ9+b8SBEgtMrOTbgQLSISNxKOvOVPKbubVRqDUNRwy6AMjFfN0Q== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2017 11:57:25.2425 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1713 Subject: Re: [dpdk-dev] [PATCH v2 08/15] net/avp: device initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2017 11:57:30 -0000 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 > + */