From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by dpdk.org (Postfix) with ESMTP id CE62C2BD0 for ; Thu, 10 Nov 2016 09:58:02 +0100 (CET) Received: by mail-wm0-f52.google.com with SMTP id f82so17034709wmf.1 for ; Thu, 10 Nov 2016 00:58:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=rmsX/Kz0v+EcUmh7jX2ZoSzMbOtKirtM4oiMRaLx8Wk=; b=ErNtkT2T36e9g8kaOKM035b/RundC6LgZTtdunEO/mMJsNoWna2EpRrumn22IotCcA RS60bPErZMJeaVOKVNxfDMvKcAMDaPKiZk7Yg19j4KN2tYjpgBs5XgKdl6J7UemGCRlo 6hJPVnw9TLugD96xIc5/F9Qh9IEi+Oni9iNgc5D+/U3kJQIGA7q2BITNyulfP5RH8+5T hkZRvOWlNax60UnHv3gDTS9L1nJyUG/zS5bkv98QxQni4+NeZttZ/jpBqL6xihu6Kkwt z1H06jEcn+8yT9oSAiEmS8uJTtmiNB+ZQBHaUYeWA8c4EzIikLKF5+/Ov66ao+aIRACH J2TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=rmsX/Kz0v+EcUmh7jX2ZoSzMbOtKirtM4oiMRaLx8Wk=; b=e3NdNyLwDjPthq0c0OwsKzXowKTReNxyAUbFm4IvrAlSSgDR0BrsS9/Ux3+AktK2jc 9IEztkHszlpPPTwdUgN4Vkn3+bZvhRnNn0Lh9GRq7sQW3YuGyzQNnQvvBPjgwRoxx0Wq Mr8fD5ohBYL7SxODUpCkB2pFiwe1cHNxNAfVJJF895bgLMn3pCMHkY9NeKYAWjOWKIAP mcCe3RGa4xS0ZkFwF8Egup2916aAArzzmb6lSt90DItYjc2oX1+TyJ1eqege7oIDC9LY fZqpncYgInvZD4a1M44y9jsGx7+i85orOTRrfw+VhBzKK++TPX4bZyY4IJtP7pvaDF1j 9WPg== X-Gm-Message-State: ABUngved50HcIR8FbqSDTdweJbVHPhNwENWMi9KdeZaq5aIVnSUSriOvp/93fGlwuOYbUAoj X-Received: by 10.28.232.213 with SMTP id f82mr23614028wmi.85.1478768282469; Thu, 10 Nov 2016 00:58:02 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id 18sm11743705wmr.5.2016.11.10.00.58.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Nov 2016 00:58:01 -0800 (PST) Date: Thu, 10 Nov 2016 00:58:01 -0800 (PST) X-Google-Original-Date: Thu, 10 Nov 2016 09:58 +0100 From: Thomas Monjalon To: Shreyansh Jain Cc: Jianbo Liu , dev@dpdk.org, David Marchand Message-ID: <1707413.bZtX9g6zPm@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <26890399.yRKBLeyzpS@xps13> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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:58:03 -0000 2016-11-10 14:12, Shreyansh Jain: > On Thursday 10 November 2016 01:33 PM, Thomas Monjalon wrote: > > 2016-11-10 15:51, Jianbo Liu: > >> On 10 November 2016 at 15:26, Shreyansh Jain wrote: > >>> 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. > > > > Why do you need any bus information at ethdev level? > > AFAIK, we don't need it. Above text is not stating anything on that > grounds either, I think. Isn't it? No, I was replying to Jianbo. Anyway, David made a more interesting comment.