From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f173.google.com (mail-ob0-f173.google.com [209.85.214.173]) by dpdk.org (Postfix) with ESMTP id 90ED78D3B for ; Wed, 3 Feb 2016 09:47:52 +0100 (CET) Received: by mail-ob0-f173.google.com with SMTP id xk3so20323695obc.2 for ; Wed, 03 Feb 2016 00:47:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=NLNwjqoM4CKBX5OPp4U2D/tqP62CEU/xS9Vto7D4LKM=; b=2HEpvKm4c9U7nJb+DaVRifa4BlpgPDZWCOkRmEqqT5O0kyS78RWaE65SxoNwlYk/Ft sG+RWz6TntrbTjnAvRtAkcg3DcTLuQk/mnw++DHzMKGGrjkO0DsDc3LupFCHvWOSIETk gjfU9pQu75S9ZcuWWZfwavRU0uyWyBsk1D2PYOnlBXnnVwCEKB62iRM8QEmNGqJNa1OF Pz/6q5ETiQzpOgogrMMQuWNguSP1jJy57R2pKPtDL9FDZ4/BV6/BAuBaQy2nvj0Tkr/+ SA8gN+cde8a/+E03TGId7fYPwRAzPZ1Q8V4Kh81UGYYR0/b7qBwFE0IwDLgnO9oTXpar Ay6w== 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:content-type; bh=NLNwjqoM4CKBX5OPp4U2D/tqP62CEU/xS9Vto7D4LKM=; b=b7JLKVvylJHotB7R0l+l8RzOsvGfCWoOZl6MUPDx33xtJk+PTHSbDD4w+HnXKzco/E zvNAnO9KHAXzZEKsrYtvXpilzwZh/IcDKWR+rYku50j8AIySpuABYAqLjtfWS3Z+gh3m NawCpyVu3Y5l902yinLMzR6RpOszJpdY04qTLm18zPGU/HqkHc+Ld7855PqTNsreaCeW aLaCC4htO6wikr24kpJZQk/5549SPkmlUjUAxIEZ+AspboBxvapVrI+UlIIJANLyzlj8 jFdBT1DBBM93H8n6LpIj9Yay2E5egju37MbuF5NSvVSDuJNuketT5HoaIkJraUWVMlur oJcg== X-Gm-Message-State: AG10YORAk8lzkQ+wl/OZu8h0W7ejDd0o2oo4WSqUGQLoT5DMCdgjEoVZ3r2j5z2q2vuf0hV2sksdxJGmpoa6eucZ X-Received: by 10.182.130.234 with SMTP id oh10mr413956obb.58.1454489272066; Wed, 03 Feb 2016 00:47:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.76.180.72 with HTTP; Wed, 3 Feb 2016 00:47:32 -0800 (PST) In-Reply-To: <1454423239-16382-1-git-send-email-krytarowski@caviumnetworks.com> References: <1454423239-16382-1-git-send-email-krytarowski@caviumnetworks.com> From: David Marchand Date: Wed, 3 Feb 2016 09:47:32 +0100 Message-ID: To: krytarowski@caviumnetworks.com Content-Type: text/plain; charset=UTF-8 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 1/2] ethdev: Allow to overload pci_drv.devinit and pci_drv.devuninit 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: Wed, 03 Feb 2016 08:47:52 -0000 Hello, On Tue, Feb 2, 2016 at 3:27 PM, wrote: > From: Kamil Rytarowski > > This change enables drivers needing custom pci (de)initialization functions > through the standard callback overloading. > > For example: > > /* > * virtual function driver struct > */ > static struct eth_driver rte_DRIVER_pmd = { > { > .name = "rte_DRIVER_pmd", > .id_table = pci_id_DRIVER_map, > .drv_flags = RTE_PCI_DRV_NEED_MAPPING, > .devinit = DRIVER_pci_devinit, > }, > .eth_dev_init = eth_DRIVER_dev_init, > .dev_private_size = sizeof(struct DRIVER), > }; > > Use-case is as follows: NIC offers several pci virtual functions, while > one of them is to be treated as port, we need to configure the rest in a > specific way for particular device for full interface (port) functionality. Mmm, why don't you register a custom pci driver rather than a eth_driver ? And do your custom things in its devinit function ? -- David Marchand