From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0058.outbound.protection.outlook.com [104.47.38.58]) by dpdk.org (Postfix) with ESMTP id C675D2C37 for ; Fri, 20 Jan 2017 14:58:34 +0100 (CET) Received: from DM5PR03CA0006.namprd03.prod.outlook.com (10.175.104.16) by CY1PR0301MB0745.namprd03.prod.outlook.com (10.160.159.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Fri, 20 Jan 2017 13:58:33 +0000 Received: from BN1BFFO11FD033.protection.gbl (2a01:111:f400:7c10::1:137) by DM5PR03CA0006.outlook.office365.com (2603:10b6:3:118::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13 via Frontend Transport; Fri, 20 Jan 2017 13:58:33 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) 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.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD033.mail.protection.outlook.com (10.58.144.96) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Fri, 20 Jan 2017 13:58:29 +0000 Received: from [10.232.14.39] ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v0KDwOdH028308; Fri, 20 Jan 2017 06:58:25 -0700 To: Ferruh Yigit , Hemant Agrawal References: <1484679174-4174-1-git-send-email-hemant.agrawal@nxp.com> <1484832240-2048-1-git-send-email-hemant.agrawal@nxp.com> <1484832240-2048-16-git-send-email-hemant.agrawal@nxp.com> CC: , , , , From: Shreyansh Jain Message-ID: Date: Fri, 20 Jan 2017 19:31:51 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131293943118360674; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(336005)(39860400002)(39410400002)(39450400003)(39840400002)(39400400002)(39850400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(3190300001)(377454003)(76104003)(24454002)(51444003)(189002)(199003)(4326007)(65826007)(5660300001)(53936002)(626004)(305945005)(50986999)(76176999)(54356999)(6666003)(229853002)(106466001)(6636002)(2950100002)(105606002)(50466002)(31686004)(68736007)(189998001)(33646002)(23746002)(5001770100001)(92566002)(64126003)(2906002)(86362001)(230700001)(31696002)(65806001)(4001350100001)(97736004)(65956001)(8676002)(81166006)(93886004)(47776003)(85426001)(356003)(38730400001)(54906002)(83506001)(8936002)(36756003)(8656002)(104016004)(81156014)(77096006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0745; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD033; 1:cFqOFNmUAox/6DdIds3iHvzHJqJ1R5q2z3DsVrRZPXexvXNQ0nvrPJeHa5L7a99ZHjs9TCQzb87Zu97aAOA9Zc4/axihS9K24vd//Gvv67zZeQrP4a1HYWD4tMBzYOK3UUOvKS8FlaUxgBxhanAoqOxNqmUG9z+TJkc6DzOW3fe5A4dSiJy7SqkAo552gbcc+v+WrjNOaiz+wuiMQABtTYyA3ve6hEc67akG0b6IBYUbEterA7UfTyZKeQBgfU0lI0TJ7ninZzk+6B2pcH8dkrbDT992Jvv/MGGzldYQnrhEi39w20w4WEzLD7G6l+tJSUHIwapKieS09NKYvVr2m0MKIoX54S2sOp38IJl0OG0Eu71VS+Zxri3TR9tYMF9leiphweE14hYQrmf35OkBDQAh4zD0bzY0/vetsV0Zm1/9VIu22yi1j1VnmpNRYiF9hRIZSnlGDnMoNZTPyr2e6598nSj7YI9dP7DgrT+EN1pM85dSkWRUx0ravQj9JpDjLO+ZiX/saI49zTk5VjCn6w1kr2MGxVUCXev3+kQf7v+L3uGreR19sZuaVyTdvxigBAGPVYrTTKKgmT/Xb5nfSZ4Kxq+8lskaPY+Z7kWBpo/CY0322xxpy9bjzeEMDHP0 X-MS-Office365-Filtering-Correlation-Id: b3f93395-645d-4c38-8f05-08d4413c6b2f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0301MB0745; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0745; 3:WHupWrj5PMb2ZJnPc7//O/eTXUDl2NVbDtKx9Kd1/2p/TFESZfqloaULh4DUO25eZKC8/lpPv/j+oxqh1yooGk7KGTiiWf5oE8DoV78FcBtElBllcEk/Wcr0b5/ngqzU27PkCQW+ujLa3oJTk6WWoOHXv40zsHgNalr5bAph3cB57r5RLs+JE+zCgfBbDvSAVbn7YGpJDX5e6coSuGANwV+RXn0aVzHFcjGl00MFrVfJcsZEBzPKJs6rABq0voPByIIVtRJ2nb0rYjpku5TROoR3E3uAorJL37LLs2wOikjjDt3YHHTptSlwPFEBj/hClMej5Y7dAlpcX84AS8kcVLWoOWhwEwzhOUBkw738pVDhoNASkvzsi5qlGWu2E7Eo; 25:q5KYxAm/OWRsjpTQwCfGac7yeMAn8uzKla/aRvvT+lcecW5NnsSClPa/FgodLqgikedVCt/zRbIgzfr9xxPrpI6RFFMZeBSIbkC8+Fw1tA3M3GVu2ssf2z+Jh14iwPO1NM278F0RTeyow5OZC5M/Ke8irHxhefX0jboc/EnWwkFHllEE5EIsuou70gCigLOvVPnkko98HKbir+QztToDGSxn+WlsjPyiJm71x1vuz0g5C0lGmc/aomRloERWSOOCuyi7782pWHTBAZn6zEsc9WhqBAg5d49PojRG4bRCKDE9pRoWgV0R7f/K60aEfB9UZTxjnGOXVXkTCUoWASWsZzIFDWGeKR1br5PxKh7L0fxDT4O5PBnJi7fAM+mgtuBnGtetg/wK6ioexORrFCbvQZnbWhGabRhAS+JnNSznKhAsxYlNV/6mJKSU/ba7sb8K+HLllJKlNGngbM5xGrNcnA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0745; 31:3pcS4ZOJdPYnfUzBV/+RO4T1AWTCjngh5NIONricAI54O5T54Vh7uvvEhmybRkjuvGBGkZ69RiEoRMC2CS2W9acOrNGbSBt19hy7yGO8NGaft9fYdr9mOlkFg1x9gb6yhruj2YavVXXVmzQr0AaqIewljInh4O57QQ+e926eS99w3ROJZ33tQA/U3qyG9uo//y7HSQvAczC3ftkRqxby3l98sukl11zhKdWCXUjePY5ZmD81t0981RKD/7Di7jRwcS00FoK4OsRX06S3ciaFMA== 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)(13015025)(13023025)(13024025)(13017025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(20161123559025)(20161123556025)(20161123561025); SRVR:CY1PR0301MB0745; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0745; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0745; 4:lybkZmAMVUE+Dzh6zDWaqs0l5Vefb6tYL5J0rlqREAFxNTcxuqdLBJgYIOxfCed5kkvIluH9CyPDWjjtuXMNVWoUb+WU9ymhVSPfrlmbEtYc0biSiJinWoFAwamAbwyFWRhbIUUBHS9iccvpEbJPekrWN2Q4rmvXyLMpZE3YfLdRVsvMubm3gWlmiySKiKY4qXTuv1TGL9GeDtOKFEX4klzebG0yZ24M6dqXkABzYn3aGU1nb0bcDCo722f22brxZugbUph3YpjTpfTBmvR2mYbMk+L7wYX6mH7O4Xvsvb/abcdtF0TZHsevWQnifoWybdwpuFZbnWHKw5xPscY8+0CEOU1PuTHSZNg1vVTwo8hfXGt7Vzm1JTCdQMNEAYitxMuiejgybVQZd9vXbVdRKgFdnG5tAHDWFnLGWz3o0xdE6sIkrm794lyDGbi3iBe9+FYbKaNCgsmueYM/EVjWVb9GWwOB+WhNp9WIDQoVoqoZCc2AbShoADfX5s+Jj3zq5alcrB5quy8ERzuYl3WSa3uqwIbOOW/wb0eGuCDlDI8ltq4X84ot3AR5zRdIzzkQpEK/tZ3NTKlrChCGjepThBqKap4NQB3RwankWGs7p3aLInTikIbXFDPwmk9m5DRQd9u/8ti5ywb+fZGlZkV0x3bxOPMajiGqp+/sMddaQWEZwdUzYVXcmbx2e7tlBU+xkfMBFB1RUOmCDmJo+s48PaUhCSUFCzzPGYGCLBrRM2wS7m2MlBoer3fTXUVc2W/M X-Forefront-PRVS: 01930B2BA8 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY1PR0301MB0745; 23:fdEBjvCyjwjkB8i5wsJxGsgbFwI4aly5tHV?= =?Windows-1252?Q?mgdQSCMe50QcGr84qp7qOpWfJNpvkppIZNn+T/S2ePYdWJi4IWmmKRQ2?= =?Windows-1252?Q?jB1Fy/gmnoyKjjl+F0PJrOiFvm8JCtt8r434udgctlc+ChBIHKtHEnFz?= =?Windows-1252?Q?3d5MLlQWti2BfvJDNK75XNQsprucjXDNGRm8cTzlSAFvHhKN0/LaC1PV?= =?Windows-1252?Q?v50fs2v1MYMb7ladKVAOWRSOL4LIiIepm/0iMLrNi/WdNLfLPmnztKmv?= =?Windows-1252?Q?DM9MIOGFuK56to4kNoWlscjvgE7TFzM/FA8GPQ1a2lvllhJRA53yrjzD?= =?Windows-1252?Q?GNq46U6aKuWmpds/M+DkFLZ7Fr19vfEwySS1kpvPxTw0PHbbpbR5Hl0W?= =?Windows-1252?Q?DM7YGY80Rixk3SJoNuaSjcfF8MDqssW+fKyo5SUYfdgZ/jTrKWKtbJip?= =?Windows-1252?Q?yB+7+ts84KA6ZZCnT6yKIjf8eBPDHkR8uAV1fieG+yquSKX+ujMIJ/Fw?= =?Windows-1252?Q?RsXSoL7Sh4o4C3kDcOJ3Qun0SQj1+Q2+JGPG4EP2Vyqrk4jMyxpcuD5r?= =?Windows-1252?Q?1k+oMfp27bEytSLT1IFrZ5vxp7RzD2MM25JmSjDWFbPAmVx8biR3yXvK?= =?Windows-1252?Q?m/TouRCg2CEYejAMjuVgKYfLE4W7OgGyl9a4JB6vAP4QVoOZmzYgJDTZ?= =?Windows-1252?Q?SH/jh+cQHeUeF6giie7c4Fv75qUtlqmXR2z8Myes+7RRXKetARzLmXql?= =?Windows-1252?Q?veKUihz6AnbY8JgqLqKDe0N9AVSwdcWSR6PM5RDZlFinoEVJGwJO6D3B?= =?Windows-1252?Q?sP8y/b0sklyD4JqD+fzdL3f3srOKB/+A3Jj7L3RbN8jqc6qZANK+PZVE?= =?Windows-1252?Q?Su3v6StQSGvkhiXC3qDTsWTFrLW45vBtOfKjk+pF21eHRNG6qnNx7HGT?= =?Windows-1252?Q?pbVY+eYJnx5sGm7ROaNyAzsqgQhBZw6UmuwkfSbu5HxkCItFsQghCRJU?= =?Windows-1252?Q?zA+e+5W5wTJzfGYTsHIJ5ORtIiuXxjmQxoCL09hwQthrqC4ZgsLERn4I?= =?Windows-1252?Q?hJdGJrFsENf+nGfM5O1jbgmSlQzzSoWgGDOwrtPuNB5aelbpSrGffjIO?= =?Windows-1252?Q?vF7kpuzMSdXm8YzhvS1klW0wYsvBelUuaCinAKDaCcNMMBQfx3Vo2oUe?= =?Windows-1252?Q?IuFntrIPBfVLxdxkZqYdR4Ry1+UpCXR+SiGNSP0wXrwAajTjKvVGjIhQ?= =?Windows-1252?Q?V1QvLsgDAa1J6+aNaZCuBhLjRliwk/aSZnC68jkLGyTKzjLVgqeDApOI?= =?Windows-1252?Q?ry60kSOcdurBZLXLE58QsIPzbTO9g8aCNsjGfLsb6qJ9zh19x6/ADoys?= =?Windows-1252?Q?ok2CgtUN0xVAUZELFTdbHuOrQfkfYWcDa5zC0vIHefDzqz8qQ2qzJvN2?= =?Windows-1252?Q?7Jxss/CpseXCb8h5BLBko7XuyuDCpRog7Z7R7lSeVpswgJn8m0H9xddy?= =?Windows-1252?Q?PjGqPeopjpAqzjYHxWXiA6rUfN1F00pRn0Di9+1gtNjHRGRnwSC54X4r?= =?Windows-1252?Q?PrVFwNDv7+e0ga7fSjz7awOfeiNFLVdrQGEu6Q7/JIdoIDrTgNhGn7pI?= =?Windows-1252?Q?0wYNpUzTpHHt6BvPSF3IRdFT6m7v9h/Hj01qLr/xsMyMikIRvJV29FPj?= =?Windows-1252?Q?EOxYGlNOXRZ5NQ1VdKIofLZn5kZhIq/OsWTmZFb1hWPbkmwssdWQQEAp?= =?Windows-1252?Q?Jq0KFRTSy6w/pSYvymBEYBT9/rAv21peEIrX+q/8=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0745; 6:nEkzEt4Zl8t1PqeGuNj6bLHmMBC+u/Mc6Yy6wob5tur7MTTiLSzhgIZFd0UEQxlC+5AR2ZVqMZNj4CfjFqK3lgo5SffpbPeNipIoRvj0NyfBP8MN3OIpZ1mj+3Fd9HA46SFWyslhSUOztLITMFYDpKHRubymuUKo1Q95nqLQp/zwLt+s+gHwUeO1uE8hMB5S6Vhcrw10WjmEb5H6IKRmW+W1/B/nKOpWi67UqR8eK5QZOyTzOcvF7tt97GQj/F61cuJWA8qFjvIxnrqeWUlSMfN3U7r5X4z7GH1u+gqJ0IOxFxHIVhCkNs12bUmXuavzJFUcHSIYszRR+EqIrXOYFzSi9/SS0ujjJ1IeeIyVS1nswZNfL4IYq2BiPXo0sOQxL/8Y/7d23ebPUNqwRL9z7LlSwovIRr700qapg/qTcA3znVbhRPGzBpwCEmJnWShw; 5:rBcOwM2CEf+hCYbRf03imuwXdOc1482rTSZOaimnpOz2ygly5M34Vgisaifle9sSAzlpo9WnKFlkJpSdHrcIW7jZnvNtv7KTLpttYqTHXW2QMIC79H3STJYR34RdgcJ/V7DP/SPe6qqh1yekQSdEIJRWErAsjAMEgoRr0OaEATxmSJNfDSKF3zfgMUUW4HtK; 24:a2t4ZGEZiXuMHaOlUF9NwZDZ0B4M+o0JBqreUy7d4T6f8zYvONJtVdHhPvfYuYWRHMnttIeYq0aZ7yZhTixMy55CtLLfTpdOFi63fDTaFH8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0745; 7:4V6raTgsGCOSZhbT+BqhVW8oeF12t6SWIfmt9AY7sG7MziR08LszyeH5gMzMStq6AVmXNMbZ9ntlyZpxC8IdXd930lz+ysE3gHYK8i0YERBRSSCKP0gorHc6xuWe9TYC9ZxqoTLYpUVCvFUznDg69t3wXabcUayOuIk9DzUeCw/p4aKWg9ZyHmfpCYJ9XW37QhlLFRY2ASTfB0QxCRrRrvfVrmTWA5QmgKP/XF5vMBjtb9uCZnuIIYUxHAxiO7vmiSwmvohdYQBRRFu/V9WCFYNOHxAnnE8MN1OodXNPT3NSd3wlVrGLlcQA7jEcrOsRnMT+lHOP6Z+d9N8XJXZcRCWxcw54RqXyu/YCWf/EEcdoFY15Gkn8up/iTokN/IuWHAHqr30eXZvKZL5MXYQ26yssarMBQ5QUJU7IAKy7HOll0nQk/XqOSZhRvY09wHZHHeDyoz7OX87gzt1g2R1Gxw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2017 13:58:29.0437 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0745 Subject: Re: [dpdk-dev] [PATCHv5 13/33] net/dpaa2: introducing NXP dpaa2 pmd driver 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: Fri, 20 Jan 2017 13:58:35 -0000 Hello Ferruh, On Friday 20 January 2017 12:45 AM, Ferruh Yigit wrote: > On 1/19/2017 1:23 PM, Hemant Agrawal wrote: >> add support for fsl-mc bus based dpaa2 pmd driver. >> >> Signed-off-by: Hemant Agrawal > > <...> > >> diff --git a/drivers/common/Makefile b/drivers/common/Makefile >> index e5bfecb..76ec2d1 100644 >> --- a/drivers/common/Makefile >> +++ b/drivers/common/Makefile >> @@ -31,6 +31,8 @@ >> >> include $(RTE_SDK)/mk/rte.vars.mk >> >> +CONFIG_RTE_LIBRTE_DPAA2_COMMON = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) > > This logic make sense, is there any reason DPAA2_COMMON to be a config > option, it doesn't look like something a user would like to change on > its own. I am assuming you wanted to say "The logic _doesn't_ make sense, ..." :) > > Instead, as done here, if there is a user of common folder it is enabled > in Makefile. For this DPAA2_COMMON doesn't need to be a config option > itself I think. Aim of drivers/common was to introduce libraries which may be used by more than one sub-system. These can be other than dpaa2 and may even be external to DPDK framework itself. But for now, we will remove it and keep it toggleable with rte.app.mk changes. Maybe in future, if need for configurable option exist, we will introduce. > >> + >> DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_COMMON) += dpaa2 >> >> include $(RTE_SDK)/mk/rte.subdir.mk >> diff --git a/drivers/net/Makefile b/drivers/net/Makefile >> index 40fc333..f716ca0 100644 >> --- a/drivers/net/Makefile >> +++ b/drivers/net/Makefile >> @@ -57,7 +57,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_THUNDERX_NICVF_PMD) += thunderx >> DIRS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += virtio >> DIRS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += vmxnet3 >> DIRS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += xenvirt >> - >> +DIRS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += dpaa2 > > Add alphabetically please. Agree. > >> ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y) >> DIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += vhost >> endif # $(CONFIG_RTE_LIBRTE_VHOST) > > <...> > >> diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c >> new file mode 100644 >> index 0000000..2295f82 >> --- /dev/null >> +++ b/drivers/net/dpaa2/dpaa2_ethdev.c > <...> >> +/* Name of the DPAA2 Net PMD */ >> +static const char *drivername = "DPAA2 PMD"; > > Custom names not preferred, please check any other PMD to be consistent. Yes, this should be changed. > > <...> > >> +static int >> +rte_dpaa2_probe(struct rte_dpaa2_driver *dpaa2_drv, >> + struct rte_dpaa2_device *dpaa2_dev) >> +{ >> + struct eth_driver *eth_drv; > > whitespace error. Fixed. Thanks. > >> + struct rte_eth_dev *eth_dev; >> + char ethdev_name[RTE_ETH_NAME_MAX_LEN]; >> + >> + int diag; >> + >> + eth_drv = (struct eth_driver *)dpaa2_drv; > > How this suppose to work? Actually, a not-so-clean-logic coupled with the above line which probably got added in one of our rebasing attempts. And you have pointed out correctly - because of eth_driver<->pci_driver restriction. (more below) > > struct eth_driver { > > struct rte_pci_driver pci_drv; > eth_dev_init_t eth_dev_init; > eth_dev_uninit_t eth_dev_uninit; > unsigned int dev_private_size; > }; > > struct rte_dpaa2_driver { > TAILQ_ENTRY(rte_dpaa2_driver) next; > struct rte_driver driver; > struct rte_fslmc_bus *fslmc_bus; > uint32_t drv_flags; > uint16_t drv_type; > rte_dpaa2_probe_t probe > rte_dpaa2_remove_t remove; > }; dpaa2 driver is not using eth_drv - it is more of a dummy. If we had used rte_eth_dev_pci_probe, we would have faced this issue of delinking eth_driver from pci_probe. So, we have leveraged the bus->probe and created our own probing routine (rather than use rte_eth_dev_pci_probe). Then, because it is our own probe routine, we simply allocate the eth_dev (which luckily is free from pci_dev), and call our dev_init, which rte_eth_dev_pci_probe would have done using eth_drv->init(). (More below) > >> + >> + sprintf(ethdev_name, "dpni-%d", dpaa2_dev->object_id); >> + >> + eth_dev = rte_eth_dev_allocate(ethdev_name); >> + if (eth_dev == NULL) >> + return -ENOMEM; >> + >> + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { >> + eth_dev->data->dev_private = rte_zmalloc( >> + "ethdev private structure", >> + sizeof(struct dpaa2_dev_priv), >> + RTE_CACHE_LINE_SIZE); >> + if (eth_dev->data->dev_private == NULL) { >> + RTE_LOG(CRIT, PMD, "Cannot allocate memzone for" >> + " private port data\n"); >> + return -ENOMEM; > > release allocated port? Yes, I will fix this. > >> + } >> + } >> + eth_dev->device = &dpaa2_dev->device; >> + dpaa2_dev->eth_dev = eth_dev; >> + eth_dev->driver = eth_drv; >> + eth_dev->data->rx_mbuf_alloc_failed = 0; >> + >> + /* init user callbacks */ >> + TAILQ_INIT(ð_dev->link_intr_cbs); > > This is no more required, since done by rte_eth_dev_allocate() yes, through eth_dev_get. Thanks - next version will contain the fix. > >> + >> + /* >> + * Set the default MTU. >> + */ >> + eth_dev->data->mtu = ETHER_MTU; > > Same, no more required to set in pmd. Yes, thanks for highlighting. Implementing our own rte_eth_dev_pci_probe meant writing all these ourselves which we couldn't match to the changes being done upstream. > >> + >> + /* Invoke PMD device initialization function */ >> + diag = dpaa2_dev_init(eth_dev); >> + if (diag == 0) >> + return 0; >> + >> + if (rte_eal_process_type() == RTE_PROC_PRIMARY) >> + rte_free(eth_dev->data->dev_private); >> + rte_eth_dev_release_port(eth_dev); >> + return diag; >> +} > > <...> > >> +static struct rte_dpaa2_driver rte_dpaa2_pmd = { >> + .drv_type = DPAA2_MC_DPNI_DEVID, >> + .driver = { >> + .name = "DPAA2 PMD", > > This is not required, RTE_PMD_REGISTER_DPAA2 will set it. Yes. Will be removed. > >> + }, >> + .probe = rte_dpaa2_probe, >> + .remove = rte_dpaa2_remove, > > These are PMD specific APIs, PCI equivalent of these are eth_dev_init() > and eth_dev_uninit() functions. Instead of rte_eth_dev_pci_probe() like > function. > Here it seems used as how it is used for virtual devices. But even for > virtual devices, it is desired to have more proper virtual bus structure. > > I understand this part is a little problematic now, because of the > eth_driver <-> pci_driver relation, this is not generic. > What do you think first solve eth_driver <-> pci_driver problem, out of > this patchset, and later add this PMD? This is a long pending problem. I agree that it would be cleaner to do this unlink. But, I think that the current way dpaa2 driver handles it is not truly incorrect. bus->probe() can be linked to a driver specific probe (which dpaa2 does). A PCI PMD would have called rte_eth_dev_pci_probe() as a helper for doing all eth_dev/eth_drv initialization. dpaa2 does it manually. I agree we need to match up to various changes done in rte_eth_dev_pci_probe(), but after that our code is as legal as any other PMD :D. > > <...> > >> diff --git a/mk/rte.app.mk b/mk/rte.app.mk >> index a5daa84..c793dd2 100644 >> --- a/mk/rte.app.mk >> +++ b/mk/rte.app.mk >> @@ -110,6 +110,11 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet >> _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz >> _LDLIBS-$(CONFIG_RTE_LIBRTE_BNXT_PMD) += -lrte_pmd_bnxt >> _LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe >> +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_COMMON),y) > > If DPAA2_COMMON removed it can work here too, because if DPAA2_PMD > enabled, DPAA2_COMMON should be already enabled. Agreed. > >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2 >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_dpaa2_qbman >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA2_PMD) += -lrte_pmd_fslmcbus >> +endif >> _LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000 >> _LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena >> _LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic >> > >