From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 159A37CD5 for ; Thu, 15 Mar 2018 18:50:11 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id s12so6650078wre.7 for ; Thu, 15 Mar 2018 10:50:11 -0700 (PDT) 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; bh=xfup/MIWGrIyqyhXPHRZeFB1cHfPc8srVLyC9R/s7xM=; b=xyL6ZcrY8thAxvMgkt1OUjqYy+Dhq0VTqhcq30ZbFUOX+cl+DRqiUGYLF1FHI97F7e cBVa+XrNrbg1zeru9+YxaVAnZ0Ib5ZqZUpwn7DSGoSgxQLnjj7+/SpFIf8QTiRr3QYX2 VA4LyB/Wjy4HZXM1rnww4n6zYN+Mi32nljI7UkShDzlYBii9c1wy/TRIa071CCffY1iS sheE2hqVVTfwLvY3rhMjwRQPXeJo9hP8Z1qFEJsvbxUAkrcnIYWlVgaE2m/1qy+SHO3g d+Q8vhm3mWfJZTqapP32mWxnycx+Av8S9lJkNCgxcsYbLgI9e+IynNKCI1riXXZJk8yO /6qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xfup/MIWGrIyqyhXPHRZeFB1cHfPc8srVLyC9R/s7xM=; b=j7KSaFGy8T/dFwxzm13Kjkqcrz/52DIf3DvMroZ0qCHxqmOGIvPaZsT5y3EDdcfy3i LmFX6WuY1fj31UpZmMayNV729bC0m3Iz0r/vcxzf7RHzVvkkyQI1IgdcSn/W7xyAjokw O43W5+4EHxEf24w/BpDTYXLVQj9wnX/SeQExE51QBXKIh8nizD2cgHhp/6iXjUkY93YV OmBrJLqdkVYrnklHxBVIXwOQQHDBxG7XmFW3eU9eNmdPsUP6nLcM0aZIJ01lvEfziKnF CYeJk85ZdY0sCalY1dChdVNt4sUXMegZkqiq5egneiWsj3o5NBRKPuFzHZQDPOp+dceD eiSA== X-Gm-Message-State: AElRT7EGmQAnZfpNz7+8nAUe6bOH9SZdy8eWw1gQr7pCNF+aE0ivGpb+ /09245d/T7vj1I5+3cDZQ4AQ812k X-Google-Smtp-Source: AG47ELttP1prKbCzPaHzU+9FYV4vMUcc8EhgJYJSEaOeknN8AvrT3eUK8+7cMROyu1Zw5y/3s7LrCg== X-Received: by 10.223.193.69 with SMTP id w5mr7505512wre.42.1521136210216; Thu, 15 Mar 2018 10:50:10 -0700 (PDT) Received: from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 69sm4756596wmp.36.2018.03.15.10.50.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Mar 2018 10:50:09 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 15 Mar 2018 18:49:30 +0100 Message-Id: X-Mailer: git-send-email 2.11.0 Subject: [dpdk-dev] [PATCH v1 00/18] Device querying 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: Thu, 15 Mar 2018 17:50:11 -0000 This patchset introduces a new EAL API for querying devices, filtered by arbitrary properties. The following elements are introduced to this end: * A new object, "rte_class", is used to describe the device class abstraction layer (eth, crypto, ...). * Both rte_bus and rte_class now offer a way to list their devices and filter the result using locally defined properties. * The rte_dev API now has an rte_dev_iterator, which is the way for the user to define the device filter and iterate upon the resulting set. As an example, the "eth" device class is implemented. Additionally, the device filters for + rte_bus_pci + rte_bus_vdev + rte_class_eth are implemented and can be used with some properties each, to show how to extend those. Some example of filters: "bus=pci/class=eth" "bus=pci" "class=eth" "class=eth,name=net_ring0" "bus=pci,id=00:00.0" "bus=vdev,driver=net_ring" Gaetan Rivet (18): eal: introduce dtor macros eal: introduce device class abstraction eal/class: register destructor eal: add lightweight kvarg parsing utility eal/dev: add device iterator interface eal/dev: implement device iteration initialization eal/class: add device iteration eal/bus: add device iteration eal/dev: implement device iteration ethdev: register ether layer as a class ethdev: add device matching field name bus/pci: fix find device implementation bus/pci: implement device iteration and comparison bus/pci: add device matching field id bus/vdev: fix find device implementation bus/vdev: implement device iteration bus/vdev: add device matching field driver app/testpmd: add show device command app/test-pmd/cmdline.c | 52 +++++++++ drivers/bus/pci/Makefile | 2 +- drivers/bus/pci/pci_common.c | 97 ++++++++++++++-- drivers/bus/pci/rte_bus_pci.h | 3 + drivers/bus/vdev/Makefile | 2 +- drivers/bus/vdev/rte_bus_vdev.h | 3 + drivers/bus/vdev/vdev.c | 86 +++++++++++++- lib/Makefile | 2 +- lib/librte_eal/bsdapp/eal/Makefile | 1 + lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/eal_common_class.c | 62 ++++++++++ lib/librte_eal/common/eal_common_dev.c | 177 +++++++++++++++++++++++++++++ lib/librte_eal/common/eal_private.h | 34 ++++++ lib/librte_eal/common/include/rte_bus.h | 1 + lib/librte_eal/common/include/rte_class.h | 127 +++++++++++++++++++++ lib/librte_eal/common/include/rte_common.h | 23 ++++ lib/librte_eal/common/include/rte_dev.h | 84 ++++++++++++++ lib/librte_eal/linuxapp/eal/Makefile | 1 + lib/librte_eal/rte_eal_version.map | 4 + lib/librte_ether/Makefile | 3 +- lib/librte_ether/rte_class_eth.c | 100 ++++++++++++++++ 21 files changed, 847 insertions(+), 19 deletions(-) create mode 100644 lib/librte_eal/common/eal_common_class.c create mode 100644 lib/librte_eal/common/include/rte_class.h create mode 100644 lib/librte_ether/rte_class_eth.c -- 2.11.0