From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id B7B6EC60C for ; Fri, 29 Jan 2016 15:49:18 +0100 (CET) Received: by mail-wm0-f49.google.com with SMTP id l66so57663752wml.0 for ; Fri, 29 Jan 2016 06:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zvQdRjqiYZLB6jXEEunhRqPhZCzy2a6vBrYFtXepkqk=; b=Vnqw1Fg3jdEcKAJbDjCREG5beSReQDzhXTbmdmTsRN8SkB1uSltUSzhn1FKmvvrf9G x0IFbJqvWgR9S1HAj/y6v7ISNgsTFP+lMrYGIinA6aiYZdS1RhyelXH+Q0Vhfxk9w0rd pXQwxQD1dZUgYZbpBBnEt5Wu6nfQxCkofDUN8lXjXUylFHFi4TKuQ9Q7ZyadXSj5a5sP lLJ3Lz8z2sysE8Wb2QTxu1TQVo8fwGvOnBIIYoalL6MaxPx2wO463BHmsw9ZRdPqle7R REp4TougvgVPT13+uMaEN4iaXbqfWxHn7NVIeLzYYxY6Z5og9DHw7RVJpRbMP9oqiHoH TT9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zvQdRjqiYZLB6jXEEunhRqPhZCzy2a6vBrYFtXepkqk=; b=AKSb6CSgV9A/FS3Fq6w58o8uRieJX2rLBXh50+kAJCHKPjYKEVinDgVL9qiBINXHhh Zt7+kzDkgSTeXjn5XcEwWi8l0secciPLP7B/kWRLAZiR1mtkT9K1PJ5IL8PYwSCCSW1Z pW6r2u0fgNmFKQ7MzG7vsdnO8e2Qoa0LG1EUZTrrexI9I/9/PK/yM8bCYRvb6HbwFr0l dAZFl+P+LhEP5D7Ywx+2H7XjjKwihTy6qHNMj1VH2ryvZi6vSlPLCKdd7okeu5jRMMTM Ho6e8k/Nu/9Tdp4k036pWHgOlp+Z7Nb81fkExldKOWnWCX+YWguDk2q3cL06g5V7PScv WJrg== X-Gm-Message-State: AG10YORPJRLaQEldfji4GFXz0CWfwmXQb1domiZaQDS0j8IkzNJKz5G5JbYnOc4JQhQfrqAB X-Received: by 10.28.73.135 with SMTP id w129mr10101532wma.55.1454078958450; Fri, 29 Jan 2016 06:49:18 -0800 (PST) Received: from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net. [78.126.77.144]) by smtp.gmail.com with ESMTPSA id y188sm7811294wmy.11.2016.01.29.06.49.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jan 2016 06:49:17 -0800 (PST) From: David Marchand To: dev@dpdk.org Date: Fri, 29 Jan 2016 15:49:04 +0100 Message-Id: <1454078953-23744-1-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453476464-31767-1-git-send-email-david.marchand@6wind.com> References: <1453476464-31767-1-git-send-email-david.marchand@6wind.com> Cc: viktorin@rehivetech.com Subject: [dpdk-dev] [PATCH v2 0/9] pci cleanup and blacklist rework 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: Fri, 29 Jan 2016 14:49:18 -0000 Before 2.2.0 release, while preparing for more changes in eal (and fixing a problem reported by Roger M. [1]), I came up with this (part of) patchset that tries to make the pci code more compact and easier to read. I ended up introducing some hooks in the pci layer to customize pci blacklist / whitelist handling and make it possible to automatically bind / unbind pci devices to igb_uio (or equivalent) when attaching a device. I am still not really happy: - the pci blacklist / whitelist makes me think we should let the application tell eal which resources to use and get rid of the unconditional pci scan code, which means removing rte_eal_pci_probe() from rte_eal_init(), and remove rte_eal_dev_init() for vdevs, - the more I look at this, the more I think automatic bind / unbind for pci devices should be called from the pmd context. The drivers know best what they require and what they want to do with the resources passed by the eal (see the drv_flags / RTE_KDRV_NONE / rte_eal_pci_map_device stuff for virtio pmd). This behaviour would still be optional, on a per-device basis. So, I think that these hooks are not that good of an idea and I kept them private for now, but anyway, sending this for comments. Changes since v1: - split the initial patchset. This current patchset now depends on [2] sent separately which should be applied first, - introduced hooks in pci common code, - implemented automatic bind / unbind for "uio" pci devices [1] http://dpdk.org/ml/archives/dev/2015-November/028140.html [2] http://dpdk.org/ml/archives/dev/2016-January/032387.html -- David Marchand David Marchand (9): pci: add internal device list helpers pci/linux: minor cleanup pci/linux: rework sysfs parsing for driver pci: factorize probe/detach code pci: cosmetic change pci: factorize driver search pci: remove driver lookup from detach pci: implement blacklist using a hook pci: implement automatic bind/unbind lib/librte_eal/bsdapp/eal/eal_pci.c | 59 ++-- lib/librte_eal/common/eal_common_options.c | 8 + lib/librte_eal/common/eal_common_pci.c | 438 ++++++++++++++++++----------- lib/librte_eal/common/eal_options.h | 2 + lib/librte_eal/common/eal_private.h | 64 +++++ lib/librte_eal/common/include/rte_pci.h | 7 +- lib/librte_eal/linuxapp/eal/eal_pci.c | 301 ++++++++++++++++---- 7 files changed, 627 insertions(+), 252 deletions(-) -- 1.9.1