From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw0-f173.google.com (mail-yw0-f173.google.com [209.85.161.173]) by dpdk.org (Postfix) with ESMTP id 31A17374E for ; Sun, 18 Sep 2016 07:58:51 +0200 (CEST) Received: by mail-yw0-f173.google.com with SMTP id t67so110065090ywg.3 for ; Sat, 17 Sep 2016 22:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7pQ6fWT3nPMs3jrWZdI4OJx/qhltzwa+IA1OpfeYewA=; b=dvuBYbwTVYgis1WhC85nOxpEwRFnSNR3TvWrP6dGMekTxSdygcmOPG0H9l6UH6McK5 xDDSpQSQO/sPSmxxdxArMq57jpy281Q1exCrzyOYE4TfesKep4myF1UR1EpvnPhMrLuf zWzxUkROXqckiO0TGudfSzwgndvhtg+WRlAss= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7pQ6fWT3nPMs3jrWZdI4OJx/qhltzwa+IA1OpfeYewA=; b=HoH8xAdI+4iKkXqu2Oir4Rjcsmwr/NE8/hfr+pBkLLeCfaVB0BJEBMqON910VgEwQ4 AgRtVcqN8t/Fd4txPbgc55bV0YfkcAivdxGbnHb8+LYEP6YXDWHc+fXK0cYR3NijcBMR McsHL2ws4ToNeN0Uquz81fggo+cg4aX+flfZj2o0yhkeISUyKBnkydXm7ekVrW11a/KJ eVlf1ykzlnpJHgY5XVC2lZ+VdmxDPidcqq46tDuUUlfklEeMNdyYCijbeU6q9ThazPVR BZVNw1UaGhJFwncdPh1z32/6YPeqmxCLmWLmScKdv9dFG17YkTHVBMw4bLjWKljDp/AY uxow== X-Gm-Message-State: AE9vXwMPj5KIbhRm5U5AxJHgXqh/bcYvFXlyVgA1KE4g2IYlFj5EPO3HBqpVusm8nqL8C7XNUV1BlfpTGupg5ieE X-Received: by 10.129.72.214 with SMTP id v205mr6883329ywa.236.1474178330615; Sat, 17 Sep 2016 22:58:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.25.6 with HTTP; Sat, 17 Sep 2016 22:58:50 -0700 (PDT) In-Reply-To: <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> References: <1451682326-5834-1-git-send-email-viktorin@rehivetech.com> <1473410639-10367-1-git-send-email-shreyansh.jain@nxp.com> From: Jianbo Liu Date: Sun, 18 Sep 2016 13:58:50 +0800 Message-ID: To: Shreyansh Jain Cc: dev@dpdk.org, Jan Viktorin , Hemant Agrawal Content-Type: text/plain; charset=UTF-8 Subject: Re: [dpdk-dev] [PATCH v3 00/15] Introduce SoC device/driver framework for EAL 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: Sun, 18 Sep 2016 05:58:51 -0000 On 9 September 2016 at 16:43, Shreyansh Jain wrote: > Introduction: > ============= > > This patch set is direct derivative of Jan's original series [1],[2]. > > - As this deviates substantially from original series, if need be I can > post it as a separate patch rather than v2. Please suggest. > - Also, there are comments on original v1 ([4]) which are _not_ > incorporated in this series as they refer to section no more in new > version. > - This v3 version is based on the rte_driver/device patchset v9 [10]. > That series introduced device structures (rte_driver/rte_device) > generalizing devices into PCI, VDEV, XXX. For the purpose of this > patchset, XXX=>SOC. > > Aim: > ==== > > As of now EAL is primarly focused on PCI initialization/probing. > > rte_eal_init() > |- rte_eal_pci_init(): Find PCI devices from sysfs > |- ... > |- rte_eal_memzone_init() > |- ... > `- rte_eal_pci_probe(): Driver<=>Device initialization > > This patchset introduces SoC framework which would enable SoC drivers and > drivers to be plugged into EAL, very similar to how PCI drivers/devices are > done today. > > This is a stripped down version of PCI framework which allows the SoC PMDs > to implement their own routines for detecting devices and linking devices to > drivers. > > 1) Changes to EAL > rte_eal_init() > |- rte_eal_pci_init(): Find PCI devices from sysfs > |- rte_eal_soc_init(): Calls PMDs->scan_fn > |- ... > |- rte_eal_memzone_init() > |- ... > |- rte_eal_pci_probe(): Driver<=>Device initialization, PMD->devinit() > `- rte_eal_soc_probe(): Calls PMDs->match_fn and PMDs->devinit(); > > 2) New device/driver structures: > - rte_soc_driver (inheriting rte_driver) > - rte_soc_device (inheriting rte_device) > - rte_eth_dev and eth_driver embedded rte_soc_device and rte_soc_driver, > respectively. > > 3) The SoC PMDs need to: > - define rte_soc_driver with necessary scan and match callbacks > - Register themselves using DRIVER_REGISTER_SOC() > - Implement respective bus scanning in the scan callbacks to add necessary > devices to SoC device list > - Implement necessary eth_dev_init/uninint for ethernet instances > > 4) Design considerations that are same as PCI: > - SoC initialization is being done through rte_eal_init(), just after PCI > initialization is done. > - As in case of PCI, probe is done after rte_eal_pci_probe() to link the > devices detected with the drivers registered. > - Device attach/detach functions are available and have been designed on > the lines of PCI framework. > - PMDs register using DRIVER_REGISTER_SOC, very similar to > DRIVER_REGISTER_PCI for PCI devices. > - Linked list of SoC driver and devices exists independent of the other > driver/device list, but inheriting rte_driver/rte_driver, these are also > part of a global list. > > 5) Design considerations that are different from PCI: > - Each driver implements its own scan and match function. PCI uses the BDF > format to read the device from sysfs, but this _may_not_ be a case for a > SoC ethernet device. > = This is an important change from initial proposal by Jan in [2]. Unlike > his attempt to use /sys/bus/platform, this patch relies on the PMD to It could be many redundant code if Each PMD driver has the scan function if its own. I think Jan's implementation is common to many platform drivers. > detect the devices. This is because SoC may require specific or > additional info for device detection. Further, SoC may have embedded Can you give us more precise definition about SoC driver? Does it include the driver in ARM server? > devices/MACs which require initialization which cannot be covered through > sysfs parsing. I think it can be done in devinit, not in scan function. devinit can be different for each driver. > = PCI based PMDs rely on EAL's capability to detect devices. This > proposal puts the onus on PMD to detect devices, add to soc_device_list > and wait for Probe. Matching, of device<=>driver is again PMD's callback. >