From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by dpdk.org (Postfix) with ESMTP id AB19AC3B6 for ; Thu, 23 Jul 2015 18:51:13 +0200 (CEST) Received: by pabkd10 with SMTP id kd10so88431362pab.2 for ; Thu, 23 Jul 2015 09:51:12 -0700 (PDT) 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:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=3ueWeYNr3P4OgBNZzxsewTed3FjPl50Y8pYchKiLw7o=; b=QpKktLunYZLfwHiVZed+Xo30zNSGH/isvFnGbfwiueKhw2Udzc5cHAhu2T5wAOpdHi lIZG8atP10CiM0JyqcudOuiVgu6UPf7reCc9k6ufyKtjoq5Q+2gOz1XMldGk6Tgb/V7I GMwVK9mYkSOIhO7PXtFTUmktDDbfJGWgjrN367ktHmp+5CVBbleBjUadbQ4OBwREcAi4 YjtjpIunznC/v+b7jkuhZpYURkMCbyr/BIV7aPHsZTiJrDXMSureD7A7FCFlTI76/bp3 pUZus5pix4L6PSkoioNrvSIWURhvwCe/j6MaR6jmbXZ0x5HeYlXSihh8D6xw1vkyuFtl Pv2Q== X-Gm-Message-State: ALoCoQnxhOec0ahatCSMv5U/KKyxwLZ310c2x/eYjQ3x98OmaOhml/Up1aTtXEh8/k8UuYfeFiLC X-Received: by 10.70.133.42 with SMTP id oz10mr20567673pdb.85.1437670272142; Thu, 23 Jul 2015 09:51:12 -0700 (PDT) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id ni14sm5155122pdb.11.2015.07.23.09.51.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jul 2015 09:51:11 -0700 (PDT) Date: Thu, 23 Jul 2015 09:51:20 -0700 From: Stephen Hemminger To: Thomas Monjalon Message-ID: <20150723095120.056dd0f2@urahara> In-Reply-To: <2330484.OMtusG3QG9@xps13> References: <2330484.OMtusG3QG9@xps13> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] management of non-PCI devices 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, 23 Jul 2015 16:51:14 -0000 On Thu, 23 Jul 2015 17:42:58 +0200 Thomas Monjalon wrote: > As noticed when reviewing the changes for hotplugging ring PMD, > http://dpdk.org/ml/archives/dev/2015-July/021872.html > a driver is considered in ethdev and EAL as a PCI driver: > > * Each Ethernet driver acts as a PCI driver and is represented by a generic > * *eth_driver* structure that holds: > * - An *rte_pci_driver* structure (which must be the first field). > * - The *eth_dev_init* function invoked for each matching PCI device. > * - The *eth_dev_uninit* function invoked for each matching PCI device. > * - The size of the private data to allocate for each matching device. > */ > struct eth_driver { > struct rte_pci_driver pci_drv; /**< The PMD is also a PCI driver. */ > eth_dev_init_t eth_dev_init; /**< Device init function. */ > eth_dev_uninit_t eth_dev_uninit; /**< Device uninit function. */ > unsigned int dev_private_size; /**< Size of device private data. */ > }; > > So the non PCI drivers don't use rte_eth_driver_register(). > Then a difference is made with these flags: > enum pmd_type { > PMD_VDEV = 0, > PMD_PDEV = 1, > }; > > With this kind of weird things: > static struct rte_driver rte_virtio_driver = { > .type = PMD_PDEV, > .init = rte_virtio_pmd_init, > }; > Because virtio is a virtual device with a virtual PCI address. > > All these things are not normal and make EAL code more and more difficult to > maintain. That's why we must stop accepting new code using these workarounds > and start working on a refactoring. > > Comments welcome The hyper-v driver which was posted here added a new bus type (vmbus) and it was not too painful. There were minimal changes to base EAL to make a union where pci_drv is used.