From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 4F44E2952 for ; Wed, 10 May 2017 12:52:48 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 10 May 2017 03:52:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,318,1491289200"; d="scan'208";a="259390619" Received: from dwdohert-mobl1.ger.corp.intel.com (HELO [163.33.228.212]) ([163.33.228.212]) by fmsmga004.fm.intel.com with ESMTP; 10 May 2017 03:52:46 -0700 To: Thomas Monjalon , Radu Nicolau References: <1494341879-18718-1-git-send-email-radu.nicolau@intel.com> <1571308.M4Vgp8n44D@xps> <18252037.5gudFzihFo@xps> Cc: dev@dpdk.org From: Declan Doherty Message-ID: <1c20ee02-530f-a39a-47c5-15cc5ce1a973@intel.com> Date: Wed, 10 May 2017 11:52:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <18252037.5gudFzihFo@xps> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC][PATCH 2/5] pci: allow shared device instances. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 May 2017 10:52:48 -0000 Hey Thomas, I've been working on this with Radu, so see my take below On 10/05/2017 11:28 AM, Thomas Monjalon wrote: > 10/05/2017 12:11, Radu Nicolau: >> Hi >> >> >> On 5/10/2017 10:09 AM, Thomas Monjalon wrote: >>> Hi, >>> >>> 09/05/2017 16:57, Radu Nicolau: >>>> Updated PCI initialization code to allow devices to be shared across multiple PMDs. >>>> >>>> Signed-off-by: Radu Nicolau >>> I was waiting the day when we have a device shared >>> by two different interfaces. >>> Note that some Mellanox and Chelsio devices already instantiate >>> two ethdev ports per PCI device. >>> >>> Please explain your idea behind this "shared" flag. >>> What is your exact need? >> >> Currently for each pci device a look-up into a list of PMDs is >> performed, and when a match is found the system moves to the next >> device. Having this flag will allow a PMD to inform the system that >> there may be more matches, more PMDs that can be used for this >> particular device. >> There is a difference when comparing to the devices you mentioned above, >> in this case the PMDs are totally different types, one network and one >> cryptodev PMD for each IXGBE network card. > > Yes I know it is a lack in DPDK. > Linux introduced MultiFunction Device in 2005: > http://events.linuxfoundation.org/sites/events/files/slides/belloni-mfd-regmap-syscon_0.pdf > So at the most basic level the intention is to allow more than one device of different types, in our case a net PMD and a crypto PMD, to be instantiated on a single PCI bar, in essence to share the bar. I'm not familiar with the approaches taken in the Mellanox and Chelsio devices but I assume they are handled with the driver probe/create functions independently from the EAL infrastructure? For the initial proto-typing of this RFC we only implemented the multi-device creation but I envisage that there will be a requirement for sharing state between drivers, or at a minimum implementing locking around shared resources, registers etc. And I would like to see this done in a generic fashion that can me leverage by any driver and not have each driver having to solve this independently. >>> Do you think it is the best solution? >> >> We evaluated different approaches and this is what we settled on. It >> might not be the best, if there are any suggestions of other ways to >> achieve this I would be thankful. I think this approach was sufficient to enable the RFC and kick off the discussion, but it is not a fully featured solution and we wanted to get community feedback before progressing to far along with a fully featured solution. > > Please could you explain the other approaches you thought > with pros and cons? > > Thanks >