From patchwork Wed Apr 25 12:56:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 134280 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp831325lji; Wed, 25 Apr 2018 05:59:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+tGHgGcOLwMl09DmewEFFGeyi8a0JghjPsF4MGdXIW4GDABzp6EsMACyFASMtIVtIHFmVN X-Received: by 10.28.97.139 with SMTP id v133mr15788239wmb.75.1524661151972; Wed, 25 Apr 2018 05:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524661151; cv=none; d=google.com; s=arc-20160816; b=hLjaSBLOCC3UsjHKL2kvsU3rcMWss6EekOi+lgBr1ActMRr70dsqoe0t+LTrVUjeMc 36VlGguBcyNqYCDXzfqINnk25oiOpgHQzrzLNHQWzN2wR+qAW1KYenn/O37tHpPAQwsF DCP9OtCZbaMqJLqeZQYzpCxUcjnteLb0AwoWBc5ZNWt8jsvKtrHTJuoQjCsCF64rYy97 FPqsJKxf/CpVB0bbK2n0eei4eVOKnrPWEJUoRmdXnXyVXbQScmYE4SQwdCY+qaTLQRZa qPIWJAlkPLFE9POoUjfU76/kUlAI3DVTUcVwKRVuxUDrhAIfNE3thfmypPNwU05KhXj2 aM2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:cc:to:from :dkim-signature:arc-authentication-results; bh=UuqzmY5b29VbcdONSWWeZwBbQIEIdGDqbs2355LCeK0=; b=xd54HYWkAQRSDBtk3EvpKgH7S7gHjtckHpPD2IFI046da/c/gkWYD8H3hIsZD9D98f 2AAUe0ss3qXjK72V+5WaxrnzsyoMNCIYcgSjQgMEDEYTtQT1lcG4BCIilkOJTL2Twbl7 PiUYh0RXOpKHhZUDlRPQLZIPAQ0skrLhboG/0eueDznnOxD6lsPmg61Diux1QFwfxv2j cJIN92joDY4VA+yAEbvPnBh3NEuQv9rJiaLd50hs0tpXw4aWbAVpbn8g6ayTE/TCVqSi 5kF40rZYcG7+ZfW+JZ04kqLLvqb7+gSl8Qd6q+kSQ4oV+ISSwIkoeRbgQfa6A6COI5Qv woXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=v/+0m+TJ; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id f18si8668596wmd.171.2018.04.25.05.59.11; Wed, 25 Apr 2018 05:59:11 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=v/+0m+TJ; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 747D96CC1; Wed, 25 Apr 2018 14:59:11 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0053.outbound.protection.outlook.com [104.47.2.53]) by dpdk.org (Postfix) with ESMTP id 063AC5F17 for ; Wed, 25 Apr 2018 14:59:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=UuqzmY5b29VbcdONSWWeZwBbQIEIdGDqbs2355LCeK0=; b=v/+0m+TJTCglKfzRgK/lafEybkQnhZyIbRQptgKiezo4kgH5UMkHREWBI0RrOvahoxK56N8Inyd87N9YAyF5piE8HRaq4p1TtfANO0SjDBfCeBBN52ZY6uBQEVNcomM9IGpA1Ymh4nEK77VdVQZxtxWKppiaeWzKnlF1taQWkkE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by DB4PR04MB0765.eurprd04.prod.outlook.com (2a01:111:e400:984d::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.15; Wed, 25 Apr 2018 12:59:05 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, shreyansh.jain@nxp.com Date: Wed, 25 Apr 2018 18:26:58 +0530 Message-Id: <1524661022-21484-1-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: MAXPR0101CA0035.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::21) To DB4PR04MB0765.eurprd04.prod.outlook.com (2a01:111:e400:984d::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB4PR04MB0765; X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 3:mlkRG6dFMPZxgipJsOgo7YVCBiroGWem3noI+WWIDrLDvpkbljMeq4lAEiED+K82kRfP6I+ERpwJxY1tPaXmdV1tON4DyqLJtChFl0MLKKH5z6VxrwtFctvNw6tGq0zDceUcWutQPevfbGB29WJod1ueC/8vVMcUaQddtaSZuSmG47RUfKUZAWkXbDlamqjzGQBjbJ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QWbtXJ2XVaZFDNoZqE0prZUMkaPkzuM9FFTaECVCKuifc7I6wnIfxnojUNwcwpclj6c4rmzjugRLrywqv27it7pfeT50jl08JX+JhISXM7Y1DQkhUoRqjwdrJ21bq2SLjYybQWX0fwGB5xe8cpcCn61JT0Zg; 4:Zir/9gkpBlDJQkl10f3yLeC1GismKyv+gnm3BdyjB1rsBE0nKK1fy70HeruAsCeB76Rb0W4LG6qlRrAgBa7WVINzL5BJW/Ix8GjCjoiGoAs0ZNgaE4DzutVvZFqzRPJ4F8FD3WzOZNDbJH3iUFSGZrTRSA0zwHjbSbVyDUpzy1o3FNXRcJarK4sTNM3MUrx5A2i5v8Z+ZgeBkKLIQrpDoFUkx/0E0npGAjp41CLf1S4jluRTwiQjDSeCoufTaIkUQg5HKBvjKZuxMpY1gsZAlywAefdPMDmma5gQo/WbiDJ1O+QjZhJr6dmkGteRZXFj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231232)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:DB4PR04MB0765; BCL:0; PCL:0; RULEID:; SRVR:DB4PR04MB0765; X-Forefront-PRVS: 06530126A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39380400002)(346002)(376002)(39860400002)(396003)(366004)(189003)(199004)(3846002)(186003)(26005)(6506007)(956004)(97736004)(2616005)(105586002)(6486002)(5009440100003)(486006)(386003)(52116002)(2351001)(2361001)(51416003)(5660300001)(25786009)(478600001)(2906002)(44832011)(316002)(16586007)(50226002)(47776003)(6666003)(6916009)(36756003)(8936002)(476003)(6512007)(106356001)(6116002)(55236004)(66066001)(53936002)(16526019)(68736007)(4326008)(86362001)(7736002)(81156014)(8676002)(81166006)(50466002)(305945005)(48376002)(110426005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB4PR04MB0765; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB4PR04MB0765; 23:8IT4vz+T20+4SeuCvNPC8gJviAbIeTsW2sOEdip0E?= NuqcRa+zVrOT3WHY+yNj+qpY9GlbNmYvKMjdQbtZ+lO+kyIXfFn5m/hBEIIgMyB1bpK4CSgr5e8LxGbTCBqNotXPvWE2ekpendz2BuVOWJnd8g2RAN3mxHAIyWQwncjScKCgBuGiLidjBC8VR9RAIsgi01FiBaL3aJGTVOP2VYUV+8DKKgRF7M/TwJjMi3ci0U/kF+2gao9IRQvjvP/Hdkl3jNRif6YuYgXtX9D1OD93ruomE2hkKmikViLlDSGpIK/LUWC2I/th5H6vo/FeUDL3H5KZ8FV04IaTS7D8UEnB9U5hbidBEOtwnWRrSHHAIUbLfT+uUeJN05d46FQ/tDql0RyrCHUzoVQU5slRPnvKs3CS+OgIzV8KtoPaEUQXoZWZ34b4Tw+B7fDBqzpiCNW29U33Wj57/2OvHzb5twLDcQsK/Hnp6oFgYIvliLHs1HqtpdvE0tOuREhrXiNU9ZENe8CmbBXIfZEbpthMxJotuuu7eyNXVnPvLMwrPIpM6AWHYf3/5z1tRv9YNGuFdcG7TZ+ASCalul/qk+ZSxe7+8Lz3Dc9IKpiIJuxTWV4RA/Op3rwrAMpVlQ7nqDHWWIHCRduUa2JjYLHhqeM1iYJoAZABeUWBcgoD/TqEoNnPjizts8+RX2EhgXv1iMc0sQo9kUNLbV/4lMerDJRm4//f/OSzdH8llTC6lcUiHU7gMLN73hRbTwDNx9O0yukYI7NLR/9Xa0ELoerGT7XKNrq4oFBmSJu/LtNT+u3R16fkNnfFG+3f+nVwDhW7q47gHghE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u1SGcM/cMdCjazt9oCktoZZxmyIyjJRROvDZbwI7NTCpTeW4/lcIOdmsGADoXzWmyEFNupyhpoZDa+iw==; 5:FRQpTjN73VQ89cMAxwSOihSmDX5d2JQpOsqeSmwbb0w5YvJqVv9MUdc7CNSsnjGedW9O4pRI/yPU9QJmSBmZsAs86YoDFoDrEyZJz6aRPaXL1lDyBm+YJL0o0KwdjnMCupYaP2h88PVYKfSCMPLv7MrCSU3MQ8AWj2cO5DDrHX0=; 24:0OdxFloOHzwR6byH3yVgc7o1ZQ4o5bbZ6xewLpucMkvlkrze7naoA6AgCT0FrXGSNh9g9Hm52KXf2KYbhvybEx6xe1mEicRL0yB/vz069P0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0765; 7:LHqPJYzEM1U9t3MwSeGXwal4oApWbgfXhMlXq9R9u9BZexitoQzghh4RY2EVVmTQcLpSN3fIgKBG+9IC4jt5gDdw1n/anXRCc/KhTAuRnqQdIGhkGMAuk4JOBVFufPrDa151+CxxdtGzrdRPtnXa5dYD8FIvshgC04W66vXw9ijL7VIB+piT6QfEUUulM9036kh4i7/IsA55syq02iuV4dQeO5bNXetGlRBzh//VccMnoGsf0XsYKtWUo6+vYNvp X-MS-Office365-Filtering-Correlation-Id: 3785324f-e85b-40af-aa59-08d5aaac5461 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2018 12:59:05.8170 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3785324f-e85b-40af-aa59-08d5aaac5461 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR04MB0765 Subject: [dpdk-dev] [PATCH 1/5] bus/dpaa: support device blacklisting 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" Signed-off-by: Hemant Agrawal --- doc/guides/cryptodevs/dpaa_sec.rst | 13 +++++ doc/guides/nics/dpaa.rst | 10 ++++ drivers/bus/dpaa/dpaa_bus.c | 101 ++++++++++++++++++++++++++++++------- drivers/bus/dpaa/rte_dpaa_bus.h | 2 - 4 files changed, 106 insertions(+), 20 deletions(-) -- 2.7.4 Acked-by: Shreyansh Jain diff --git a/doc/guides/cryptodevs/dpaa_sec.rst b/doc/guides/cryptodevs/dpaa_sec.rst index 2964e83..9988ee1 100644 --- a/doc/guides/cryptodevs/dpaa_sec.rst +++ b/doc/guides/cryptodevs/dpaa_sec.rst @@ -78,6 +78,19 @@ Supported DPAA SoCs * LS1046A/LS1026A * LS1043A/LS1023A +Whitelisting & Blacklisting +--------------------------- + +For blacklisting a DPAA device, following commands can be used. + + .. code-block:: console + + -b "dpaa_bus:dpaa-secX" -- ... + e.g. "dpaa_bus:dpaa-sec0" + + or to disable all 4 SEC devices + -b "dpaa_sec:dpaa-sec0" -b "dpaa_sec:dpaa-sec1" -b "dpaa_sec:dpaa-sec2" -b "dpaa_sec:dpaa-sec3" + Limitations ----------- diff --git a/doc/guides/nics/dpaa.rst b/doc/guides/nics/dpaa.rst index 0a13996..620c045 100644 --- a/doc/guides/nics/dpaa.rst +++ b/doc/guides/nics/dpaa.rst @@ -162,6 +162,16 @@ Manager. this pool. +Whitelisting & Blacklisting +--------------------------- + +For blacklisting a DPAA device, following commands can be used. + + .. code-block:: console + + -b "dpaa_bus:fmX-macY" -- ... + e.g. "dpaa_bus:fm1-mac4" + Supported DPAA SoCs ------------------- diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index ffc90a7..2b85c9e 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -54,6 +54,8 @@ pthread_key_t dpaa_portal_key; unsigned int dpaa_svr_family; +#define FSL_DPAA_BUS_NAME dpaa_bus + RTE_DEFINE_PER_LCORE(bool, dpaa_io); RTE_DEFINE_PER_LCORE(struct dpaa_portal_dqrr, held_bufs); @@ -129,6 +131,22 @@ dpaa_sec_available(void) static void dpaa_clean_device_list(void); +static struct rte_devargs * +dpaa_devargs_lookup(struct rte_dpaa_device *dev) +{ + struct rte_devargs *devargs; + char dev_name[32]; + + RTE_EAL_DEVARGS_FOREACH("dpaa_bus", devargs) { + devargs->bus->parse(devargs->name, &dev_name); + if (strcmp(dev_name, dev->device.name) == 0) { + DPAA_BUS_INFO("**Devargs matched %s", dev_name); + return devargs; + } + } + return NULL; +} + static int dpaa_create_device_list(void) { @@ -162,6 +180,7 @@ dpaa_create_device_list(void) fman_intf->mac_idx); DPAA_BUS_LOG(DEBUG, "Device added: %s", dev->name); dev->device.name = dev->name; + dev->device.devargs = dpaa_devargs_lookup(dev); dpaa_add_to_device_list(dev); } @@ -198,6 +217,8 @@ dpaa_create_device_list(void) memset(dev->name, 0, RTE_ETH_NAME_MAX_LEN); sprintf(dev->name, "dpaa-sec%d", i); DPAA_BUS_LOG(DEBUG, "Device added: %s", dev->name); + dev->device.name = dev->name; + dev->device.devargs = dpaa_devargs_lookup(dev); dpaa_add_to_device_list(dev); } @@ -357,6 +378,51 @@ dpaa_portal_finish(void *arg) RTE_PER_LCORE(dpaa_io) = false; } +static int +rte_dpaa_bus_parse(const char *name, void *out_name) +{ + int i, j; + int max_fman = 2, max_macs = 16; + char *sep = strchr(name, ':'); + + if (strncmp(name, RTE_STR(FSL_DPAA_BUS_NAME), + strlen(RTE_STR(FSL_DPAA_BUS_NAME)))) { + return -EINVAL; + } + + if (!sep) { + DPAA_BUS_ERR("Incorrect device name observed"); + return -EINVAL; + } + + sep = (char *) (sep + 1); + + for (i = 0; i < max_fman; i++) { + for (j = 0; j < max_macs; j++) { + char fm_name[16]; + snprintf(fm_name, 16, "fm%d-mac%d", i, j); + if (strcmp(fm_name, sep) == 0) { + if (out_name) + strcpy(out_name, sep); + return 0; + } + } + } + + for (i = 0; i < RTE_LIBRTE_DPAA_MAX_CRYPTODEV; i++) { + char sec_name[16]; + + snprintf(sec_name, 16, "dpaa-sec%d", i); + if (strcmp(sec_name, sep) == 0) { + if (out_name) + strcpy(out_name, sep); + return 0; + } + } + + return -EINVAL; +} + #define DPAA_DEV_PATH1 "/sys/devices/platform/soc/soc:fsl,dpaa" #define DPAA_DEV_PATH2 "/sys/devices/platform/fsl,dpaa" @@ -458,22 +524,15 @@ static int rte_dpaa_device_match(struct rte_dpaa_driver *drv, struct rte_dpaa_device *dev) { - int ret = -1; - - BUS_INIT_FUNC_TRACE(); - if (!drv || !dev) { DPAA_BUS_DEBUG("Invalid drv or dev received."); - return ret; + return -1; } - if (drv->drv_type == dev->device_type) { - DPAA_BUS_INFO("Device: %s matches for driver: %s", - dev->name, drv->driver.name); - ret = 0; /* Found a match */ - } + if (drv->drv_type == dev->device_type) + return 0; - return ret; + return -1; } static int @@ -484,8 +543,7 @@ rte_dpaa_bus_probe(void) struct rte_dpaa_driver *drv; FILE *svr_file = NULL; unsigned int svr_ver; - - BUS_INIT_FUNC_TRACE(); + int probe_all = rte_dpaa_bus.bus.conf.scan_mode != RTE_BUS_SCAN_WHITELIST; /* For each registered driver, and device, call the driver->probe */ TAILQ_FOREACH(dev, &rte_dpaa_bus.device_list, next) { @@ -494,13 +552,19 @@ rte_dpaa_bus_probe(void) if (ret) continue; - if (!drv->probe) + if (!drv->probe || + (dev->device.devargs && + dev->device.devargs->policy == RTE_DEV_BLACKLISTED)) continue; - ret = drv->probe(drv, dev); - if (ret) - DPAA_BUS_ERR("Unable to probe.\n"); - + if (probe_all || + (dev->device.devargs && + dev->device.devargs->policy == + RTE_DEV_WHITELISTED)) { + ret = drv->probe(drv, dev); + if (ret) + DPAA_BUS_ERR("Unable to probe.\n"); + } break; } } @@ -557,6 +621,7 @@ struct rte_dpaa_bus rte_dpaa_bus = { .bus = { .scan = rte_dpaa_bus_scan, .probe = rte_dpaa_bus_probe, + .parse = rte_dpaa_bus_parse, .find_device = rte_dpaa_find_device, .get_iommu_class = rte_dpaa_get_iommu_class, }, diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index 89aeac2..8f7e18c 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -15,8 +15,6 @@ #include #include -#define FSL_DPAA_BUS_NAME "FSL_DPAA_BUS" - #define DPAA_MEMPOOL_OPS_NAME "dpaa" #define DEV_TO_DPAA_DEVICE(ptr) \