From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0055.outbound.protection.outlook.com [104.47.33.55]) by dpdk.org (Postfix) with ESMTP id DE6AA2BD0 for ; Thu, 10 Nov 2016 07:08:02 +0100 (CET) Received: from CY4PR03CA0006.namprd03.prod.outlook.com (10.168.162.16) by CY4PR03MB2741.namprd03.prod.outlook.com (10.173.38.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.679.12; Thu, 10 Nov 2016 06:08:01 +0000 Received: from BN1AFFO11FD017.protection.gbl (2a01:111:f400:7c10::142) by CY4PR03CA0006.outlook.office365.com (2603:10b6:903:33::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.12 via Frontend Transport; Thu, 10 Nov 2016 06:08:01 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; linaro.org; dkim=none (message not signed) header.d=none;linaro.org; 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 BN1AFFO11FD017.mail.protection.outlook.com (10.58.52.77) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.707.3 via Frontend Transport; Thu, 10 Nov 2016 06:08:00 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:1071; Count:13 Received: from [10.232.14.87] ([10.232.14.87]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id uAA67v7s011030; Wed, 9 Nov 2016 23:07:58 -0700 To: Jianbo Liu References: <1477581467-12588-1-git-send-email-shreyansh.jain@nxp.com> <1477657598-826-1-git-send-email-shreyansh.jain@nxp.com> <1477657598-826-12-git-send-email-shreyansh.jain@nxp.com> CC: , Thomas Monjalon , Jan Viktorin From: Shreyansh Jain Message-ID: <9e25635b-a7cc-8ba3-76a2-ed906774e4ef@nxp.com> Date: Thu, 10 Nov 2016 11:40:17 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131232316811074996; (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)(2980300002)(1109001)(1110001)(339900001)(189002)(377454003)(199003)(24454002)(4001350100001)(2906002)(92566002)(97736004)(4326007)(68736007)(86362001)(31696002)(64126003)(8936002)(189998001)(6666003)(77096005)(65806001)(65956001)(2950100002)(6916009)(110136003)(47776003)(626004)(65826007)(586003)(23676002)(5660300001)(33646002)(36756003)(31686004)(81166006)(83506001)(81156014)(93886004)(8676002)(87936001)(104016004)(85426001)(5890100001)(7846002)(106466001)(105606002)(356003)(50466002)(230700001)(54356999)(229853002)(76176999)(50986999)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2741; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD017; 1:Jm6R5LQCto3eN93LlEbcOQyDvZZ3Hpy6DZVNs3PPUsRoGC8syJ7SDqidPTA9buwDfEkIioK9fwi1KgdrAs48UucO758Y7oAsajLMrhMqP/N5FsN0WNS9UsY43NfJh6SDzt+J2DYKQl8EBX0Lvm9uXn0Rz7BUtBCAJGT8x9aoCSojZ0OHph80kbWpVvS+8dMMHwlbRvy2RWnRQgaGM3hiKYTCmLJyHLQtAzqZyqguul/1Z5nhqXBw6Zc1y4kbaaSpYU01YDdfrvEJ7/BOFeQuYOXnuV7oZ3tB6yeubvzuYssaBtieZ32vWECp4+VDDGb2etZdPCgim+fbo566EFiNH2lNjdA50SB+SLQlVpPEk0ypX9RHE9kk94ITjpqNlOZy2TzPN6W6vYyFzcIudS9eEsqAn3fnAQawOi/sL2s0EEgc3uPxRgTY1ZM0Tf2PAiL4fQ2WqxAR+abBuS8NhYm35DUKehSFZjo4XPgB4qjbY0yH/8mqRUF3kq/zKuPf738alOvRUDMfFdZeZRwIDtK9rieocKqv4YGTboponN9djgHRFrz2jV7UPzC+8KC1N+wSCp/vCIPpGJjBM8WuOVirhRK6vpEUrN1fYZgVSr2jnsU= X-MS-Office365-Filtering-Correlation-Id: 0ed32c26-703e-4af0-52ac-08d4092fecf7 X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2741; 2:qMfpZdmcoD2mKuCyfXWNMhuh7Q6jhBNHlSNU71gi09nQAtiUUwb0QANrRm5NyoOggZq38d/+AchRZ4rTifpCgdFNsOAvpgdUD1UY/0zTLAx+LbCPIm+x+L9ZRhGe/ZPhrkpAb5x5b22JIwLxPtVNSehuAFQD8QetEfGlS587qJLWyul6CQOXLqRZiRu4bZ4vTFCjp4SUP9aBGiETgVAfBA==; 3:3crgy+usm04MDt3sUxDb3RO2S4r6z9IkNYrk99m6De7gFkUZ3knxyABUGT4VQdcLwi/464uyAVzJmcCjyfLA/qWp96R3GSUOEAEba5dT/0YcqcWYoCZglg1E7XsXLChz4O8CvU51gQtaMoA8ote5ps7kgzS+/eoXLeVOeC+1elz6enBD+BzXhmQrtbepNpPWSaae0IHaw2P3jNEUtVZlHNzv9XQN3zFKseUyKCaCFo33d3F9W/xB8F4cuaRx5cMl X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR03MB2741; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2741; 25:Les6rZk+ZZvTFitfOKgCdNjWYWf5wZ91c1W5GjGZXy4uA3bTdQIPdWrhS6LknGMlv1FvPVo022hhF+ZPnapSDezulymCzYfPUJYHF7e2hHWDeg4SKJC7txiBKH6e/Wl993LXxrOzOukuSIhpUGSsXBhtcSJ5tCeCTznDdO2fIAJKMmbY6bv/DTumUDiFN4h8eSQHNCzVzU7rNfs952xIe0482BYaqzDD/zK/4RKLHAwIedDJVDYxLbGuWYMeDaUe0tvIyU+5+z5ZCHgUO+XFRVYq6lX0B9wy0a3eFPbCeVUHUHMf3FfHfuucAh/jXyJz1bqeyH/W/fpFZ1XSLKY81trbIP8hhIba9wOODVWheE1/4H4xTwbc+oAkOtIXc0+UI7P6IPxcqBTDiFS0Ljn5AsP/Vw9QTchCdqNtbYQHM4Ahv/1EiwFPUzM3IzugsejV+Qbivv8sFKoT1OkJUsDDzw==; 31:oq8+Y0Hr4okbq6e8Mqe0cgE0hKsccZcOkBjOw2Y/TEN9comJIwTA6tfUqkhGc9f6eAYHPW/CDc6cnN/3eFls3Ct58mSUmdAlD0ROQMUZQjeRBvA9vYpzDxZxjaeFjSyoDleT++7EK1HcyQcrvlurW2F0YtbJRK7IZwRVOQlfTSfsE/67+fN7nFbOMdIgLzX+z0Un8Yu0cloM6jYR9+nFINdcviPRCw+hqenb7zD+4HcGV0H7pQ6J9+NDiVZ20p5lB1Qsm+nUgnlMbVMwOB+gnw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(13018025)(5005006)(13023025)(13024025)(13015025)(13017025)(10201501046)(3002001)(6055026); SRVR:CY4PR03MB2741; BCL:0; PCL:0; RULEID:(400006); SRVR:CY4PR03MB2741; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2741; 4:oEZKaDFLV6uytJNzsBlWw5g7BBheH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k9vbwyvwGISya4Ci00r19osEhDYuTSQabq7EUXKCj3gIxSX8wJ/dITDDXV8rtxTEloKpfELFMLe79G5Eau4MC88i0Z/1OgMLjqJMrzNByx9L+yDjISl; 24:8YzS9a+fGR53xugWy+YCo9v3xK6EdVUETa0k7k4lgqYqn0wsfDU68rUQtQExVj9i83NXBtNIeldwm0OcnDPAwsWfUhd0rsh74bgFnqPNWdE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2741; 7:Dz3yj6RjCrjjf0L5763dIbh+hWAphKBhc259TsrbO26vx8SijdWJAsNsiPNcieQoz+u2wXUjcFtEt4leMeEYPjug9aKFhjKWmQ50u83zVYmpyrvdZV+WfOqNw4u12KxCr6VcHQrxHYc2ix9dwSyhueIKF0j5MWFRw8nhfoKai2749GEGQX7qR5RhYoX4BUlNfhn5xC81rGj6/xs6sVYG1z2AMVN6Q/dNlEXnCXoIxPgmDytigaeRd0WG0WWifda0lKifczATAzQK/h55ifxxKW1aDmsS7+pmXeE295vrMY4PzXKF9x/Lr1AcnCxep4khxKl/GUSALKAooUL97/eatGLhv+yXMMn4klQD/kXwrFk= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2016 06:08:00.8110 (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: CY4PR03MB2741 Subject: Re: [dpdk-dev] [PATCH v7 11/21] eal/soc: implement probing of drivers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Nov 2016 06:08:03 -0000 On Thursday 10 November 2016 09:00 AM, Jianbo Liu wrote: > On 28 October 2016 at 20:26, Shreyansh Jain wrote: >> Each SoC PMD registers a set of callback for scanning its own bus/infra and >> matching devices to drivers when probe is called. >> This patch introduces the infra for calls to SoC scan on rte_eal_soc_init() >> and match on rte_eal_soc_probe(). >> >> Patch also adds test case for scan and probe. >> >> Signed-off-by: Jan Viktorin >> Signed-off-by: Shreyansh Jain >> Signed-off-by: Hemant Agrawal >> -- >> v4: >> - Update test_soc for descriptive test function names >> - Comments over test functions >> - devinit and devuninint --> probe/remove >> - RTE_VERIFY at some places >> --- >> app/test/test_soc.c | 205 ++++++++++++++++++++++- >> lib/librte_eal/bsdapp/eal/rte_eal_version.map | 4 + >> lib/librte_eal/common/eal_common_soc.c | 213 +++++++++++++++++++++++- >> lib/librte_eal/common/include/rte_soc.h | 75 ++++++++- >> lib/librte_eal/linuxapp/eal/eal.c | 5 + >> lib/librte_eal/linuxapp/eal/eal_soc.c | 21 ++- >> lib/librte_eal/linuxapp/eal/rte_eal_version.map | 4 + >> 7 files changed, 519 insertions(+), 8 deletions(-) >> > ...... > >> /** >> + * SoC device scan callback, called from rte_eal_soc_init. >> + * For various SoC, the bus on which devices are attached maynot be compliant >> + * to a standard platform (or platform bus itself). In which case, extra >> + * steps are implemented by PMD to scan over the bus and add devices to SoC >> + * device list. >> + */ >> +typedef void (soc_scan_t)(void); > > I'm still not sure about the purpose of soc_scan, and how to use it. For each device to be used by DPDK, which cannot be scanned/identified using the existing PCI/VDEV methods (sysfs/bus/pci), 'soc_scan_t' provides a way for driver to make those devices part of device lists. Ideally, 'scan' is not a function of a driver. It is a bus function - which is missing in this case. > If it's for each driver, it should at least struct rte_soc_driver * as > its parameter. Its for each driver - assuming that each non-PCI driver which implements it knows how to find devices which it can control (for example, special area in sysfs, or even platform bus). > If it's for each bus, why it is in rte_soc_driver? Short answer - lack of a better place. It should be in dev.h probably (rte_device/driver) but it would look out of place (as that represents PCI devices also which cannot implement it - all PCI devices are scanned in one go irrespective of driver) > I know you will implement bus driver in the future, but we need to > make it clear for current simplified implementation. Current implementation makes only a single assumption - that rather than relying on EAL for identifying devices (as being done now), next best option in existing framework (driver) should have control of finding devices. This is primarily to make the SoC work parallel to PCI implementation without much top-down changes in EAL. Bus model, improvises it by moving this implementation a little above in hierarchy - in rte_bus<-rte_driver<-PMD. I understand your apprehension - 'driver-scanning-for-devices' is indeed not correct real world analogy. It is just a place holder for enabling those drivers/PMDs which cannot work in absence of the right model. And that is still work in progress. > >> + >> +/** >> + * Custom device<=>driver match callback for SoC >> + * Unlike PCI, SoC devices don't have a fixed definition of device >> + * identification. PMDs can implement a specific matching function in which >> + * driver and device objects are provided to perform custom match. >> + */ >> +typedef int (soc_match_t)(struct rte_soc_driver *, struct rte_soc_device *); >> + >> +/** >> * A structure describing a SoC driver. >> */ >> struct rte_soc_driver { >> @@ -104,6 +120,8 @@ struct rte_soc_driver { >> struct rte_driver driver; /**< Inherit core driver. */ >> soc_probe_t *probe; /**< Device probe */ >> soc_remove_t *remove; /**< Device remove */ >> + soc_scan_t *scan_fn; /**< Callback for scanning SoC bus*/ >> + soc_match_t *match_fn; /**< Callback to match dev<->drv */ >> const struct rte_soc_id *id_table; /**< ID table, NULL terminated */ >> }; >> >> @@ -146,12 +164,63 @@ rte_eal_compare_soc_addr(const struct rte_soc_addr *a0, >> } >> >> /** >> + * Default function for matching the Soc driver with device. Each driver can >> + * either use this function or define their own soc matching function. >> + * This function relies on the compatible string extracted from sysfs. But, >> + * a SoC might have different way of identifying its devices. Such SoC can >> + * override match_fn. >> + * >> + * @return >> + * 0 on success >> + * -1 when no match found >> + */ >> +int >> +rte_eal_soc_match_compat(struct rte_soc_driver *drv, >> + struct rte_soc_device *dev); >> + >> +/** >> + * Probe SoC devices for registered drivers. >> + * >> + * @return >> + * 0 on success >> + * !0 in case of any failure in probe >> + */ >> +int rte_eal_soc_probe(void); >> + >> +/** >> + * Probe the single SoC device. >> + */ >> +int rte_eal_soc_probe_one(const struct rte_soc_addr *addr); >> + >> +/** >> + * Close the single SoC device. >> + * >> + * Scan the SoC devices and find the SoC device specified by the SoC >> + * address, then call the remove() function for registered driver >> + * that has a matching entry in its id_table for discovered device. >> + * >> + * @param addr >> + * The SoC address to close. >> + * @return >> + * - 0 on success. >> + * - Negative on error. >> + */ >> +int rte_eal_soc_detach(const struct rte_soc_addr *addr); >> + >> +/** >> * Dump discovered SoC devices. >> + * >> + * @param f >> + * File to dump device info in. >> */ >> void rte_eal_soc_dump(FILE *f); >> >> /** >> * Register a SoC driver. >> + * >> + * @param driver >> + * Object for SoC driver to register >> + * @return void >> */ >> void rte_eal_soc_register(struct rte_soc_driver *driver); >> >> @@ -167,6 +236,10 @@ RTE_PMD_EXPORT_NAME(nm, __COUNTER__) >> >> /** >> * Unregister a SoC driver. >> + * >> + * @param driver >> + * Object for SoC driver to unregister >> + * @return void >> */ >> void rte_eal_soc_unregister(struct rte_soc_driver *driver); >> >> diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c >> index 098ba02..bd775f3 100644 >> --- a/lib/librte_eal/linuxapp/eal/eal.c >> +++ b/lib/librte_eal/linuxapp/eal/eal.c >> @@ -70,6 +70,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -890,6 +891,10 @@ rte_eal_init(int argc, char **argv) >> if (rte_eal_pci_probe()) >> rte_panic("Cannot probe PCI\n"); >> >> + /* Probe & Initialize SoC devices */ >> + if (rte_eal_soc_probe()) >> + rte_panic("Cannot probe SoC\n"); >> + >> rte_eal_mcfg_complete(); >> >> return fctret; >> diff --git a/lib/librte_eal/linuxapp/eal/eal_soc.c b/lib/librte_eal/linuxapp/eal/eal_soc.c >> index 04848b9..3929a76 100644 >> --- a/lib/librte_eal/linuxapp/eal/eal_soc.c >> +++ b/lib/librte_eal/linuxapp/eal/eal_soc.c >> @@ -44,13 +44,28 @@ >> #include >> #include >> >> -#include "eal_internal_cfg.h" >> -#include "eal_filesystem.h" >> -#include "eal_private.h" >> +#include >> +#include >> +#include >> >> /* Init the SoC EAL subsystem */ >> int >> rte_eal_soc_init(void) >> { >> + struct rte_soc_driver *drv; >> + >> + /* SoC is disabled by default */ >> + if (!internal_config.enable_soc) >> + return 0; >> + >> + /* For each registered driver, call their scan routine to perform any >> + * custom scan for devices (for example, custom buses) >> + */ >> + TAILQ_FOREACH(drv, &soc_driver_list, next) { >> + RTE_VERIFY(drv->scan_fn); >> + drv->scan_fn(); >> + /* Ignore all errors from this */ >> + } >> + >> return 0; >> } >> diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map >> index 0155025..c28e093 100644 >> --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map >> +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map >> @@ -175,7 +175,11 @@ DPDK_16.11 { >> rte_eal_dev_attach; >> rte_eal_dev_detach; >> rte_eal_map_resource; >> + rte_eal_soc_detach; >> rte_eal_soc_dump; >> + rte_eal_soc_match; >> + rte_eal_soc_probe; >> + rte_eal_soc_probe_one; >> rte_eal_soc_register; >> rte_eal_soc_unregister; >> rte_eal_unmap_resource; >> -- >> 2.7.4 >> > -- - Shreyansh