From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0080.outbound.protection.outlook.com [104.47.32.80]) by dpdk.org (Postfix) with ESMTP id 1ABAA914 for ; Thu, 10 Nov 2016 09:36:23 +0100 (CET) Received: from DM2PR03CA0041.namprd03.prod.outlook.com (10.141.96.40) by BN6PR03MB2737.namprd03.prod.outlook.com (10.173.144.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.16; Thu, 10 Nov 2016 08:36:22 +0000 Received: from BL2FFO11OLC016.protection.gbl (2a01:111:f400:7c09::101) by DM2PR03CA0041.outlook.office365.com (2a01:111:e400:2428::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6 via Frontend Transport; Thu, 10 Nov 2016 08:36:22 +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 BL2FFO11OLC016.mail.protection.outlook.com (10.173.160.82) 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 08:36:21 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:889; 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 uAA8aIUQ008877; Thu, 10 Nov 2016 01:36:19 -0700 To: Jianbo Liu References: CC: David Marchand , "dev@dpdk.org" From: Shreyansh Jain Message-ID: Date: Thu, 10 Nov 2016 14:08:38 +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: 131232405816995612; (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)(377454003)(189002)(199003)(24454002)(50466002)(6916009)(2950100002)(97736004)(6666003)(4001350100001)(31686004)(85426001)(305945005)(7846002)(68736007)(356003)(65806001)(87936001)(65956001)(76176999)(50986999)(54356999)(33646002)(47776003)(229853002)(36756003)(189998001)(230700001)(64126003)(86362001)(31696002)(8676002)(105606002)(83506001)(586003)(2906002)(65826007)(626004)(4326007)(5660300001)(81156014)(81166006)(8936002)(106466001)(92566002)(110136003)(23676002)(104016004)(77096005)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2737; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11OLC016; 1:JbJDPwW95p5BygpOcVlDxEm84s5X0nw6+FVlu0eSTK51AIhduPGSSUIMrZScZmILTa3CUcELvCKSbdbz2iqfX0kSC7ddAsygEAmd5gUr55eRQlqwY7aSVDgskdD7rr4DRsHmciiAikaTruT2joFlkXhWcsDPfEgBk0plxJBXWT21wtfxOMs1dBLiabAYkOsh4BAwNGhYSDVePhVOzaBkcLnI6epmajdJmHctGYYKvcMLATH1DX3Wodn/rWmY7aORjkwY6dWdMeovWR3eVSiCi+I9rcroBaD161/wFd4bqEPlPtIEi/Ca+A5a7Cp2bRbC1Vm9c6fF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fpjb9FyII/u2qMXDpCdhnaM406TlOTxJJlNxZBCk5vhwfVi5hkpu6+7chKzwFvVaFK6vmv6qqtqEI4sEvcCFul8GP45WIj9YGLoMH7La2KsSasSZwdTHTdaupNVbBCO0yLmkCskVMF+N7qGClO 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)(13024025)(13018025)(13015025)(13023025)(13017025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:BN6PR03MB2737; BCL:0; PCL:0; RULEID:(400006); SRVR:BN6PR03MB2737; X-Forefront-PRVS: 01221E3973 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjAzTUIyNzM3OzIzOnVSRG94ZU1ZcitlYlF4OWFxejBmcjNsdUpO?= =?utf-8?B?WTRDRERBa2NwRXBoSzAzck16Q3dwUUNzNUlTL1E1MVJYdkRQaEs1SHFrUWNa?= =?utf-8?B?SkpYa2F6QWxIMnlGMUh2NHE4ZzBMbkRiYm9IUWNTV0x5eXM5VGZhZUpaN0NX?= =?utf-8?B?c0RJSXBJdWNEODQ5NngrQlBMZWp5VHVSL1c5Tm9xd3BkM1RQUVJtZFRJU2tC?= =?utf-8?B?a0lwSVNQUjEzK0pqSXdCY0tFRlRNVGpaSk1FU1Q2NHdGVGZtSlRkK01BNGxR?= =?utf-8?B?V240RHBkQ0N4cmU5SDdISHlXVmp5ZWVEWDU2cElsalM3dHhoSFRLSlJXS3hB?= =?utf-8?B?VVhLR1FhQzNScnFTM216WXFkeDB2K21pZTMzNXNzOExGMTdyeXhmYjRKN1dV?= =?utf-8?B?eGdFdFNQRlVlYzNod1hKVC82RmFRMGx2NnFWdUdTVldXZlNZSFFHQVNZTHhK?= =?utf-8?B?OHRzdWxKa1hiSEZGNnFSWk84UlQ4SXFOM3ByNE1iWDZVTG1FRHBkRHhaRzhG?= =?utf-8?B?VlVsdlVGQ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yuG9ba03izCTA1fpgPFA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2737; 7:nJDN10mJWKB0AcKNVbz6CpLaGZ2VpgNQN/057ld87bmb7Lf5N+AXnPmCiN4rIePeHCCsbmG7HCUHwIcPYN9YMj6Qd27MhJKc/n8GtzvtF+FXek7visALszo+5tB3PQZjK8yzMyBilK7+UlMdLFu6nbK/5d2uzljaHkuL7wXPvlqpcGTXgDk+ltDlEH3OhHzqwWUxjwkrcBr/+UXHJtUwbBHPia+B+RImrja9H2sHtTqeP1UHeZpYf33amlulTFZMItfFX371S5rwX5wK38j7LtFx1pRhxUu4CNMN2OotTweZwNV00jS2uOA586WRJmha9nM2b0DrGCej0cnYBiTaXuiiNilA3yhldW4YLQ8EBJ4= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2016 08:36:21.5123 (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: BN6PR03MB2737 Subject: Re: [dpdk-dev] Clarification for eth_driver changes 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 08:36:24 -0000 On Thursday 10 November 2016 01:21 PM, Jianbo Liu wrote: > On 10 November 2016 at 15:26, Shreyansh Jain wrote: >> Hello David, list, >> >> I need some help and clarification regarding some changes I am doing to >> cleanup the EAL code. >> >> There are some changes which should be done for eth_driver/rte_eth_device >> structures: >> >> 1. most obvious, eth_driver should be renamed to rte_eth_driver. >> 2. eth_driver currently has rte_pci_driver embedded in it >> - there can be ethernet devices which are _not_ PCI >> - in which case, this structure should be removed. >> 3. Similarly, rte_eth_dev has rte_pci_device which should be replaced with >> rte_device. >> >> This is what the current outline of eth_driver is: >> >> +------------------------+ >> | eth_driver | >> | +---------------------+| >> | | rte_pci_driver || >> | | +------------------+|| >> | | | rte_driver ||| >> | | | name[] ||| >> | | | ... ||| >> | | +------------------+|| >> | | .probe || >> | | .remove || >> | | ... || >> | +---------------------+| >> | .eth_dev_init | >> | .eth_dev_uninit | >> +------------------------+ >> >> This is what I was thinking: >> >> +---------------------+ +----------------------+ >> | rte_pci_driver | |eth_driver | >> | +------------------+| _|_struct rte_driver *p | >> | | rte_driver <-------/ | .eth_dev_init | >> | | ... || | .eth_dev_uninit | >> | | name || +----------------------+ >> | | || >> | +------------------+| >> | | >> +---------------------+ >> >> ::Impact:: >> Various drivers use the rte_pci_driver embedded in the eth_driver object for >> device initialization. >> == They assume that rte_pci_driver is directly embedded and hence simply >> dereference. >> == e.g. eth_igb_dev_init() in drivers/net/e1000/igb_ethdev.c file >> >> With the above change, such drivers would have to access rte_driver and then >> perform container_of to obtain their respective rte_xxx_driver. >> == this would be useful in case there is a non-PCI driver >> >> ::Problem:: >> I am not sure of reason as to why eth_driver embedded rte_pci_driver in >> first place - other than a convenient way to define it before PCI driver >> registration. >> >> As all the existing PMDs are impacted - am I missing something here in >> making the above change? >> > > How do you know eth_driver->p is pointing to a rte_pci_driver or rte_soc_driver? > Maybe you need to add a type/flag in rte_driver. My take: PMD implementation would specify this - similar to how it is done now. A PCI PMD would perform a container_of(rte_pci_driver,...). I don't think we need a differentiation here - primarily because generic doesn't handle the eth_driver. > >> Probably, similar is the case for rte_eth_dev. >> >> - >> Shreyansh > -- - Shreyansh