From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 70F50A04B1; Thu, 24 Sep 2020 06:02:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5A6A01DCFF; Thu, 24 Sep 2020 06:02:30 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70053.outbound.protection.outlook.com [40.107.7.53]) by dpdk.org (Postfix) with ESMTP id 1E0F91DCE2 for ; Thu, 24 Sep 2020 06:02:27 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cT91/1wxycOOG09EMF4bwy4FzFzvI8p3wYjTlANWA7nrRB911zp6xWudwmouHkn+tK+JXeu1OuCDwCJyJYuaR2cY3LgorrN/SSiaEaJuhMzpvBIakJXPjbb+atlcxN3T+eUbbgL5gv991Gkt1rFrCVfY4jX5e8GFNwwnPztr3yUV50KqpzugsOxTLtjGRGiB3aRH6AWvZO8iCKCxr3i8eQI8GtVCl9Y8/AgAvDc+5GqexyJxjsjnnIl/uH8g7Q0+WLt9huhNCccOTRZGTA18VU3RCxQ2r+wUDFI/wnMGqycIF0m0CnyG7Qsueuvrf4QioUPpOI2/A3b61CvPT7WS2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hun0kJDKnkUrGRr21Cfn8IRJQWdnA0SuV/DFPULst2o=; b=WrM86YqS18utgKh+ZGDFD5tltzrDVu8zmcc2hNs3WODMyMyweaF45x+T8ua99I2A9CPhzwWGLBBMbNonQgcDa5QuLFNglU65TPEXxDEQPg6j4+Xngf6IYt8Z8YdoV5WhlpRabAMhC55TK3/0ZQNWWw7jnehUPNGIIYKePQnPu2KpA88F5pNwBm4AcJHZ9Wyjy0mEy+Q5s6XiuT7YVNsDsC5uy2HUgj9Ar0rzAGWPbN8o58WFdtlSJmTh0nN3zAu3/GqzOqXgb/zS3Pw3+xMRpUmg8kpUduOalO/kOFPhR/MOk+yumDzW6/xhugGsbtHK7ReIknihffK6FKQZGxovUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hun0kJDKnkUrGRr21Cfn8IRJQWdnA0SuV/DFPULst2o=; b=QdlFCW5x0+88fBX54rkBPlUQ8mwgQcrEtLdM+8ouNSsSa6TsHE8XmJsqVRjKFgBxsUFBOd7UMNG3FMfh9/VLspjXZncMXPK4aYRiqeV++AF1fFhaPygtPgVUNXMP+1y/kcBsR4awNuRMCAnZ4e28z1M1jzpFavFA+l7oaoV0Xjs= Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB5839.eurprd04.prod.outlook.com (2603:10a6:803:e0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.11; Thu, 24 Sep 2020 04:02:26 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::cc01:9fe2:2544:8a4b%7]) with mapi id 15.20.3391.013; Thu, 24 Sep 2020 04:02:26 +0000 From: "Sachin Saxena (OSS)" To: dev@dpdk.org, ferruh.yigit@intel.com Date: Thu, 24 Sep 2020 09:32:05 +0530 Message-Id: <20200924040209.32719-3-sachin.saxena@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200924040209.32719-1-sachin.saxena@oss.nxp.com> References: <20200911083520.24020-1-sachin.saxena@oss.nxp.com> <20200924040209.32719-1-sachin.saxena@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0010.apcprd02.prod.outlook.com (2603:1096:3:17::22) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from lsv03161.swis.in-blr01.nxp.com (14.142.151.118) by SG2PR02CA0010.apcprd02.prod.outlook.com (2603:1096:3:17::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3412.22 via Frontend Transport; Thu, 24 Sep 2020 04:02:24 +0000 X-Mailer: git-send-email 2.28.0 X-Originating-IP: [14.142.151.118] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ead4d376-5ac1-4fad-4a46-08d8603ea5ad X-MS-TrafficTypeDiagnostic: VI1PR04MB5839: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZjV46aoUKCR/uHbAeFZuJ4tJQbZcicX96OrBsGnq1X2C0IlAzZ8OFXXSfFO7t08awXYh+3G45jbZTnKmZSDE1ShU4PwLK1xDEG6a8gUwR6nLic9GfKYjnj+J74QLsIIwCq18wtg/s3KnsRjN7Fr6bB7fpDnB7Q+Jqq5FYbJP0d0/38G3SM0DCkaaZkPN7A9ledI5YEURVgV7fa2SRsC89ibKiy0suqb1eNqkAJd0N6lTnE6EcofORmvUpo1oaiUkBnxEPOtFQ0R7V+Oy9oXBtEDaWmVhsZp/3Ggbusc1dJWTNYs8c4Ejqxt0jz4bS6sZREOzh56qtNhFFuVUmlLRDbBlGy0hyFhtc+2IKdyop/Kw+xlE63Cqvy+mLiNpY0lc X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(346002)(136003)(376002)(39860400002)(2616005)(16526019)(83380400001)(186003)(6666004)(478600001)(26005)(316002)(6486002)(8936002)(1006002)(6512007)(66556008)(55236004)(66946007)(52116002)(1076003)(956004)(86362001)(2906002)(66476007)(8676002)(6506007)(5660300002)(110426005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 2k6WyiSor4oDb9D2ugkQ9eQLuswB/pey2dC6w4lsL2IY/AyklLKD0IpiZMZ82rGVPZRyqbrMbmNQnlQPIrR543nc5q+oshic4+HBKKaCY/6bYPv96QOdBlMLoWxXZfTTTKyexNIqFQhMWnI29Qv69uDj834wYAKtcM7PYJ3qBGTq3xGxGVqusqGyY3a5G+8b3wUCNhc4gFUMGtZUU5qX5Lp2YTCWUl9twFQwhI6KmYfVrvFflIqwwgItL4VN+s7ARuGozcXvduhboLfd1U8VaKSOqSScyRtXCLdHK+IHrXqQuwqJjtoFCsIkK2rkvpqE6r24Om5TyEYQtMY76jtEtDn0FK5zx8ma2r9t0Ahb5uHBOTg+QWl6f1i4irIjhLiqUgpZG/suA4zTR8A8gKQjPFreQByFddxjFb7fUMNAVLVWwtR64/Hol9cYEc2qvTokiiHQW3QLL3Zq/Wem+DPe7/LKRM06mRK9ZhsDYhbNpZs4Q8iuE3Yx2D1AkRgBPR30lcxsG7ZV50JBgX326q1UHmfBqW3DPgRPCCC+Pe0xw2j0219FihK2Ek3Vj/cIX086eNwknMcVbDLOZLpXmntts51rYyVKKUIsamhX5XzehESw3bFDMTAD4F/+Xso2mDyK+vPg4rEwCuaTguHQVUpFaA== X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ead4d376-5ac1-4fad-4a46-08d8603ea5ad X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5837.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2020 04:02:25.8790 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /ShiB5R3dlOyaNNvXCLWT9cm1yNXv+fnHFi2xGuj4Qg3GDkAcEJW8cQSGWCPGhS8ospX5IajQTmrr4YYXKirUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5839 Subject: [dpdk-dev] [PATCH v3 2/6] bus/fslmc: run secondary debug app without blacklist 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Rohit Raj dpaa2 hw impose limits on some HW access devices like DPMCP(Management control Port) and DPIO (HW portal). This causes issue in their shared usages in case of multi-process applications. It can overcome by using whitelist/blacklist in primary and secondary applications. However it imposes restrictions on standard debugging apps like dpdk-procinfo, which can be used to debug any existing application. This patch introduces reserving extra DPMCP and DPIO to be used by secondary process if devices are not blocked previously in primary application. This leaves the last DPMCP and DPIO for the secondary process usages. Signed-off-by: Rohit Raj Signed-off-by: Sachin Saxena --- doc/guides/nics/dpaa2.rst | 14 ++++++++ drivers/bus/fslmc/fslmc_vfio.c | 66 +++++++++++++++++++++++++++++++--- 2 files changed, 75 insertions(+), 5 deletions(-) diff --git a/doc/guides/nics/dpaa2.rst b/doc/guides/nics/dpaa2.rst index fdfa6fdd5..aae14534f 100644 --- a/doc/guides/nics/dpaa2.rst +++ b/doc/guides/nics/dpaa2.rst @@ -538,6 +538,20 @@ For blacklisting a DPAA2 device, following commands can be used. Where x is the device object id as configured in resource container. +Running secondary debug app without blacklist +--------------------------- + +dpaa2 hardware imposes limits on some H/W access devices like Management +Control Port and H/W portal. This causes issue in their shared usages in +case of multi-process applications. It can overcome by using +whitelist/blacklist in primary and secondary applications. + +In order to ease usage of standard debugging apps like dpdk-procinfo, dpaa2 +driver reserves extra Management Control Port and H/W portal which can be +used by debug application to debug any existing application without +blacklisting these devices in primary process. + + Limitations ----------- diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 9134ec552..83df83373 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -802,10 +802,29 @@ fslmc_vfio_process_group(void) int ret; int found_mportal = 0; struct rte_dpaa2_device *dev, *dev_temp; + bool is_dpmcp_in_blocklist = false, is_dpio_in_blocklist = false; + int dpmcp_count = 0, dpio_count = 0, current_device; + + TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) { + if (dev->dev_type == DPAA2_MPORTAL) { + dpmcp_count++; + if (dev->device.devargs && + dev->device.devargs->policy == RTE_DEV_BLACKLISTED) + is_dpmcp_in_blocklist = true; + } + if (dev->dev_type == DPAA2_IO) { + dpio_count++; + if (dev->device.devargs && + dev->device.devargs->policy == RTE_DEV_BLACKLISTED) + is_dpio_in_blocklist = true; + } + } /* Search the MCP as that should be initialized first. */ + current_device = 0; TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) { if (dev->dev_type == DPAA2_MPORTAL) { + current_device++; if (dev->device.devargs && dev->device.devargs->policy == RTE_DEV_BLACKLISTED) { DPAA2_BUS_LOG(DEBUG, "%s Blacklisted, skipping", @@ -815,13 +834,24 @@ fslmc_vfio_process_group(void) continue; } - ret = fslmc_process_mcp(dev); - if (ret) { - DPAA2_BUS_ERR("Unable to map MC Portal"); - return -1; + if (rte_eal_process_type() == RTE_PROC_SECONDARY && + !is_dpmcp_in_blocklist) { + if (dpmcp_count == 1 || + current_device != dpmcp_count) { + TAILQ_REMOVE(&rte_fslmc_bus.device_list, + dev, next); + continue; + } } - if (!found_mportal) + + if (!found_mportal) { + ret = fslmc_process_mcp(dev); + if (ret) { + DPAA2_BUS_ERR("Unable to map MC Portal"); + return -1; + } found_mportal = 1; + } TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next); free(dev); @@ -838,7 +868,10 @@ fslmc_vfio_process_group(void) return -1; } + current_device = 0; TAILQ_FOREACH_SAFE(dev, &rte_fslmc_bus.device_list, next, dev_temp) { + if (dev->dev_type == DPAA2_IO) + current_device++; if (dev->device.devargs && dev->device.devargs->policy == RTE_DEV_BLACKLISTED) { DPAA2_BUS_LOG(DEBUG, "%s Blacklisted, skipping", @@ -846,6 +879,14 @@ fslmc_vfio_process_group(void) TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next); continue; } + if (rte_eal_process_type() == RTE_PROC_SECONDARY && + dev->dev_type != DPAA2_ETH && + dev->dev_type != DPAA2_CRYPTO && + dev->dev_type != DPAA2_QDMA && + dev->dev_type != DPAA2_IO) { + TAILQ_REMOVE(&rte_fslmc_bus.device_list, dev, next); + continue; + } switch (dev->dev_type) { case DPAA2_ETH: case DPAA2_CRYPTO: @@ -882,6 +923,21 @@ fslmc_vfio_process_group(void) break; case DPAA2_IO: + if (!is_dpio_in_blocklist && dpio_count > 1) { + if (rte_eal_process_type() == RTE_PROC_SECONDARY + && current_device != dpio_count) { + TAILQ_REMOVE(&rte_fslmc_bus.device_list, + dev, next); + break; + } + if (rte_eal_process_type() == RTE_PROC_PRIMARY + && current_device == dpio_count) { + TAILQ_REMOVE(&rte_fslmc_bus.device_list, + dev, next); + break; + } + } + ret = fslmc_process_iodevices(dev); if (ret) { DPAA2_BUS_DEBUG("Dev (%s) init failed", -- 2.28.0