From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0042.outbound.protection.outlook.com [104.47.33.42]) by dpdk.org (Postfix) with ESMTP id 120FDF97F for ; Mon, 19 Dec 2016 16:28:27 +0100 (CET) Received: from BN6PR03CA0001.namprd03.prod.outlook.com (10.168.230.139) by CY4PR03MB2469.namprd03.prod.outlook.com (10.168.163.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14; Mon, 19 Dec 2016 15:28:26 +0000 Received: from BL2FFO11FD007.protection.gbl (2a01:111:f400:7c09::139) by BN6PR03CA0001.outlook.office365.com (2603:10b6:404:23::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.789.14 via Frontend Transport; Mon, 19 Dec 2016 15:28:25 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD007.mail.protection.outlook.com (10.173.161.3) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.789.10 via Frontend Transport; Mon, 19 Dec 2016 15:28:25 +0000 Received: from [127.0.0.1] ([10.232.133.65]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBJFSJ2n031723; Mon, 19 Dec 2016 08:28:22 -0700 To: Ferruh Yigit , References: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> <1480875447-23680-20-git-send-email-hemant.agrawal@nxp.com> <1b3c3956-d2d8-e6b4-b058-369dca9fa63a@intel.com> CC: , , From: Hemant Agrawal Message-ID: Date: Mon, 19 Dec 2016 20:58:18 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1b3c3956-d2d8-e6b4-b058-369dca9fa63a@intel.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131266349052736638; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39840400002)(39380400002)(39850400002)(39450400003)(39410400002)(39860400002)(39400400002)(2980300002)(1110001)(1109001)(339900001)(3190300001)(24454002)(199003)(189002)(377454003)(36756003)(4001350100001)(2906002)(64126003)(230700001)(81166006)(8936002)(92566002)(104016004)(8676002)(81156014)(54356999)(83506001)(120886001)(305945005)(50986999)(85426001)(76176999)(4326007)(189998001)(229853002)(97736004)(5001770100001)(69596002)(8666005)(356003)(38730400001)(33646002)(105606002)(626004)(65806001)(77096006)(6666003)(31696002)(2950100002)(7246003)(7126002)(47776003)(106466001)(65826007)(50466002)(68736007)(65956001)(86362001)(5660300001)(31686004)(23746002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2469; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD007; 1:EJIdNNoUgIqODH/onFRQpJPsHJNnxoogEfbPwidYyzV3sSyO2yyEfVmBao4HP2bH13XlwvLIYoCHLb6U19+ql3IDkUDy+leDYPsHIglgOUJD6PL3ABAmCxjUSsUrMocZ3aEVPqR2sawGMv8wLBI5H9DdphSveY/yL1nE+3vmPNAca3ox2sxA63aa6nDR5XKM8nYo7IlvPan2RtQ+sMFrEdJw7a0U+wdjwvamdm4XbkRG4Q0tJNjr5fkHC2aSwSBKRN8DLQMxVqvUlTlibMkdpcGAvgsUMx1qP1HHMHij7/cQaHxyDOxD7VKIiwFe0covCQCOCqPV82vpD1rt6GsEQ8N24tieTO834XAdOGbrE/TDNOP6ZLjuTEiglrxAjDbcmA1ZXUBemLH2MsfarlCBoFsJAS4AYUz2Xf1/O5FL4M0kz2lmRvhGwg4lyha1qtciFeaS4Tz75Z6C1S5P+CjW9nF8DzMLWHktzZmMYRdgjj2UuM6S6RVvuUdzDaVCYQ8QhLoe9ouNw7UkDVAwRVJM8H9scHJfrIzKTkFEowE9Ii23L6XDeF1lFuCdVqojdsrz2ruUt2rq9XUuLLtf3H7IL+qous4IhcAgFyzKeeRPQJcsSBbnjwXBwY9l2XEdttp5Iwab+umnukmmI0epMsISNunTNj6GobvSiOJTxpwCQTE= X-MS-Office365-Filtering-Correlation-Id: afc18afb-a585-4145-347e-08d42823acb7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR03MB2469; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2469; 3:94TpBAjja7B0Di7wUhjRYZBdeYFneLUi5SO7qlW0esL0W9ljpQo58oPAzFI+pNEwqS/pjyyhyZNM6/C3dzkIv5mn+7UgI/AVUveQirhhx4i7Z/QBZe1ftRC9U2cQlGx5jYUiAPWzGz/tNmm+k5C29MilmytNpF8pjJ8XbUPHMjj4UFp9eq6T885mxb0JeztfH4qj6WCKNqB1UVeebcs7ZbsmhMTpwqL3G2OzCQi57Td8hKOH1Uthk4GE9/Nbr/gAlYpF8z8Zb4Q7f+Be8dfg4Go1ezh8qyCig6oPZZIMRYq11zslEsj8NQBpyqOOKDSc7saEYs8Q9o0DawWjHv5JMxHElUWgk8hQPF3RkJX56VGGLrbKJ/oEqKpjURk95HzG; 25:4KhU8NujeM8B3tp6/cBrA/IRzpDAczuN8nAPjuTiH1ptJlMtuP+DU446hewhyi/FzW33q6L0JywSrVurDCTgP1FHNl6sweJCMTEQyPABQGA4MoDU99yc07sAcDbu/E6pFtVKoCYyMp7v+Dx8nMsgFSlLhSTSmK+UMdusvwN28dCULjxHBKa9HeP6CG7m+1MD0jFKWutr/fO3FHaMCUXAmlraI0NXxZ/e6PWl/C3AlZIiAKSQ+SQhzjkA2aidPeTPUNVlrHJb+FqVgL3ziekmyrUVTE/j2hSd5vz11WYtdiRYGLXk0PD7cb6UMx5iCeq/AKx1mmVoZOF5Ty07KTD50BVV0J7Nbr/6cMgRjUBxnVb2+qePp/1fcPwXCzK3R2EWC//7meLoCjY4VBMwCgdE03R9lOPoYTatv+HDYizBXnu4B0R5lNYt1kGPHxv1oa3H5zHeN0G0sYDo08Hra6ChHg== X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2469; 31:H2i4GQ+mvhmtLT2HvcKLj6ohw/2SkYV0/J5BOYMYFyBlXAmmT5NLOoLU2l1o9Q7MebwxJ+SbyMsdTMvTZUXAOVcsHLahNB14Mznp8eSEFZuZc7LwHtvojWHWA0Z/DTbHrmrZ5a3ermuMdYrYVk0MdZNhtAZcfLKdEqqOjYWzBeXZtclCY3089CewANtRFljsfggpJSLbhEr+FulLalOC69IKcZC76aXNYIU8zXCsclWh0IDGjwp02WC1TCGNSVER0lvOYKjhnMpaewRBDlRlpACPKiHbpuT3GRhfgsjFIEg= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(8121501046)(13018025)(13024025)(13023025)(13015025)(13017025)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123561025)(20161123556025)(20161123563025)(20161123559025); SRVR:CY4PR03MB2469; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2469; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2469; 4:WaNjcS8aOPq6KBqF9v0oh+eZH58XtW/p1K4jVaMAjjAiPCz3RrhAgIVGF7ungonjDceJUH7hFis7AQdg0mMAG7DCioWCM+OEGyUOyTsglxqjRKIU1Sa21emV2ogIDLe9xfGjeOfiLxHxTlsR0PJwxEuALJIe4Rm/xCoEslbR45Dl2oNd9FWU4P9ohRZwl3AspopaAm3XJoG4ih0MXESmn88AGyBQcFbBDS9q6P5DcZAnN75Er0OeeNTcANqvGQsiZnzFW/UxjxzBeiqJxy9qi/dgTGomGVmwH1Xy6WBZxS75Ge89c7kMS+Cq5/h9xP00mryQfOX0rEG3kAxSJ+VfXhpBAgQhtQ8l2KzJYD49hzp3ujhPA4j43IzlkZKwB1LO8dU/3M3fn1ZWOhuv9qD41sEq4tDodIXQW/GOSsOHoAwfH+zOW2C5cxk+4NY09MM9GsMbHOCg4KFk5nVWQPJSy8gPyog5GIed877kh05gK9tK95h4H8jwrZsQ/ov2nu9IqIwqo7rFT7mzYm6wOseB7B/Og5NKro7t0xQVIYx+5k/6ZzObMS83GfXnKy2/IMj4BxO21XYUScOU601II5lrJHWZVQWwCjhMebEjbjH1Brb385lYpxcWl9xTAVu6SXs4trnUdPFBGdUwXguq6CgDjmrS8d8V79MH42u/Bp8xekO3ANyrOK1xAKyXlDHqPkrGFE0Ch6uSEdzPiaGrY0fL7vc688igRMLvIwwVnrqwFkafLAgepJOEntpZNUdtgZjL X-Forefront-PRVS: 01613DFDC8 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY4PR03MB2469; 23:7ctmIkqKqhIxDtjMnx5pwJEU8n5OCX+KebK+y?= =?Windows-1252?Q?Q675fzZiXb+OzchTpaMjuiF48KW7x2eBM3GlXleSRrCUFTRVC8kUoXio?= =?Windows-1252?Q?72+Xo0ykfMxIJfUG61B3fcQg6YvfF1q9nwyuthuBNMKYyJCoZ9ntFy8r?= =?Windows-1252?Q?0OQ2j1K5onmPQuPLajojikEBi9fsksrBd8xhNPStgmEtUCiizfKgR0ua?= =?Windows-1252?Q?HtlML3qFe7W8Nn2bto6bSHhttQxhgfIWZwb/tjYQuWaGkiber26ZF1Mc?= =?Windows-1252?Q?oZ20AyyUIMTfCi/iOzNHmNmFEfyBa0rFdw3vZ80CSZBtZJOQH9HSHHoY?= =?Windows-1252?Q?SQv/vEgOVb9JhDJ2W+M2+vj/CQvN+q5ci0QFbpMsaYESI/1b6suEjcd9?= =?Windows-1252?Q?GTEwbOpRsBJ5YuoukLqbpmo8DxYPPiNug8QKRAlO6mKw9rZdPixJAwNf?= =?Windows-1252?Q?zNhhblLew/5rNoiMFlZiwVa+oi2i+O0oJkHIgysQfGs6EgBU/T9z7fjK?= =?Windows-1252?Q?xhS/6FTauuIhu9dNIgtzGjR6DzhlqaHWYNL8wSWIqIUVSvLM+sdfwATJ?= =?Windows-1252?Q?vfsCFR03KK3nxnlNMVufEDIVTZuK0YnK6wnR1MQQaS5DBclb2wSLcZtk?= =?Windows-1252?Q?lq5RMOiZ5nRehbvgRuq/5M7j4QZret8HFkhF5RbhvwsXA1794TVSMEVH?= =?Windows-1252?Q?HXQIi/5dI/kDftg3qCtuCCCDPQbQkO0039x6Eg5lNScSCgrexCBabIlf?= =?Windows-1252?Q?MtvwhqUU5TvfPF9XFGCMrohvJn+u+c6mdOziIzfnWVCNELFQITbiYw0M?= =?Windows-1252?Q?WULRFurhRBgosypA4pW9ui2x7t3dACNf3E5wqaZ9t6KnWoNhDsdY/lbW?= =?Windows-1252?Q?zcE+cyROBDFL9AmE4wPAl/xvyO86IYIt4lR9TvydbQaWxzqd3/Qe8K/Z?= =?Windows-1252?Q?O6gaaHcWJ9qjJ3G68oIoIR7u5fmOdoRj278DPITwYaSEHqP/VLNKc2fv?= =?Windows-1252?Q?fAJR/G7lbU20Ge5k15rkKsKi93tzwG7mN4y/VKNVkZZ5PAtPnFuKoY1d?= =?Windows-1252?Q?yK1cqtOrPhgVsPEKTK3SO+TJ0vfkdA0IPTWVizx9e2ZlQpJJfQj5LSeZ?= =?Windows-1252?Q?+N9dnqwBnJ5cbzcpz2z5ubfJqknoodkC8m7ZWOU5lQjuMVNm1pxAHne3?= =?Windows-1252?Q?czfZhZ1uZpM2+lSXTmuDWoWipzQ0D/QtIfwrzINVo2wa6B9npUvnC5Pl?= =?Windows-1252?Q?e/1SkJ+/mmStCsuvnPsXJQC60U4LnIj97uYJyxEDZIILgxyyAipu8yGd?= =?Windows-1252?Q?MGDjs2kKeod56uuywlXSleeFkZ5fbN2S/m14OzlxbIgSoyyGs+U1DOSo?= =?Windows-1252?Q?VMOP2eqtjC0xk9o7SQbIiP8q4kF0wVsScMW0UjTBjjDLlVMuxI2vxhNP?= =?Windows-1252?Q?n5fNcH5NSGlhrvp8zVn8+6Xgm5zvogTeUZ2JhJXXN8NKk9MFtWSh8whO?= =?Windows-1252?Q?xrIFfDMTAPARTo0jz926jx2znEBnSVxjzFrDvC2JRbiccqHj2tmhheYn?= =?Windows-1252?Q?DYJGgNXag3JiKQu7+S5jN9GowI02l5NXj4VNyLA1q1bRzY7Tk6+U5O/n?= =?Windows-1252?Q?CMuFvw2R9lXvebzObe5JzdWfBXdPWqbeE7ZVtcB6sfC5vqPZy7Gbcal3?= =?Windows-1252?Q?mLltkgLb9tKTiidEoWq3jv8qhSUr4J3u7/9qoHmaayEJ0sout6Q9ECyK?= =?Windows-1252?Q?mhUXsSop/ucOtJPhA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2469; 6:wJDAaf6CTA9dUwF8IbLxcSC6UFWZkWlfZahmqx9HD6FejRbvYX0SmI3GH3dqDrKoOQbxa24KRxsOYquwz9rV0p40cnu0N2OomDWMSCj2fc3i+uumdO2T6IxaXyoQjxyb+UxBx9vc+yBugJP8rPcYWPC7cZhga3Y+QDLUQkBQb4TmOjAsjC37COycUJK9T4XDAXjvvceGbHmHt+bXEKZo0Dji2ulmHd3OxEOv3JPJuVigy6NMcX4Xx2AcZifulKfVX3YZVeqqpifX/l9he+uwr+MtOBSCS5OnbRgTNa+FBCixaDq6gge6ujRK2S3fNPk/tv9f0Y5iWTCq/AesJE+dufBSC0V/c7f0QsgI6i2PKiSLpwc+0M69kuLRWnXCd0RDJK9YS+yAljuzPlta0+3zkAXFeevdDuNiQoj1fNZWhp80eU7x6zEspzzu5tqhlfXj; 5:0n8WTcg4ekcozj+RKdCbnk/wnQnmri5+ukCosqfqKE4Dim488GqFqiWeTs8S7ViDH5XaYTxc1/qFEb4omEkd2LujtnveNhC7VaRO+jM+dnW3Dx3ds4EZegsZ24/S3NB7uPU7vfuttPLlEmbWeNnmPDJzmKPsX4CsjIY435kPldVFv9KQzNthZNokaWWZMPYt; 24:ZQrzP6ruSpV4DAtyGQSU/rlcfEnPQTTvGlv3gZu3wp9GkZexCVrrhAc2/NIk5Sy6RHb/m0kenyEl9wz2QbnkWrCY5CoOcsYFy9MYBuOif78= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2469; 7:xxTZnRyNxJ3JVLwaNy2mh9MoVDai8X3f74lrcGnEXca8P54LdJEtN9BTeIqdcUlDNX65EM+VRZnwFJeBMjw4r4CLWmFykkJe/BKUK1NOWAHqWSwjoodZ2hERPeNZnySBHOrnUSpUZL9/SXf/7A4/kwn0uNGILfXHoHTSBDHcWw0KyR/okwCr8V/0dF1qF4ptQDMkOmCzWeMLRFJ5qV053yj7IdemeRixt9fa+o/xUkyaFZyyohkec7jA1FSKe5fNxIWZETZlBBsAOIW7wAvp2GpvVfZC3//6P/NwDks+Z8rYMr6b2yXRlOJWcxdAYhc0p50+qqSCq2LHy500ovenuCYbsUjkmsRw6t9ZKEk89xrdFwDgubOlZj5zLYQpfRw26r4jQrvi3R3dXatg+Z4KJnw/HnQ5zVXqa5pTvJuI24/l3o119KWqrLAdeIa/GhSgicmFaaO4rrwJj4CD2t0tnA== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2016 15:28:25.0552 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2469 Subject: Re: [dpdk-dev] [PATCH 19/32] net/dpaa2: adding eth ops to dpaa2 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: Mon, 19 Dec 2016 15:28:27 -0000 On 12/7/2016 1:19 AM, Ferruh Yigit wrote: > On 12/4/2016 6:17 PM, Hemant Agrawal wrote: >> Signed-off-by: Hemant Agrawal >> --- >> drivers/net/dpaa2/base/dpaa2_hw_dpni.h | 50 +++++++++++++ >> drivers/net/dpaa2/dpaa2_ethdev.c | 130 ++++++++++++++++++++++++++++++++- >> 2 files changed, 179 insertions(+), 1 deletion(-) >> create mode 100644 drivers/net/dpaa2/base/dpaa2_hw_dpni.h >> >> diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.h b/drivers/net/dpaa2/base/dpaa2_hw_dpni.h >> new file mode 100644 >> index 0000000..1b655e4 >> --- /dev/null >> +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.h >> @@ -0,0 +1,50 @@ >> +/*- >> + * BSD LICENSE >> + * >> + * Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. >> + * Copyright (c) 2016 NXP. All rights reserved. >> + * >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions >> + * are met: >> + * >> + * * Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer. >> + * * Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in >> + * the documentation and/or other materials provided with the >> + * distribution. >> + * * Neither the name of Freescale Semiconductor, Inc nor the names of its >> + * contributors may be used to endorse or promote products derived >> + * from this software without specific prior written permission. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT >> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >> + */ >> + >> +#ifndef _DPAA2_HW_DPNI_H_ >> +#define _DPAA2_HW_DPNI_H_ >> + >> +#include >> +#include >> +/*! Global MCP list */ >> +extern void *(*mcp_ptr_list); > > extern keyword not needed. > >> + >> + >> +struct dpaa2_dev_priv { > > Any reason this is not in dpaa2_ethdev.h but in a new header file, since > this looks like ethernet device private data. Just asking. > I agree, I have taken care of it in v2. >> + void *hw; >> + int32_t hw_id; >> + uint16_t token; >> + >> + uint8_t flags; /*dpaa2 config flags */ >> +}; >> +#endif /* _DPAA2_DPNI_H_ */ >> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c >> index 17dfff6..daf59c1 100644 >> --- a/drivers/net/dpaa2/dpaa2_ethdev.c >> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c >> @@ -43,12 +43,140 @@ >> #include >> #include >> #include >> +#include >> >> +#include >> +#include >> /* DPDK Interfaces */ >> #include >> >> +static int >> +dpaa2_eth_dev_configure(struct rte_eth_dev *dev) >> +{ >> + struct rte_eth_dev_data *data = dev->data; >> + struct rte_eth_conf *eth_conf = &data->dev_conf; >> + >> + PMD_INIT_FUNC_TRACE(); >> + >> + /* Check for correct configuration */ >> + if (eth_conf->rxmode.mq_mode != ETH_MQ_RX_RSS && >> + data->nb_rx_queues > 1) { >> + PMD_INIT_LOG(ERR, "Distribution is not enabled, " >> + "but Rx queues more than 1\n"); >> + return -1; >> + } >> + >> + return 0; >> +} >> + >> +static int >> +dpaa2_dev_start(struct rte_eth_dev *dev) >> +{ >> + struct dpaa2_dev_priv *priv = dev->data->dev_private; >> + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; >> + int ret; >> + >> + PMD_INIT_FUNC_TRACE(); >> + >> + ret = dpni_enable(dpni, CMD_PRI_LOW, priv->token); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "Failure %d in enabling dpni %d device\n", >> + ret, priv->hw_id); >> + return ret; >> + } >> + >> + return 0; >> +} >> + >> +/** >> + * This routine disables all traffic on the adapter by issuing a >> + * global reset on the MAC. >> + */ >> +static void >> +dpaa2_dev_stop(struct rte_eth_dev *dev) >> +{ >> + struct dpaa2_dev_priv *priv = dev->data->dev_private; >> + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; >> + int ret; >> + >> + PMD_INIT_FUNC_TRACE(); >> + >> + ret = dpni_disable(dpni, CMD_PRI_LOW, priv->token); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "Failure (ret %d) in disabling dpni %d dev\n", >> + ret, priv->hw_id); >> + return; >> + } >> +} >> + >> +static void >> +dpaa2_dev_close(struct rte_eth_dev *dev) >> +{ >> + struct dpaa2_dev_priv *priv = dev->data->dev_private; >> + struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; >> + int ret; >> + >> + PMD_INIT_FUNC_TRACE(); >> + >> + /* Clean the device first */ >> + ret = dpni_reset(dpni, CMD_PRI_LOW, priv->token); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "Failure cleaning dpni device with" >> + " error code %d\n", ret); >> + return; >> + } >> +} >> + >> +static struct eth_dev_ops dpaa2_ethdev_ops = { >> + .dev_configure = dpaa2_eth_dev_configure, >> + .dev_start = dpaa2_dev_start, >> + .dev_stop = dpaa2_dev_stop, >> + .dev_close = dpaa2_dev_close, >> +}; >> + >> int >> -dpaa2_dev_init(struct rte_eth_dev *eth_dev __rte_unused) >> +dpaa2_dev_init(struct rte_eth_dev *eth_dev) >> { >> + struct rte_device *dev = eth_dev->device; >> + struct rte_dpaa2_device *dpaa2_dev; >> + struct fsl_mc_io *dpni_dev; >> + struct dpaa2_dev_priv *priv = eth_dev->data->dev_private; >> + int ret, hw_id; >> + >> + PMD_INIT_FUNC_TRACE(); >> + >> + /* For secondary processes, the primary has done all the work */ >> + if (rte_eal_process_type() != RTE_PROC_PRIMARY) >> + return 0; >> + >> + dpaa2_dev = container_of(dev, struct rte_dpaa2_device, device); >> + >> + hw_id = dpaa2_dev->object_id; >> + >> + dpni_dev = (struct fsl_mc_io *)malloc(sizeof(struct fsl_mc_io)); >> + if (!dpni_dev) { >> + PMD_INIT_LOG(ERR, "malloc failed for dpni device\n"); >> + return -1; >> + } >> + >> + dpni_dev->regs = mcp_ptr_list[0]; >> + ret = dpni_open(dpni_dev, CMD_PRI_LOW, hw_id, &priv->token); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "Failure in opening dpni@%d device with" >> + " error code %d\n", hw_id, ret); >> + return -1; >> + } >> + >> + /* Clean the device first */ >> + ret = dpni_reset(dpni_dev, CMD_PRI_LOW, priv->token); >> + if (ret) { >> + PMD_INIT_LOG(ERR, "Failure cleaning dpni@%d device with" >> + " error code %d\n", hw_id, ret); >> + return -1; >> + } > > Is rte_eth_copy_pci_info() equivalent something required here, to set > some default values? > No, it is not required for the dpaa2 type devices. the common data is being initialized in these function itself. >> + >> + priv->hw = dpni_dev; >> + priv->hw_id = hw_id; >> + eth_dev->dev_ops = &dpaa2_ethdev_ops; >> return 0; >> } >> > >