From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0069.outbound.protection.outlook.com [104.47.33.69]) by dpdk.org (Postfix) with ESMTP id CF5B5FA3A for ; Mon, 19 Dec 2016 16:21:16 +0100 (CET) Received: from BN3PR03CA0110.namprd03.prod.outlook.com (10.174.66.28) by DM2PR0301MB0749.namprd03.prod.outlook.com (10.160.97.145) 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:21:14 +0000 Received: from BN1BFFO11FD042.protection.gbl (2a01:111:f400:7c10::1:148) by BN3PR03CA0110.outlook.office365.com (2603:10b6:400:4::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.771.8 via Frontend Transport; Mon, 19 Dec 2016 15:21:14 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com;nxp.com; dkim=none (message not signed) header.d=none; 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 BN1BFFO11FD042.mail.protection.outlook.com (10.58.144.105) 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:21:13 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id uBJFKMhb029110; Mon, 19 Dec 2016 08:21:10 -0700 From: Hemant Agrawal To: CC: , , , , , , Hemant Agrawal Date: Tue, 20 Dec 2016 02:23:51 +0530 Message-ID: <1482180853-18823-13-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> References: <1480875447-23680-1-git-send-email-hemant.agrawal@nxp.com> <1482180853-18823-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131266344738868339; (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)(336005)(7916002)(39850400002)(39410400002)(39380400002)(39860400002)(39840400002)(39400400002)(39450400003)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(305945005)(626004)(189998001)(85426001)(6666003)(6916009)(2950100002)(5660300001)(8676002)(36756003)(77096006)(8666005)(33646002)(356003)(8936002)(48376002)(81166006)(110136003)(50466002)(5003940100001)(81156014)(97736004)(50226002)(68736007)(2906002)(50986999)(2351001)(92566002)(106466001)(104016004)(4326007)(47776003)(38730400001)(69596002)(76176999)(575784001)(86362001)(105606002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR0301MB0749; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD042; 1:LGDjgdW0qayZy/uODsVNNhLykNnrjYsbCUxDrrAc4mVMQAkzMNSXT/mTx8aY1XjaXvzIUgG4yNTyQXvKbQRE3dnquKlO6dwtm4eLkn72cFo+PrDh9gkev1hyfOd8Tm2GhnqHs7VZihn0fyhzBmRyMJQZLYcLlFJWHJIOwD3ScYSwTPuyDS78LHTswuUG33U13ShV3LFL3mNNECdUrN3bhHsoHguaR9GMo57fiXvz/K6qm0a38akHxwuRfWu+tusuy7KmB2gPg/ICsJOIbwWJLG1JAMoJFIiTVB7KgJqUM/gZ5i0zVp/YhhRoih31yCm4AlJ/LOSdZJ64S4g4iLMEd4LdPh318dLcC0YK70SAwwE2JD+OYr9k2dgRdrW9BAhjNsXjxvfU1zuUmtawQOJ38frNnfAgd9NSyjqjbDNvfbG6jmYOLUiLBwwjAeDIAmRprR2KQaZ5JHO8dOyyE7pmvwWlYJ21lmqN76k56uMEfA6d+BHhWfXxoCpgIaTxqMzDYT3+MlEi90/JwtnHdhXcEVMERQaHyrRtfdrJm0QSnmtESMJssduregNS1qGTv+fx45+TGZT7JTUgHMLNJ9QxlxBrUSK6qwm6Wi44o6Il+YZT/HWMG+ZjhtygHUrfFhT0gU5e2rlGWdPYrpRANAsGGgvAP1rZNpa31qySNhrVAyIX2/U76R9sl5Xt/pI59ei/kdmF6AFXuV+mj+qdOqjgGgPcyHGUkcm6e12KYJrkctoqIswmNbf/Y2hAx2A7RKfO4roTgPXwdHI8LXeVJ91htA== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: ec67ce03-3545-4a0c-6b12-08d42822ab94 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DM2PR0301MB0749; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 3:LhqiEPgZ6Uw3d9rFGox7MDvpeM3f0ATXaDs//eIIksvLApgwvMSJF45n4HaqKrJZhoIDlDKKwMjnW/UBAtue4PBPPBk8a+S7pV5JcfnKBlFSMutw4wowMKEU+xIGhyLyurYwBSPPF+S5W2BjpM9dOVsLmOKCsYqeISOdugtxD0Rn+Pjb/PBUm/TZNCVwOYs2pbNnl1iHKAEaSviJgwoFmFI403sSFeRxQPg9Xtl+TBpMmd8xtM6UD3zucGec5jjNAwUWC2CNLqet6Z8+V9nQD0xB6fAVjDzB6U33yOgLLHd978H9sSFhbLf+q45lD0JcE15+KkOa1rBG81SVsv8p6mNCJeMi+J//Vye1Yd+IhvJl5Na1vLZPWuMq2UGV1Tkt X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 25:QqXF/uMFWe5jg8AZNf25XoUG/DqQX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+bZZ4LSgERQh2wu0bew== 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)(13015025)(13024025)(13017025)(13023025)(8121501046)(13018025)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123556025)(20161123559025)(20161123565025)(20161123561025); SRVR:DM2PR0301MB0749; BCL:0; PCL:0; RULEID:(400006); SRVR:DM2PR0301MB0749; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 4:B/bc/h77ISTTMumMhkwH/PZyYELz2u9PMGy8gs545qRc3qpDE0NzLIUJQFr1if8K3xl6FDYiFJGAE69LEp3ni5Kc+6JMZr+FuEjJH9QaKjr48injzIdPDCL1KwwLIeBIjR8qE+fTQ+pwxCD+YUO4MuO/W86PBpVSC/E2jJZUO/7+MoNHpCmncPwuRBuPBy/YBHnOVAjB7+cHGAEXmZBcEjhqZu6GOu37FVtMYfJCZRLNfdLtcJ89PQiOklemCEiIrmgGJlMSDPUI8pKS4FzEswKHwqJXQMg5jIs/AYIMxg1XhBAy24+ikWCKo3CaCSZ47Qdan6MxcjhhYhjQbcq2iy9rRcwo6dEuujX/MwPw/tWTs3/U7o6BLrA6PNVwMdLFrabhF3wp6w8qNCCTIt3m82P2mYmb3t3jwaL9MMfspn2B74uzVToyZWnYD28EBUg+ifH7xwzHIczLnC+pkwFu3KRitDDjGXhHw889+AzPO6zJ2idy8164IL0mliBdlknaD9kfksoDx5NT+BzsUvrx0WDtP0aanO82ZV9ziyHzyAgRhJN/s8Y6m9fyCOEfA5ZKbK+lVVsJfTa132a5TyCoYdFFARrntQtF4TstMNUuH+jpwFyy8CQWf8U9jdjPaVtSnZtyvKtYur7bJ8JGu9JciUNSrCaAgM835iwO+5DBhYP04akvGbSSXSNX6bVeJChIfJwYJQp2Nw12Jmkjv1tchi2mr2/S8on6Q63YibHqq1Udl7zco1RphQTZz2cj7Jxu X-Forefront-PRVS: 01613DFDC8 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB0749; 23:hVwTTNp/+dm0iK8jKNjb1vp2epgF1r/WiU9n3kz?= =?us-ascii?Q?eXucOIjI0E5B2Pfh7CRnhZNtz3KC++zuTVWoz4jHlp2QLfWa4wtDDUWz7s8z?= =?us-ascii?Q?1J9x9X6DBLRcy6NbnfjtMUkXqQA7V7KXaIvYnrBTFATOKN0yISj0tKaDsWJI?= =?us-ascii?Q?5/z+R+Awh+lJF1vFOL5WPP05EEu1yw/3NqVzaAaQ+mtSKIvzh8+35FgPJgRk?= =?us-ascii?Q?4grnRLTKHeBVLx96HX+kfwkhD68Xhl6Prso/hRR1c5zorpTQaqQlxeGKwcgH?= =?us-ascii?Q?pPFDsGC39fIvWagc5cm7eVwROVLN2omDB6TRPn0yzZbBzPlXP76IuP2kMolV?= =?us-ascii?Q?V8xR5fMEqpm9KWPO0vPn/+jG2ZfNlJ2Quo+FO5QZMMFpgbVLKwZp9kJMhlcL?= =?us-ascii?Q?NGO7dUMnFjMKH4lj1jtc578qIAI4nFpgHccjGqvtj89/qskK7vMvzByoPrLz?= =?us-ascii?Q?U2QNQzffe/EoOU46Am+VmFmBj5TNBg+iIypZzeDT5Q4E5GKX1iDrAa+3Y/eU?= =?us-ascii?Q?BRmJdOSR/bcdADtstbVTCQcLYazUghaH0HVCKekt7RMgI31jcG2hP2yCGFX3?= =?us-ascii?Q?4GMvJFf521wzvkvbqeRoNll9huQpHSJ0fRMgcjcDkvloWq58T14kvtBXd3oA?= =?us-ascii?Q?/BAyiwL0KNBaoOIZieUvh+/R3U/WDKTu/FxiAB2RJd2GJyMGzfCcmC4CJ1bq?= =?us-ascii?Q?qlKrBilMftNFVk4RkfsB5KRktsZQ0Irk4CNZA1D1HfadEhyQ6uqsfBLGBQWM?= =?us-ascii?Q?kM1AA5G0zSYJJSZVahLbzAirGCNBZPV3QUvO6HJD87sXn0dED58Q2GtWobT+?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E4sOuJAE6GjaYUqZa0o53/9jY/mYvEHoMoySBjNJIPRtAtpKaii3RblsyEB65An2Uswyro; 5:HuJzxndSTD/YM1wQ/tXV6SAHipKQ7GNy/w6R6hgEupcUQhvJObqZr36fnnNG5wzR/wrRuExtLO6RvbcbDXbQn1XBz0L6KhfXkBVwXJ+j5NZaYKb4F7fBCtgda5jpiMNGDZ9SETCkYMI7AQkG2l12poTf1me/S6lks7VqwnKzVzgmPsIU/weL93RBY3js7LwF; 24:Q02702DL9fhICUsQWsZIzH3irUEmeaW9GeWfWUDkNBvhc+G4vhGfEV8FX6wqCxqJmqe3olvRJlQOHzocqFcn9b/GPweLTrZdV1wax/zOTYw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0749; 7:yD+um6e9W62eblZJpa4oyUHozlFTaVKBE4Lyay9/wXG4ut2BqV09pFMO+q/Tiotc7Khw+rFcDPSmTjN9iJridWgPjhTabGYYH/LTvKnntsRzjxy+s2/4Ll9gzJGtV2rPQ9n1XCiFSwngaRhvOIlQQggfAqkiePW8FaTW7T8oSQe+mHfhJSejbv+gMH1hPv9ZWoUwuPYvdRgHR1qRyickBRvduAKSV+aMax++1nLzGWjuB6yveGQvJ1vO34fTLJWQyC177ZDj4JlDyP/evI3FFg9J/jaZC1CsAN7nOsYgWNzlnpjZHzFx8YRqhOMqdXnDFJ5mGJbbw+8JeKN4m8DmEui496bOZZ9XlHXssdTWV/bHHEHBLGriEnl1QKOZcHzfICLpwt1tEFB/CE/klqpA46Cfc3nqmDvg00h6Jq/4YSszG8sObN8oHCV46taRVJmEXhJLNzJ4JdwBO1aFM20mrQ== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2016 15:21:13.6528 (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: DM2PR0301MB0749 Subject: [dpdk-dev] [PATCHv2 12/34] bus/fslmc: scan for net and sec devices 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:21:17 -0000 This patch will add support in fslmc vfio process to scan and parse the dpni and dpseci object for net and crypto devices. It will add the scanned devices to the fslmc bus. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/fslmc_bus.c | 2 +- drivers/bus/fslmc/fslmc_vfio.c | 66 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index ef38b3b..bd0fc4f 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -58,7 +58,7 @@ int rte_fslmc_scan(struct rte_bus *bus_d) FSLMC_BUS_LOG(ERR, "fslmc: Unable to setup devices"); return -1; } - RTE_LOG(INFO, EAL, "fslmc: Bus scan completed"); + RTE_LOG(INFO, EAL, "fslmc: Bus scan completed\n"); return 0; } diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index eae6495..7739493 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -209,15 +209,58 @@ static int64_t vfio_map_mcp_obj(struct fslmc_vfio_group *group, char *mcp_obj) return v_addr; } +static inline int +dpaa2_compare_dpaa2_dev(const struct rte_dpaa2_device *dev, + const struct rte_dpaa2_device *dev2) +{ + /*not the same family device */ + if (dev->dev_type != dev2->dev_type) + return -1; + + if (dev->object_id == dev2->object_id) + return 0; + else + return 1; +} + +static void +dpaa2_bus_add_device(struct rte_bus *bus, struct rte_dpaa2_device *dev) +{ + /* device is valid, add in list (sorted) */ + if (TAILQ_EMPTY(&bus->device_list)) { + rte_eal_device_insert(&dev->device); + rte_eal_bus_add_device(bus, &dev->device); + } else { + struct rte_dpaa2_device *dev2; + struct rte_device *r_dev2; + int ret; + + TAILQ_FOREACH(r_dev2, &bus->device_list, next) { + dev2 = container_of(r_dev2, struct rte_dpaa2_device, + device); + ret = dpaa2_compare_dpaa2_dev(dev, dev2); + if (ret <= 0) + continue; + + rte_eal_bus_insert_device(bus, &dev2->device, + &dev->device); + rte_eal_device_insert(&dev->device); + return; + } + rte_eal_device_insert(&dev->device); + rte_eal_bus_add_device(bus, &dev->device); + } +} + /* Following function shall fetch total available list of MC devices * from VFIO container & populate private list of devices and other * data structures */ -int fslmc_vfio_process_group(struct rte_bus *bus __rte_unused) +int fslmc_vfio_process_group(struct rte_bus *bus) { struct fslmc_vfio_device *vdev; struct vfio_device_info device_info = { .argsz = sizeof(device_info) }; - char *temp_obj, *object_type __rte_unused, *mcp_obj, *dev_name; + char *temp_obj, *object_type, *mcp_obj, *dev_name; int32_t object_id, i, dev_fd; DIR *d; struct dirent *dir; @@ -347,6 +390,25 @@ int fslmc_vfio_process_group(struct rte_bus *bus __rte_unused) FSLMC_VFIO_LOG(ERR, "DPAA2 VFIO_DEVICE_GET_INFO fail"); goto FAILURE; } + if (!strcmp(object_type, "dpni") || + !strcmp(object_type, "dpseci")) { + struct rte_dpaa2_device *dev; + + dev = malloc(sizeof(struct rte_dpaa2_device)); + if (dev == NULL) + return -1; + + memset(dev, 0, sizeof(*dev)); + /* store hw_id of dpni/dpseci device */ + dev->object_id = object_id; + dev->dev_type = (strcmp(object_type, "dpseci")) ? + DPAA2_MC_DPNI_DEVID : DPAA2_MC_DPSECI_DEVID; + + FSLMC_VFIO_LOG(DEBUG, "DPAA2: Added [%s-%d]\n", + object_type, object_id); + + dpaa2_bus_add_device(bus, dev); + } } closedir(d); -- 1.9.1