From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Marchand Subject: Re: [PATCH 1/2] ethdev: Allow to overload pci_drv.devinit and pci_drv.devuninit Date: Wed, 3 Feb 2016 15:08:32 +0100 Message-ID: References: <1454423239-16382-1-git-send-email-krytarowski@caviumnetworks.com> <56B1E70B.4070607@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: "dev@dpdk.org" To: Kamil Rytarowski Return-path: Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by dpdk.org (Postfix) with ESMTP id 67C9D8D90 for ; Wed, 3 Feb 2016 15:08:53 +0100 (CET) Received: by mail-ob0-f180.google.com with SMTP id is5so30745527obc.0 for ; Wed, 03 Feb 2016 06:08:53 -0800 (PST) In-Reply-To: <56B1E70B.4070607@caviumnetworks.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Feb 3, 2016 at 12:39 PM, Kamil Rytarowski wrote: > W dniu 03.02.2016 o 09:47, David Marchand pisze: >> And do your custom things in its devinit function ? > > I'm requesting from PF the mode of the device to be initialized. This part > is handled dynamically and depends of the current configuration in PF. > > In my use-case there are two device types: primary (master) and secondary > (slave). For the primary VF I'm creating a DPDK port normally, for secondary > I retain configured PCI device for further reuse (and there is no port > created). Well, again, if you don't want to associate a port to this pci resource, why are you registering a eth_driver ? A eth_driver driver supposes you have a 1 - 1 relation between ethdev and pci resource. For your case, register a pci driver, then in your pci probing function (.devinit), depending on what you want to do, you can either do nothing (?) or create one or more ethdevs (see mlx* and cxgbe drivers). -- David Marchand