From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0051.outbound.protection.outlook.com [104.47.37.51]) by dpdk.org (Postfix) with ESMTP id C41841B1A3 for ; Mon, 8 Jan 2018 14:55:23 +0100 (CET) Received: from BLUPR0301CA0035.namprd03.prod.outlook.com (10.162.113.173) by CY4PR03MB2695.namprd03.prod.outlook.com (10.173.43.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Mon, 8 Jan 2018 13:55:22 +0000 Received: from BY2FFO11FD008.protection.gbl (2a01:111:f400:7c0c::175) by BLUPR0301CA0035.outlook.office365.com (2a01:111:e400:5259::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Mon, 8 Jan 2018 13:55:22 +0000 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 BY2FFO11FD008.mail.protection.outlook.com (10.1.14.159) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Mon, 8 Jan 2018 13:54:51 +0000 Received: from [10.232.14.39] ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w08DtI8w000525; Mon, 8 Jan 2018 06:55:19 -0700 To: "Trahe, Fiona" References: <20180102125749.2379-1-shreyansh.jain@nxp.com> <20180102125749.2379-2-shreyansh.jain@nxp.com> <348A99DA5F5B7549AA880327E580B435892EFE92@IRSMSX101.ger.corp.intel.com> From: Shreyansh Jain CC: Hemant Agrawal , "Xu, Rosen" , "dev@dpdk.org" Message-ID: Date: Mon, 8 Jan 2018 19:39:36 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <348A99DA5F5B7549AA880327E580B435892EFE92@IRSMSX101.ger.corp.intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131598932918305451; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(346002)(39380400002)(39860400002)(396003)(2980300002)(1109001)(1110001)(339900001)(3190300001)(199004)(189003)(24454002)(6246003)(5660300001)(67846002)(65956001)(64126003)(65826007)(6666003)(229853002)(2906002)(4326008)(2950100002)(76176011)(6916009)(2486003)(65806001)(36756003)(50466002)(97736004)(23676004)(104016004)(47776003)(106466001)(356003)(54906003)(68736007)(58126008)(83506002)(8676002)(81166006)(31696002)(53936002)(31686004)(8936002)(86362001)(77096006)(230700001)(81156014)(8656006)(498600001)(305945005)(316002)(105606002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2695; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD008; 1:KmoN7H3kFbTButLtyMNDjeo0PIe61ob61U8SrPWkNB/+t0rWhwcdG8gILZiXGUTktBx1PqWOr1n8SAMZzgL8z/otQNdMddie84x2QEiSnGgc4XvIUQtxlvsFq4AWCVIn X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dc05a851-c3ca-4bc6-82ab-08d5569f63e1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:CY4PR03MB2695; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2695; 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vi0BRtbAyZM02eBqYI1v0VjtlGQOt4Pvwbg0RkJmpFr9KgWpyu3F/lkExCX/4OXVT6DS9nz2TpfxjI9Dl61qOOifnWyj9hSZHGhTfR/WhMm8Uz8bQic7vy6mGzbnE+50ykAXh/vjO0Xo11RfPj7B45SgZRAs5L1Y8toZhz3l86Vg0xIyVvhhpgPrmp66M1wTkGoLvX0vBPOtdz1waIQQWADRsKa2L5Mh+h7edVMlRLrLYSa/fW/g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(3231023)(944510075)(944921075)(946801075)(946901075)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123556025)(20161123561025)(20161123563025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123559100)(201708071742011); SRVR:CY4PR03MB2695; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY4PR03MB2695; X-Forefront-PRVS: 054642504A X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTRQUjAzTUIyNjk1OzIzOldOV1o4OVV5cWxHcHpEb1VjZC9nbzhWUWhz?= =?utf-8?B?cVlrcDExdis3MUN4amJMTmhQTFZ5M0dEbnNnRHd1bVpIb2Q2WkVXVDN1NGdT?= =?utf-8?B?YWFIbE1PWmtidmt4anlBL0czRXRXRXJ5WWhOSXMzY0QyY2R0UXNyb2IxcUZJ?= =?utf-8?B?MC8vOXhIUGt5alN6eVFody9tQjdTdWQxMmVpRWNsYjFKOW9ObUYzWFlDbEhm?= =?utf-8?B?WE83TlptT0RBak04d0Y1QWozeHlkOFBTRVY4NVhQZG1FV2JjTnRoMW1xUW5u?= =?utf-8?B?ZHpIWkYvNUVGUXZlbTFNUzI1bU8vd2lEWnkxRDRwVHNqVmFCbWV1MkpUTEt4?= =?utf-8?B?QWNaajJoUjRmdG5FU3kxR0RZ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yj5/6HdEPj0og+3/QdVoovgNBNiYcBLAmdrD9DEdXUam1v6/BhenCdSijTcOQobyo/anYNunNjj8KQ7Iomk46KrmZCim+4ee4J8oCdp0JeBTeY18YeRMctXSE=; 24:oThleG0ZH5zyNZqnKtnuXHtZ/6SLyOGfXnK2sQdc4cOsIdBXovNftjYxj7dLZIIM/kqpjKnWv8lfhPHgr9AYL0A6JLLIS6OiWppMnS6KUFo=; 7:9tQO41QuZpGKgssSTgGDTYhW/NTdlN1oZ3WEgSbUWOf205VyNomjDdr9JxCE+lZ6wtGJAFFvlYWq8rHQVdTvSRSSom//xICwxp5MjZHV/K/D0mawIGfy1RIN7S4bcFloBrJUYR3xTQdhc1zL2zTyNZoUMMvk2FS8pRLBYN8IbKrXkCbguVBBO76bzYgMicXWNiyLUd+bh/B8eAgh3p71dy1nhFbP6U+XfqMQQ7RLvu1iHoP9xxCCPqklsiY6IfPs SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jan 2018 13:54:51.5965 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc05a851-c3ca-4bc6-82ab-08d5569f63e1 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: CY4PR03MB2695 Subject: Re: [dpdk-dev] [PATCH v1 1/5] rawdev: introduce raw device library support 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, 08 Jan 2018 13:55:24 -0000 Hello Fiona, On Saturday 06 January 2018 07:10 PM, Trahe, Fiona wrote: > Hi Shreyansh, > > This looks like a useful generic device, thanks. Some comments below. Thanks for taking interest and sending your review. I have some responses inline.... (And I have shortened the original email) [...] >> +#include "rte_rawdev.h" >> +#include "rte_rawdev_pmd.h" >> + >> +/* dynamic log identifier */ >> +int librawdev_logtype; >> + >> +/* Maximum rawdevices supported by system. >> + */ >> +#define RTE_MAX_RAWDEVPORTS 10 > [Fiona] Typo in comment above? There's RTE_RAWDEV_MAX_DEVS, RTE_MAX_RAWDEVS and RTE_MAX_RAWDEVPORTS. Are all 3 necessary and what's the relationship between ports and devs? This is a stupid mistake by me. It should be only RTE_RAWDEV_MAX_DEVS. RTE_MAX_RAWDEVS is useless and I will remove RTE_MAX_RAWDEVPORTS. They are intend the same thing - number of max devices supported. > [...] >> + >> +/** >> + * Allocate and set up a raw queue for a raw device. >> + * >> + * @param dev_id >> + * The identifier of the device. >> + * @param queue_id >> + * The index of the raw queue to setup. The value must be in the range >> + * [0, nb_raw_queues - 1] previously supplied to rte_rawdev_configure(). >> + * >> + * @see rte_rawdev_queue_conf_get() >> + * >> + * @return >> + * - 0: Success, raw queue correctly set up. >> + * - <0: raw queue configuration failed >> + */ > [Fiona] cut and paste error above - should be release. Indeed. Thanks for pointing out. I will fix this. > >> +int >> +rte_rawdev_queue_release(uint16_t dev_id, uint16_t queue_id); >> +/** >> + * Get the number of raw queues on a specific raw device >> + * >> + * @param dev_id >> + * Raw device identifier. >> + * @return >> + * - The number of configured raw queues >> + */ >> +uint16_t [...] >> + >> +/** >> + * Allocates a new rawdev slot for an raw device and returns the pointer >> + * to that slot for the driver to use. >> + * >> + * @param name >> + * Unique identifier name for each device >> + * @dev_priv_size >> + * Private data allocated within rte_rawdev object. >> + * @param socket_id >> + * Socket to allocate resources on. >> + * @return >> + * - Slot in the rte_dev_devices array for a new device; >> + */ >> +struct rte_rawdev * >> +rte_rawdev_pmd_allocate(const char *name, size_t dev_private_size, >> + int socket_id); > [Fiona] The driver must allocate a unique name for each device, and the application presumably must search through all devices using dev_count and dev_info_get for each > until it finds a name it expects? But will the application always know the name chosen by the PMD? e.g. driver type xyz might find 10 devices and call them xyz_0, xyz_1, xyz_2, etc > The application wants to look for any or all xyz devices so must know the naming format used by the PMD. > Would it be useful to have 2 parts to the name, a type and an instance, to facilitate finding all devices of a specific type? let me state what I have understood: There are two types of devices: 1. which are scanned through a bus (PCI ...) 2. which are created through vdev (devargs, vdev_init) for those which are scanned through a bus, it is easy to append a "type_" string during device naming. for those which are added through command line, this pattern would have to be choosen by the application/user. further, a rawdevice doesn't have a specific type. So, type would be purely be defined by the driver (scan) or the device name itself (vdev_init). So, eventually the "type_" field would be left out for driver or application to decide. framework (lib/librte_rawdev) would never override/append to it. Is this understanding correct? I will send a v2 shortly with your comments. I will also try and think through your suggestion about name containing "type_" - I do think it is useful but not really sure how would it define semantics between driver and application. - Shreyansh