From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 0D22A47CD for ; Thu, 10 Nov 2016 09:03:38 +0100 (CET) Received: by mail-wm0-f42.google.com with SMTP id f82so14418062wmf.1 for ; Thu, 10 Nov 2016 00:03:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=ifZ5irj9hs6FlyVca4xNmTiYAtxqhoBDzkCko2mnGPM=; b=G2OgOFcvbbqvbUPNYSygZNnBssIiDXySqGFr60CS2Z31+N7wib62lGfUhxj/hKM+Fz E/2fEuAzy/ZmoHdvtZ9bow0OBS7vQefZ1Doztv7nWP6LS4jT2sGC7aJKifqRVeTJfCB6 fkEezSDSNHQSumHfrrTAUpBIM3BGE2k0Tak421ws5tLIMba38fh5+2VH5SR3EUi0K1zd cCGpSOOnnU8Kq9Y8ZhdzE0Q2droZS/KZZXcOhj6RUXdMlQ7zV6HwaMGo3w1J+7X60omy 4W0hUpK1EHdEX93RnnzxRf442hYe93+CZWZzAoyGuTIKRjY93OBtSGoGP3tTVgcyzkBM OYLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=ifZ5irj9hs6FlyVca4xNmTiYAtxqhoBDzkCko2mnGPM=; b=CS426wXEeksmGThD9GLsoyMYuo/VpEtgZ+Rr4PPvfvipCTBqbe+lmOjPeAh2xHXoGi n3Kxa4w6Sh0M3oFefj7wNRzU9hvDI2K+mwO3xGWwL40o2Z5qUggu3a3GfhacV8DkiSQC 2F/YZa3cPZh0zV0IfcZjg+kkwJ4IYgCXWFPJWIUkRWPV+89OKf7jbK57BxmKz2Y5Z5oq uQCiSP3NuhKkx2IgNeD15lU5/Mq/2XhqehunJiodworTl402im+BC6f6yY4A7BQy0iJo o6kFmbwKkPtdEY3//Z9tdNY9V9AeA1ob9UusrPavqhcyzjra0afAlcZQYPsxNJnq9hoU L/Xw== X-Gm-Message-State: ABUngvfVaMi0a6KM+tZ7Unnzvd6H0v5uHOjfYua23SNiOCZGe0yLYZF9cCNOwqhYc6xs7m3j X-Received: by 10.28.14.65 with SMTP id 62mr2037206wmo.3.1478765018511; Thu, 10 Nov 2016 00:03:38 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id m1sm3992368wjk.22.2016.11.10.00.03.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Nov 2016 00:03:37 -0800 (PST) From: Thomas Monjalon To: Jianbo Liu Cc: dev@dpdk.org, Shreyansh Jain , David Marchand Date: Thu, 10 Nov 2016 09:03:36 +0100 Message-ID: <26890399.yRKBLeyzpS@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: 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:03:39 -0000 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?