From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0047.outbound.protection.outlook.com [104.47.41.47]) by dpdk.org (Postfix) with ESMTP id 4A94A7D7F for ; Fri, 18 Aug 2017 14:41:49 +0200 (CEST) Received: from CY1PR03CA0034.namprd03.prod.outlook.com (10.174.128.44) by DM5PR03MB3324.namprd03.prod.outlook.com (10.174.241.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Fri, 18 Aug 2017 12:41:48 +0000 Received: from BY2FFO11FD036.protection.gbl (2a01:111:f400:7c0c::133) by CY1PR03CA0034.outlook.office365.com (2603:10b6:600::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 18 Aug 2017 12:41:48 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.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 BY2FFO11FD036.mail.protection.outlook.com (10.1.14.221) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 18 Aug 2017 12:41:47 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v7ICfeCI028231; Fri, 18 Aug 2017 05:41:45 -0700 From: Shreyansh Jain To: CC: , , Shreyansh Jain Date: Fri, 18 Aug 2017 18:21:23 +0530 Message-ID: <20170818125127.22346-3-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170818125127.22346-1-shreyansh.jain@nxp.com> References: <20170818125127.22346-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131475337078513058; (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)(336005)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(6666003)(76176999)(2950100002)(6916009)(50986999)(85426001)(77096006)(189998001)(68736007)(5003940100001)(305945005)(356003)(86362001)(8936002)(50226002)(8676002)(81156014)(81166006)(106466001)(105606002)(2351001)(36756003)(33646002)(48376002)(50466002)(5660300001)(2906002)(104016004)(8656003)(1076002)(110136004)(97736004)(498600001)(53936002)(54906002)(4326008)(626005)(47776003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR03MB3324; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD036; 1:zG0T0oSrVjkT4lxUC1KPIzzDy7aZ5AAL0pAiI4fGiLWIibi8t4TGOWM5jTtClLbjiwZd28S5VO5tqSlFW6wT/s0WknBRWzTGZ4+y+alOq8YYAlCPC7KeryRDPQOl2vcB MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2806db28-2218-455f-1da2-08d4e6367dc1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603031)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR03MB3324; X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 3:b9UB/g5+NzP6E01guNvxuFpVuLK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vkNpjFaeuRZpYoVOZp1TxcmYjSve/gdNG4pzPbIg8LCYE3QerE7fwzdIlD/FEAbnJoMRX+FmgOfpo+YalhBml1fC6NT4SFJEy2gaNbHnGYMBLf2CilXEPHwV7OvngXb8wXeZ7uJZ2Lne0O7/eQIwYWweze/WGK2+an+l1QMCTMAMhVUB+cjxqN2YX2dwpDGMeclHOafMXZp+c= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6096035)(20161123561025)(20161123565025)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123563025)(20161123559100)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR03MB3324; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR03MB3324; X-Forefront-PRVS: 040359335D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR03MB3324; 23:z+rfLS0jr98iApB7FDOygj3nYtVlMADEO05Uu2phL?= =?us-ascii?Q?HqVf29LTIyyOXzzBv5vQLgGIkW5eCe0EZicpz/6H8S3t4+vr6RbFEdmSQDRU?= =?us-ascii?Q?h+llJ5PN9Ik06jxAgYLvakMaFob07zhBlX0Z+JQTxpK9dIYKpWh/0nh4lWQq?= =?us-ascii?Q?ORoXWQgfIHagcU5F0z3iKZQEENr/a65wcX+HoxiR2uSrHRJhaaqhGnaeY+Am?= =?us-ascii?Q?sIslviDeCLlMO9oWhza/lr2NiKkqNXCT0A1tR6MPshUm46hgnmdhi21wr41l?= =?us-ascii?Q?TsEUJ/HHmpDYZF/DroVM7soa+Rfbse9ETEL9mY51JE2h/mgt10FN5EC+llrB?= =?us-ascii?Q?wjaagsstR8G7QmIv9KDD2K9v1qzhUbHFWYk2oauwoMMIbTgLO9Nv7M0NRVu0?= =?us-ascii?Q?9KVqOhyqyVB9YZTL+1lNl+kli8MoXwNz4HSHqfdpNNdhdMzP2us88l5jQ/so?= =?us-ascii?Q?of1NMg/JQgnlIsBdLhpMLbyVzTEmfFKGf6f0QGH8IYB9JtXbHRUNv3mcthJz?= =?us-ascii?Q?/U8//6RUB+oiqXe/iZkCHUV3TA4VeARmwMRKhPwMSOysF4YXe1jA1uumLpkO?= =?us-ascii?Q?0juvB/gTav5HSZcx+zr9MbMr2fYtpyld3awYhNN33AO82D1BrCB/OWWAcOid?= =?us-ascii?Q?qQORkJHfh4CHr35mS93yA58Zg8roBzFVpUzz3/5u7UDd/C3w4u/9/YtLJSJN?= =?us-ascii?Q?Nbujs6/DGsr7yMXc+5d7L7fw9DBeadxfebEJvHaBSATMpI31qIwr8t9JmIr+?= =?us-ascii?Q?Da55vaqN5keVD9POYP9xHUcWdPqN8RqXNskhnPw63GLs2OJv3Y9mQY4XPjgr?= =?us-ascii?Q?z35v2g6noge7F2u04RxJdqyvnkuULslpLtQU4+iTfJu+F7HGOWXK+9AZMTXX?= =?us-ascii?Q?+ad6UXNNClrLOi/TWG2UZfMtSkXBttN0WaRWR1rn3SKIWjjg1dFfaF6IIuEU?= =?us-ascii?Q?Awh1puGZGlENLsqcA7IY23DmhqlaB6THRdzAMjA/DKQWAd9NuBIWzBbugbNI?= =?us-ascii?Q?+e4LN9TK4EZVtWQhnQ6Jg+F8m9D37ZYf7plPAXV2qCBCRettHBq3A+f3xVJn?= =?us-ascii?Q?2BF1wSclD2SOqH1aRB2TbcS2K2COa3I/T1nKl4zSiNcYpGTTEKQVH7PEqW1B?= =?us-ascii?Q?mg5EY6wmTB3yUQaHCHHy4B20nuy6LTC?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR03MB3324; 6:w8/N+n80pB9aKIn05zs+E3qt9fzHg17vMs3AXUa5YgOWLYNeLIC0jKnv0Nov9StMjCbfxz1mZ+bU2cRaK11uUYbyb1JUtXQVrMbKfZYV/B/U9Decbw6ChmGXrM3fvvLGLcvVuDNzm9p59bPpXsD6kIWCajv6xMZXPT0R4zAWeHIhRyxPPjjaKKZAqo/1L3Ge77tHA4kLH+/YM+Szs5am2S3REf2kHbFPknSqcb6082nvJVu14zkllDDxExlGZVYfoV2tScDurnqS+JI7eynLx+FpB4lFXMQX+CAE0sexhMcEtw2InexDYv3IRDefwCg+vW7hk1SUGb7IdNLFTYg2hw==; 5:A8jBVZ4gC+QD+3epsadBzY+IutuDq9BkZ7GNhwSQDTAiqDPC8i1gEJncjnwd9ZQTtrKQx+vmTPg0Y3o1D+u+88dbRIlORR0qKWPSsljL0OqS7lUwML0uchBW6fDRJrLy82+RJoQ6GJIhJX7gWpF6MQ==; 24:fQdDdHxLYoZShUbUMNGJ8nAyzyCpvzKh5es14ozJ7sGsdhyuG3ovrWHxA9SrCiIhJ9T2NBOFBrDPZUx+ZSl466zc5WpRcqcvsIdqSoOE+T8=; 7:bhzAhfSQ6/EO/yoaUzhIIhfFLW+Fd4427fonpYRH94nlZXkg9lypjfjp4HLp0PQqA/5WZSxLWWND6gfrB4qA3MtVyNmBapYe2BGJbk5EOqxphUEDu0f39syEibpkiOdq0oDbj//sbcGKyXfHAO7GehN4OAJhy5YFwX+njwjbp6FCHddVoVqVD5M/Hgw2eBHYM5nhV2dXVZQVAEphyeADGToHbYxtHJWfky4qviZuP2Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2017 12:41:47.6641 (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: DM5PR03MB3324 Subject: [dpdk-dev] [PATCH 2/6] bus/fslmc: introduce new device type enumerator 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, 18 Aug 2017 12:41:49 -0000 Existing devices and drivers depended on device ID rather than type. A new enumerator for all DPAA2 devices is introduced in this patch. At this point, the probe would not be able to link DPAA2 devices with the driver and I/O would not work. Subsequent patches will fix this. Signed-off-by: Shreyansh Jain --- drivers/bus/fslmc/fslmc_vfio.c | 6 +++--- drivers/bus/fslmc/rte_bus_fslmc_version.map | 7 +++++++ drivers/bus/fslmc/rte_fslmc.h | 24 ++++++++++++++++++++---- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 3423b57..3b452e1 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -288,8 +288,8 @@ 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 != DPAA2_MC_DPNI_DEVID || - dev->dev_type != DPAA2_MC_DPSECI_DEVID) + if (dev->dev_type != DPAA2_ETH || + dev->dev_type != DPAA2_CRYPTO) return -1; if (dev->object_id == dev2->object_id) @@ -506,7 +506,7 @@ int fslmc_vfio_process_group(void) /* 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; + DPAA2_ETH : DPAA2_CRYPTO; sprintf(dev->name, "%s.%d", object_type, object_id); dev->device.name = dev->name; diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map index 3cdf14e..6ac256d 100644 --- a/drivers/bus/fslmc/rte_bus_fslmc_version.map +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -77,3 +77,10 @@ DPDK_17.08 { rte_global_active_dqs_list; } DPDK_17.05; + +DPDK_17.11 { + global: + + rte_dpaa2_dev_type; + +} DPDK_17.08; diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h index e60d6eb..ff7a49e 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -56,6 +56,8 @@ extern "C" { #include #include +#define FSLMC_OBJECT_MAX_LEN 32 /**< Length of each device on bus */ + struct rte_dpaa2_driver; /* DPAA2 Device and Driver lists for FSLMC bus */ @@ -64,6 +66,20 @@ TAILQ_HEAD(rte_fslmc_driver_list, rte_dpaa2_driver); extern struct rte_fslmc_bus rte_fslmc_bus; +enum rte_dpaa2_dev_type { + /* Devices backed by DPDK driver */ + DPAA2_ETH, /**< DPNI type device*/ + DPAA2_CRYPTO, /**< DPSECI type device */ + DPAA2_CON, /**< DPCONC type device */ + /* Devices not backed by a DPDK driver: DPIO, DPBP, DPCI, DPMCP */ + DPAA2_BPOOL, /**< DPBP type device */ + DPAA2_IO, /**< DPIO type device */ + DPAA2_CI, /**< DPCI type device */ + DPAA2_MPORTAL, /**< DPMCP type device */ + /* Unknown device placeholder */ + DPAA2_UNKNOWN +}; + /** * A structure describing a DPAA2 device. */ @@ -74,11 +90,11 @@ struct rte_dpaa2_device { struct rte_eth_dev *eth_dev; /**< ethernet device */ struct rte_cryptodev *cryptodev; /**< Crypto Device */ }; - uint16_t dev_type; /**< Device Type */ - uint16_t object_id; /**< DPAA2 Object ID */ + enum rte_dpaa2_dev_type dev_type; /**< Device Type */ + uint16_t object_id; /**< DPAA2 Object ID */ struct rte_intr_handle intr_handle; /**< Interrupt handle */ struct rte_dpaa2_driver *driver; /**< Associated driver */ - char name[32]; /**< DPAA2 Object name*/ + char name[FSLMC_OBJECT_MAX_LEN]; /**< DPAA2 Object name*/ }; typedef int (*rte_dpaa2_probe_t)(struct rte_dpaa2_driver *dpaa2_drv, @@ -93,7 +109,7 @@ struct rte_dpaa2_driver { struct rte_driver driver; /**< Inherit core driver. */ struct rte_fslmc_bus *fslmc_bus; /**< FSLMC bus reference */ uint32_t drv_flags; /**< Flags for controlling device.*/ - uint16_t drv_type; /**< Driver Type */ + enum rte_dpaa2_dev_type drv_type; /**< Driver Type */ rte_dpaa2_probe_t probe; rte_dpaa2_remove_t remove; }; -- 2.9.3