Skip to contentSkip to conversation

bus/pci: remove PCI bus from EAL

PATCH Superseded Gaetan Rivet 8 participants 63 messages Jun 1, 2017 – Jul 3, 2017

lore
Share & tools
lore
#0 lore raw

cover bus/pci: remove PCI bus from EAL

This patchset moves the PCI bus out of the EAL to the drivers/bus subdirectory.

The last remaining dependencies have been worked out and the PCI bus is not ready to be moved.
Several issues remain:

* librte_cryptodev
* librte_eventdev
* librte_pdump
* librte_kni

All depend on the PCI bus being available within the EAL. This patchset disable them to allow for compilation, but it should be fixed before integration and the related commits removed.

The pmdinfogen app has been moved to the drivers subdirectory. This allows using the dependency syntax from the build system, as this app also depends on the PCI bus. The dependency graph is as follows:

drivers/bus/pci
|
+ drivers/pmdinfogen
|
+ drivers/net

The compilation has been tested on debian 8, Redhat 7.2 and FreeBSD 10.3

This patchset depends on:

eal: complete attach / detach support
http://dpdk.org/ml/archives/dev/2017-June/067057.html
http://dpdk.org/dev/patchwork/patch/24969/

Gaetan Rivet (8):
eal: expose rte_eal_using_phys_addrs
ethdev: remove useless PCI dependency
pmdinfogen: move to drivers subdirectory
cryptodev: disabled by default
eventdev: disabled by default
pdump: disabled by default
kni: disabled by default
bus/pci: introduce pci bus

 GNUmakefile                                     |   2 +-
 MAINTAINERS                                     |   2 +-
 buildtools/Makefile                             |  36 --
 buildtools/pmdinfogen/Makefile                  |  47 --
 buildtools/pmdinfogen/pmdinfogen.c              | 422 --------------
 buildtools/pmdinfogen/pmdinfogen.h              | 125 ----
 config/common_base                              |  11 +-
 config/common_linuxapp                          |   2 +-
 drivers/Makefile                                |   4 +-
 drivers/bus/Makefile                            |   2 +
 drivers/bus/pci/Makefile                        |  60 ++
 drivers/bus/pci/bsd/Makefile                    |  32 ++
 drivers/bus/pci/bsd/rte_bus_pci_version.map     |  21 +
 drivers/bus/pci/bsd/rte_pci.c                   | 672 ++++++++++++++++++++++
 drivers/bus/pci/include/rte_pci.h               | 628 ++++++++++++++++++++
 drivers/bus/pci/linux/Makefile                  |  37 ++
 drivers/bus/pci/linux/rte_bus_pci_version.map   |  21 +
 drivers/bus/pci/linux/rte_pci.c                 | 724 ++++++++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_init.h            |  97 ++++
 drivers/bus/pci/linux/rte_pci_uio.c             | 567 +++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_vfio.c            | 674 ++++++++++++++++++++++
 drivers/bus/pci/linux/rte_vfio_mp_sync.c        | 424 ++++++++++++++
 drivers/bus/pci/private.h                       | 167 ++++++
 drivers/bus/pci/rte_pci_common.c                | 615 ++++++++++++++++++++
 drivers/bus/pci/rte_pci_common_uio.c            | 233 ++++++++
 drivers/pmdinfogen/Makefile                     |  47 ++
 drivers/pmdinfogen/pmdinfogen.c                 | 422 ++++++++++++++
 drivers/pmdinfogen/pmdinfogen.h                 | 125 ++++
 lib/librte_eal/bsdapp/eal/Makefile              |   3 -
 lib/librte_eal/bsdapp/eal/eal_pci.c             | 672 ----------------------
 lib/librte_eal/common/Makefile                  |   2 +-
 lib/librte_eal/common/eal_common_pci.c          | 615 --------------------
 lib/librte_eal/common/eal_common_pci_uio.c      | 233 --------
 lib/librte_eal/common/eal_private.h             |  11 -
 lib/librte_eal/linuxapp/eal/Makefile            |  12 +-
 lib/librte_eal/linuxapp/eal/eal_memory.c        |   3 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           | 723 -----------------------
 lib/librte_eal/linuxapp/eal/eal_pci_init.h      |  97 ----
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c       | 567 -------------------
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c      | 674 ----------------------
 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c  | 424 --------------
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |   1 +
 lib/librte_eal/linuxapp/eal/rte_memory_linux.h  |  64 +++
 lib/librte_ether/rte_ethdev.c                   |   1 -
 mk/rte.app.mk                                   |   2 +
 45 files changed, 5654 insertions(+), 4669 deletions(-)
 delete mode 100644 buildtools/Makefile
 delete mode 100644 buildtools/pmdinfogen/Makefile
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.c
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.h
 create mode 100644 drivers/bus/pci/Makefile
 create mode 100644 drivers/bus/pci/bsd/Makefile
 create mode 100644 drivers/bus/pci/bsd/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/bsd/rte_pci.c
 create mode 100644 drivers/bus/pci/include/rte_pci.h
 create mode 100644 drivers/bus/pci/linux/Makefile
 create mode 100644 drivers/bus/pci/linux/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/linux/rte_pci.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_init.h
 create mode 100644 drivers/bus/pci/linux/rte_pci_uio.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_vfio.c
 create mode 100644 drivers/bus/pci/linux/rte_vfio_mp_sync.c
 create mode 100644 drivers/bus/pci/private.h
 create mode 100644 drivers/bus/pci/rte_pci_common.c
 create mode 100644 drivers/bus/pci/rte_pci_common_uio.c
 create mode 100644 drivers/pmdinfogen/Makefile
 create mode 100644 drivers/pmdinfogen/pmdinfogen.c
 create mode 100644 drivers/pmdinfogen/pmdinfogen.h
 delete mode 100644 lib/librte_eal/bsdapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci_uio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_init.h
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_uio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
 create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/8 eal: expose rte_eal_using_phys_addrs

This function was previously private to the EAL layer. Other subsystems requires it, such as the PCI bus.

This function is only exposed for linuxapps.

In order not to force other components to include stdbool, which is incompatible with several NIC drivers, the return type has been changed from bool to int.

---
 lib/librte_eal/common/eal_private.h             | 11 -----
 lib/librte_eal/linuxapp/eal/Makefile            |  2 +
 lib/librte_eal/linuxapp/eal/eal_memory.c        |  3 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           |  1 +
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +
 lib/librte_eal/linuxapp/eal/rte_memory_linux.h  | 64 +++++++++++++++++++++++++
 6 files changed, 70 insertions(+), 12 deletions(-)
 create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h
lib/librte_eal/common/eal_private.h +0 -11
index 6d2206a..b7e4cc6 100644
@@ -327,17 +327,6 @@ int rte_eal_hugepage_init(void);
  */
 int rte_eal_hugepage_attach(void);
 
-/**
- * Returns true if the system is able to obtain
- * physical addresses. Return false if using DMA
- * addresses through an IOMMU.
- *
- * Drivers based on uio will not load unless physical
- * addresses are obtainable. It is only possible to get
- * physical addresses when running as a privileged user.
- */
-bool rte_eal_using_phys_addrs(void);
-
 /*
  * Validate a bus name.
  *
lib/librte_eal/linuxapp/eal/Makefile +2 -0
index 640afd0..530e286 100644
@@ -131,4 +131,6 @@ INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h
 SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include/exec-env := \
 	$(addprefix include/exec-env/,$(INC))
 
+SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include += rte_memory_linux.h
+
 include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_eal/linuxapp/eal/eal_memory.c +2 -1
index ebe0683..072bfe4 100644
@@ -99,6 +99,7 @@
 #include "eal_internal_cfg.h"
 #include "eal_filesystem.h"
 #include "eal_hugepages.h"
+#include "rte_memory_linux.h"
 
 #define PFN_MASK_SIZE	8
 
@@ -1472,7 +1473,7 @@ rte_eal_hugepage_attach(void)
 	return -1;
 }
 
-bool
+int
 rte_eal_using_phys_addrs(void)
 {
 	return phys_addrs_available;
lib/librte_eal/linuxapp/eal/eal_pci.c +1 -0
index 595622b..9d5b051 100644
@@ -45,6 +45,7 @@
 #include "eal_filesystem.h"
 #include "eal_private.h"
 #include "eal_pci_init.h"
+#include "rte_memory_linux.h"
 
 /**
  * @file
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1 -0
index a5127d6..8916520 100644
@@ -207,5 +207,6 @@ DPDK_17.08 {
 
 	rte_bus_from_name;
 	rte_bus_from_dev;
+	rte_eal_using_phys_addrs;
 
 } DPDK_17.05;
lib/librte_eal/linuxapp/eal/rte_memory_linux.h new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
2.1.4
#2 lore raw

Re: [PATCH 1/8] eal: expose rte_eal_using_phys_addrs

Quoted 91 lines · Gaetan Rivet

This function was previously private to the EAL layer. Other subsystems requires it, such as the PCI bus.

This function is only exposed for linuxapps.

In order not to force other components to include stdbool, which is incompatible with several NIC drivers, the return type has been changed from bool to int.

---
 lib/librte_eal/common/eal_private.h             | 11 -----
 lib/librte_eal/linuxapp/eal/Makefile            |  2 +
 lib/librte_eal/linuxapp/eal/eal_memory.c        |  3 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           |  1 +
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +
 lib/librte_eal/linuxapp/eal/rte_memory_linux.h  | 64 +++++++++++++++++++++++++
 6 files changed, 70 insertions(+), 12 deletions(-)
 create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h
lib/librte_eal/common/eal_private.h +0 -11
index 6d2206a..b7e4cc6 100644
@@ -327,17 +327,6 @@ int rte_eal_hugepage_init(void);
  */
 int rte_eal_hugepage_attach(void);
 
-/**
- * Returns true if the system is able to obtain
- * physical addresses. Return false if using DMA
- * addresses through an IOMMU.
- *
- * Drivers based on uio will not load unless physical
- * addresses are obtainable. It is only possible to get
- * physical addresses when running as a privileged user.
- */
-bool rte_eal_using_phys_addrs(void);
-
 /*
  * Validate a bus name.
  *
lib/librte_eal/linuxapp/eal/Makefile +2 -0
index 640afd0..530e286 100644
@@ -131,4 +131,6 @@ INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h
 SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include/exec-env := \
        $(addprefix include/exec-env/,$(INC))
 
+SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include += rte_memory_linux.h
+
 include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_eal/linuxapp/eal/eal_memory.c +2 -1
index ebe0683..072bfe4 100644
@@ -99,6 +99,7 @@
 #include "eal_internal_cfg.h"
 #include "eal_filesystem.h"
 #include "eal_hugepages.h"
+#include "rte_memory_linux.h"
 
 #define PFN_MASK_SIZE  8
 
@@ -1472,7 +1473,7 @@ rte_eal_hugepage_attach(void)
        return -1;
 }
 
-bool
+int
 rte_eal_using_phys_addrs(void)
 {
        return phys_addrs_available;
lib/librte_eal/linuxapp/eal/eal_pci.c +1 -0
index 595622b..9d5b051 100644
@@ -45,6 +45,7 @@
 #include "eal_filesystem.h"
 #include "eal_private.h"
 #include "eal_pci_init.h"
+#include "rte_memory_linux.h"
 
 /**
  * @file
lib/librte_eal/linuxapp/eal/rte_eal_version.map +0 -0
index a5127d6..8916520 100644

lib/librte_eal/linuxapp/eal/rte_eal_version.map DPDK_17.08 { · line 210

Quoted 4 lines
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1 -0
@@ -207,5 +207,6 @@ DPDK_17.08 {
 
        rte_bus_from_name;
        rte_bus_from_dev;
+       rte_eal_using_phys_addrs;

Is this only for the UIO mapping? Would it be better to let UIO skip (and warn?) over RTE_BAD_PHYS_ADDR mappings? That way we don't need this export and its probably more resilient to bad mappings.

Thoughts? Olivier?

Quoted 75 lines
lib/librte_eal/linuxapp/eal/rte_eal_version.map +0 -0
 } DPDK_17.05;
lib/librte_eal/linuxapp/eal/rte_memory_linux.h new file +64 -1
new file mode 100644
index 0000000..0400711
@@ -0,0 +1,64 @@
+/*-
+ *   BSD LICENSE
+ *
+ *   Copyright(c) 2017 6WIND S.A. All rights reserved.
+ *   All rights reserved.
+ *
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
+ *   are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
+ *       distribution.
+ *     * Neither the name of 6WIND nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _RTE_MEMORY_LINUX_H_
+#define _RTE_MEMORY_LINUX_H_
+
+/**
+ * @file
+ *
+ * Memory-related Linux-specific RTE API.
+ */
+
+#include <rte_memory.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Drivers based on uio will not load unless physical
+ * addresses are obtainable. It is only possible to get
+ * physical addresses when running as a privileged user.
+ *
+ * @return
+ *   1 if the system is able to obtain physical addresses.
+ *   0 if using DMA addresses through an IOMMU.
+ */
+int rte_eal_using_phys_addrs(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_MEMORY_LINUX_H_ */
--

2.1.4

#3 lore raw

Re: [PATCH 1/8] eal: expose rte_eal_using_phys_addrs

Hi,

Quoted 101 lines · Jan Blunck
Quoted 91 lines · Gaetan Rivet

This function was previously private to the EAL layer. Other subsystems requires it, such as the PCI bus.

This function is only exposed for linuxapps.

In order not to force other components to include stdbool, which is incompatible with several NIC drivers, the return type has been changed from bool to int.

---
 lib/librte_eal/common/eal_private.h             | 11 -----
 lib/librte_eal/linuxapp/eal/Makefile            |  2 +
 lib/librte_eal/linuxapp/eal/eal_memory.c        |  3 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           |  1 +
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +
 lib/librte_eal/linuxapp/eal/rte_memory_linux.h  | 64 +++++++++++++++++++++++++
 6 files changed, 70 insertions(+), 12 deletions(-)
 create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h
lib/librte_eal/common/eal_private.h +0 -11
index 6d2206a..b7e4cc6 100644
@@ -327,17 +327,6 @@ int rte_eal_hugepage_init(void);
  */
 int rte_eal_hugepage_attach(void);
 
-/**
- * Returns true if the system is able to obtain
- * physical addresses. Return false if using DMA
- * addresses through an IOMMU.
- *
- * Drivers based on uio will not load unless physical
- * addresses are obtainable. It is only possible to get
- * physical addresses when running as a privileged user.
- */
-bool rte_eal_using_phys_addrs(void);
-
 /*
  * Validate a bus name.
  *
lib/librte_eal/linuxapp/eal/Makefile +2 -0
index 640afd0..530e286 100644
@@ -131,4 +131,6 @@ INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h
 SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include/exec-env := \
        $(addprefix include/exec-env/,$(INC))
 
+SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include += rte_memory_linux.h
+
 include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_eal/linuxapp/eal/eal_memory.c +2 -1
index ebe0683..072bfe4 100644
@@ -99,6 +99,7 @@
 #include "eal_internal_cfg.h"
 #include "eal_filesystem.h"
 #include "eal_hugepages.h"
+#include "rte_memory_linux.h"
 
 #define PFN_MASK_SIZE  8
 
@@ -1472,7 +1473,7 @@ rte_eal_hugepage_attach(void)
        return -1;
 }
 
-bool
+int
 rte_eal_using_phys_addrs(void)
 {
        return phys_addrs_available;
lib/librte_eal/linuxapp/eal/eal_pci.c +1 -0
index 595622b..9d5b051 100644
@@ -45,6 +45,7 @@
 #include "eal_filesystem.h"
 #include "eal_private.h"
 #include "eal_pci_init.h"
+#include "rte_memory_linux.h"
 
 /**
  * @file
lib/librte_eal/linuxapp/eal/rte_eal_version.map +0 -0
index a5127d6..8916520 100644

lib/librte_eal/linuxapp/eal/rte_eal_version.map DPDK_17.08 { · line 210

Quoted 4 lines
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1 -0
@@ -207,5 +207,6 @@ DPDK_17.08 {
 
        rte_bus_from_name;
        rte_bus_from_dev;
+       rte_eal_using_phys_addrs;  

Is this only for the UIO mapping? Would it be better to let UIO skip (and warn?) over RTE_BAD_PHYS_ADDR mappings? That way we don't need this export and its probably more resilient to bad mappings.

Quoted 1 line

Thoughts? Olivier?

From what I see, rte_eal_using_phys_addrs() is used by:

	rte_eal_pci_map_device(struct rte_pci_device *dev)
	{
		...
	        case RTE_KDRV_IGB_UIO:
	        case RTE_KDRV_UIO_GENERIC:
		if (rte_eal_using_phys_addrs()) {
			/* map resources for devices that use uio */
			ret = pci_uio_map_resource(dev);
		}

Looking at pci_uio_map_resource() and its callees, I'm not sure it's easy to replace it something else. The functions that would return RTE_BAD_PHYS_ADDR (virt2phy-like) are not called there.

#4 lore raw

Re: [PATCH 1/8] eal: expose rte_eal_using_phys_addrs

Quoted 119 lines · Olivier Matz

Hi,

Quoted 101 lines · Jan Blunck
Quoted 91 lines · Gaetan Rivet

This function was previously private to the EAL layer. Other subsystems requires it, such as the PCI bus.

This function is only exposed for linuxapps.

In order not to force other components to include stdbool, which is incompatible with several NIC drivers, the return type has been changed from bool to int.

---
 lib/librte_eal/common/eal_private.h             | 11 -----
 lib/librte_eal/linuxapp/eal/Makefile            |  2 +
 lib/librte_eal/linuxapp/eal/eal_memory.c        |  3 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           |  1 +
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +
 lib/librte_eal/linuxapp/eal/rte_memory_linux.h  | 64 +++++++++++++++++++++++++
 6 files changed, 70 insertions(+), 12 deletions(-)
 create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h
lib/librte_eal/common/eal_private.h +0 -11
index 6d2206a..b7e4cc6 100644
@@ -327,17 +327,6 @@ int rte_eal_hugepage_init(void);
  */
 int rte_eal_hugepage_attach(void);
 
-/**
- * Returns true if the system is able to obtain
- * physical addresses. Return false if using DMA
- * addresses through an IOMMU.
- *
- * Drivers based on uio will not load unless physical
- * addresses are obtainable. It is only possible to get
- * physical addresses when running as a privileged user.
- */
-bool rte_eal_using_phys_addrs(void);
-
 /*
  * Validate a bus name.
  *
lib/librte_eal/linuxapp/eal/Makefile +2 -0
index 640afd0..530e286 100644
@@ -131,4 +131,6 @@ INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h
 SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include/exec-env := \
        $(addprefix include/exec-env/,$(INC))
 
+SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include += rte_memory_linux.h
+
 include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_eal/linuxapp/eal/eal_memory.c +2 -1
index ebe0683..072bfe4 100644
@@ -99,6 +99,7 @@
 #include "eal_internal_cfg.h"
 #include "eal_filesystem.h"
 #include "eal_hugepages.h"
+#include "rte_memory_linux.h"
 
 #define PFN_MASK_SIZE  8
 
@@ -1472,7 +1473,7 @@ rte_eal_hugepage_attach(void)
        return -1;
 }
 
-bool
+int
 rte_eal_using_phys_addrs(void)
 {
        return phys_addrs_available;
lib/librte_eal/linuxapp/eal/eal_pci.c +1 -0
index 595622b..9d5b051 100644
@@ -45,6 +45,7 @@
 #include "eal_filesystem.h"
 #include "eal_private.h"
 #include "eal_pci_init.h"
+#include "rte_memory_linux.h"
 
 /**
  * @file
lib/librte_eal/linuxapp/eal/rte_eal_version.map +0 -0
index a5127d6..8916520 100644

lib/librte_eal/linuxapp/eal/rte_eal_version.map DPDK_17.08 { · line 210

Quoted 4 lines
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1 -0
@@ -207,5 +207,6 @@ DPDK_17.08 {
 
        rte_bus_from_name;
        rte_bus_from_dev;
+       rte_eal_using_phys_addrs;

Is this only for the UIO mapping? Would it be better to let UIO skip (and warn?) over RTE_BAD_PHYS_ADDR mappings? That way we don't need this export and its probably more resilient to bad mappings.

Quoted 1 line

Thoughts? Olivier?

From what I see, rte_eal_using_phys_addrs() is used by:

        rte_eal_pci_map_device(struct rte_pci_device *dev)
        {
                ...
                case RTE_KDRV_IGB_UIO:
                case RTE_KDRV_UIO_GENERIC:
                if (rte_eal_using_phys_addrs()) {
                        /* map resources for devices that use uio */
                        ret = pci_uio_map_resource(dev);
                }
Quoted 4 lines

Looking at pci_uio_map_resource() and its callees, I'm not sure it's easy to replace it something else. The functions that would return RTE_BAD_PHYS_ADDR (virt2phy-like) are not called there.

Right, so why is it there in the first place? From what I can see the code should work just fine even in cases we don't have physical addresses available. Shouldn't the code actually requiring physical addresses (e.g. RX queue setup, ...) check for this instead?

#5 lore raw

Re: [PATCH 1/8] eal: expose rte_eal_using_phys_addrs

Quoted 125 lines · Jan Blunck
Quoted 119 lines · Olivier Matz

Hi,

Quoted 101 lines · Jan Blunck
Quoted 91 lines · Gaetan Rivet

This function was previously private to the EAL layer. Other subsystems requires it, such as the PCI bus.

This function is only exposed for linuxapps.

In order not to force other components to include stdbool, which is incompatible with several NIC drivers, the return type has been changed from bool to int.

---
 lib/librte_eal/common/eal_private.h             | 11 -----
 lib/librte_eal/linuxapp/eal/Makefile            |  2 +
 lib/librte_eal/linuxapp/eal/eal_memory.c        |  3 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           |  1 +
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +
 lib/librte_eal/linuxapp/eal/rte_memory_linux.h  | 64 +++++++++++++++++++++++++
 6 files changed, 70 insertions(+), 12 deletions(-)
 create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h
lib/librte_eal/common/eal_private.h +0 -11
index 6d2206a..b7e4cc6 100644
@@ -327,17 +327,6 @@ int rte_eal_hugepage_init(void);
  */
 int rte_eal_hugepage_attach(void);
 
-/**
- * Returns true if the system is able to obtain
- * physical addresses. Return false if using DMA
- * addresses through an IOMMU.
- *
- * Drivers based on uio will not load unless physical
- * addresses are obtainable. It is only possible to get
- * physical addresses when running as a privileged user.
- */
-bool rte_eal_using_phys_addrs(void);
-
 /*
  * Validate a bus name.
  *
lib/librte_eal/linuxapp/eal/Makefile +2 -0
index 640afd0..530e286 100644
@@ -131,4 +131,6 @@ INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h
 SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include/exec-env := \
        $(addprefix include/exec-env/,$(INC))
 
+SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include += rte_memory_linux.h
+
 include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_eal/linuxapp/eal/eal_memory.c +2 -1
index ebe0683..072bfe4 100644
@@ -99,6 +99,7 @@
 #include "eal_internal_cfg.h"
 #include "eal_filesystem.h"
 #include "eal_hugepages.h"
+#include "rte_memory_linux.h"
 
 #define PFN_MASK_SIZE  8
 
@@ -1472,7 +1473,7 @@ rte_eal_hugepage_attach(void)
        return -1;
 }
 
-bool
+int
 rte_eal_using_phys_addrs(void)
 {
        return phys_addrs_available;
lib/librte_eal/linuxapp/eal/eal_pci.c +1 -0
index 595622b..9d5b051 100644
@@ -45,6 +45,7 @@
 #include "eal_filesystem.h"
 #include "eal_private.h"
 #include "eal_pci_init.h"
+#include "rte_memory_linux.h"
 
 /**
  * @file
lib/librte_eal/linuxapp/eal/rte_eal_version.map +0 -0
index a5127d6..8916520 100644

lib/librte_eal/linuxapp/eal/rte_eal_version.map DPDK_17.08 { · line 210

Quoted 4 lines
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1 -0
@@ -207,5 +207,6 @@ DPDK_17.08 {
 
        rte_bus_from_name;
        rte_bus_from_dev;
+       rte_eal_using_phys_addrs;  

Is this only for the UIO mapping? Would it be better to let UIO skip (and warn?) over RTE_BAD_PHYS_ADDR mappings? That way we don't need this export and its probably more resilient to bad mappings.

Quoted 1 line

Thoughts? Olivier?

From what I see, rte_eal_using_phys_addrs() is used by:

        rte_eal_pci_map_device(struct rte_pci_device *dev)
        {
                ...
                case RTE_KDRV_IGB_UIO:
                case RTE_KDRV_UIO_GENERIC:
                if (rte_eal_using_phys_addrs()) {
                        /* map resources for devices that use uio */
                        ret = pci_uio_map_resource(dev);
                }
Quoted 4 lines

Looking at pci_uio_map_resource() and its callees, I'm not sure it's easy to replace it something else. The functions that would return RTE_BAD_PHYS_ADDR (virt2phy-like) are not called there.

Quoted 4 lines

Right, so why is it there in the first place? From what I can see the code should work just fine even in cases we don't have physical addresses available. Shouldn't the code actually requiring physical addresses (e.g. RX queue setup, ...) check for this instead?

My understanding of the commit cdc242f260e7 ("eal/linux: support running as unprivileged user") is:
if dpdk is started with hugepages but without the privilege to get the physical address, the memsegs are filled with dummy physical addresses starting at 0. The mapping of these dummy physical addresses as IOVA is done in eal_vfio.c.

So, back to our question, I think I was wrong in my previous answer, and virt2phy-like functions would not return RTE_BAD_PHYS_ADDR in that case, they will return the dummy physical address instead.

Maybe the function rte_eal_using_phys_addrs() could have a better name, but I think having this guard here is correct.

Olivier

#6 lore raw

PATCH 2/8 ethdev: remove useless PCI dependency

In reply to Gaetan Rivet
---
 lib/librte_ether/rte_ethdev.c | 1 -
 1 file changed, 1 deletion(-)
lib/librte_ether/rte_ethdev.c +0 -1
index b572143..a979001 100644
@@ -47,7 +47,6 @@
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_interrupts.h>
-#include <rte_pci.h>
 #include <rte_memory.h>
 #include <rte_memcpy.h>
 #include <rte_memzone.h>
Signature · 1 line
2.1.4
#7 lore raw

PATCH 3/8 pmdinfogen: move to drivers subdirectory

In reply to Gaetan Rivet

pmdinfogen has a dependency on the PCI bus. The latter must be built first.

---
 GNUmakefile                        |   2 +-
 MAINTAINERS                        |   2 +-
 buildtools/Makefile                |  36 ----
 buildtools/pmdinfogen/Makefile     |  47 -----
 buildtools/pmdinfogen/pmdinfogen.c | 422 -------------------------------------
 buildtools/pmdinfogen/pmdinfogen.h | 125 -----------
 drivers/Makefile                   |   4 +-
 drivers/pmdinfogen/Makefile        |  47 +++++
 drivers/pmdinfogen/pmdinfogen.c    | 422 +++++++++++++++++++++++++++++++++++++
 drivers/pmdinfogen/pmdinfogen.h    | 125 +++++++++++
 10 files changed, 599 insertions(+), 633 deletions(-)
 delete mode 100644 buildtools/Makefile
 delete mode 100644 buildtools/pmdinfogen/Makefile
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.c
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.h
 create mode 100644 drivers/pmdinfogen/Makefile
 create mode 100644 drivers/pmdinfogen/pmdinfogen.c
 create mode 100644 drivers/pmdinfogen/pmdinfogen.h
GNUmakefile +1 -1
index 45b7fbb..c292646 100644
@@ -40,7 +40,7 @@ export RTE_SDK
 # directory list
 #
 
-ROOTDIRS-y := buildtools lib drivers app
+ROOTDIRS-y := lib drivers app
 ROOTDIRS-  := test
 
 include $(RTE_SDK)/mk/rte.sdkroot.mk
MAINTAINERS +1 -1
index afb4cab..9f9b81b 100644
@@ -72,7 +72,7 @@ F: doc/guides/rel_notes/deprecation.rst
 F: devtools/validate-abi.sh
 
 Driver information
-F: buildtools/pmdinfogen/
+F: drivers/pmdinfogen/
 F: usertools/dpdk-pmdinfo.py
 F: doc/guides/tools/pmdinfo.rst
 
buildtools/Makefile deleted +0 -36
deleted file mode 100644
index 35a42ff..0000000
@@ -1,36 +0,0 @@
-#   BSD LICENSE
-#
-#   Copyright(c) 2016 Neil Horman. All rights reserved.
-#   All rights reserved.
-#
-#   Redistribution and use in source and binary forms, with or without
-#   modification, are permitted provided that the following conditions
-#   are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in
-#       the documentation and/or other materials provided with the
-#       distribution.
-#     * Neither the name of Intel Corporation nor the names of its
-#       contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-include $(RTE_SDK)/mk/rte.vars.mk
-
-DIRS-y += pmdinfogen
-
-include $(RTE_SDK)/mk/rte.subdir.mk
buildtools/pmdinfogen/Makefile deleted +0 -47

47 lines not on this page · raw message

buildtools/pmdinfogen/pmdinfogen.c deleted +0 -422

422 lines not on this page · raw message

buildtools/pmdinfogen/pmdinfogen.h deleted +0 -125

125 lines not on this page · raw message

drivers/Makefile +3 -1
index a04a01f..f3f9417 100644
@@ -32,10 +32,12 @@
 include $(RTE_SDK)/mk/rte.vars.mk
 
 DIRS-y += bus
+DIRS-y += pmdinfogen
+DEPDIRS-pmdinfogen := bus
 DIRS-y += mempool
 DEPDIRS-mempool := bus
 DIRS-y += net
-DEPDIRS-net := bus mempool
+DEPDIRS-net := bus pmdinfogen mempool
 DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto
 DEPDIRS-crypto := mempool
 DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event
drivers/pmdinfogen/Makefile new file +47 -0

47 lines not on this page · raw message

drivers/pmdinfogen/pmdinfogen.c new file +422 -0

422 lines not on this page · raw message

drivers/pmdinfogen/pmdinfogen.h new file +125 -0

125 lines not on this page · raw message

Signature · 1 line
2.1.4
#8 lore raw

PATCH 4/8 cryptodev: disabled by default

In reply to Gaetan Rivet

The cryptodev library has a dependency on the PCI bus. Moving the PCI bus out of the EAL breaks its compilation.

---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base +1 -1
index 8907bea..3893622 100644
@@ -432,7 +432,7 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 #
 # Compile generic crypto device library
 #
-CONFIG_RTE_LIBRTE_CRYPTODEV=y
+CONFIG_RTE_LIBRTE_CRYPTODEV=n
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
 CONFIG_RTE_CRYPTO_MAX_DEVS=64
 CONFIG_RTE_CRYPTODEV_NAME_LEN=64
Signature · 1 line
2.1.4
#9 lore raw

PATCH 5/8 eventdev: disabled by default

In reply to Gaetan Rivet

The eventdev library has a dependency on the PCI bus. Moving the PCI bus out of the EAL breaks its compilation.

---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base +1 -1
index 3893622..9f94956 100644
@@ -515,7 +515,7 @@ CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO=y
 #
 # Compile generic event device library
 #
-CONFIG_RTE_LIBRTE_EVENTDEV=y
+CONFIG_RTE_LIBRTE_EVENTDEV=n
 CONFIG_RTE_LIBRTE_EVENTDEV_DEBUG=n
 CONFIG_RTE_EVENT_MAX_DEVS=16
 CONFIG_RTE_EVENT_MAX_QUEUES_PER_DEV=64
Signature · 1 line
2.1.4
#10 lore raw

PATCH 6/8 pdump: disabled by default

In reply to Gaetan Rivet

The pdump library has a dependency on the PCI bus. Moving the PCI bus out of the EAL breaks its compilation.

---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base +1 -1
index 9f94956..f035ea6 100644
@@ -702,7 +702,7 @@ CONFIG_RTE_KNI_PREEMPT_DEFAULT=y
 #
 # Compile the pdump library
 #
-CONFIG_RTE_LIBRTE_PDUMP=y
+CONFIG_RTE_LIBRTE_PDUMP=n
 
 #
 # Compile vhost user library
Signature · 1 line
2.1.4
#11 lore raw

PATCH 7/8 kni: disabled by default

In reply to Gaetan Rivet

The kni library has a dependency on the PCI bus. Moving the PCI bus out of the EAL breaks its compilation.

---
 config/common_linuxapp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_linuxapp +1 -1
index b3cf41b..cc85cc6 100644
@@ -38,7 +38,7 @@ CONFIG_RTE_EXEC_ENV_LINUXAPP=y
 CONFIG_RTE_EAL_IGB_UIO=y
 CONFIG_RTE_EAL_VFIO=y
 CONFIG_RTE_KNI_KMOD=y
-CONFIG_RTE_LIBRTE_KNI=y
+CONFIG_RTE_LIBRTE_KNI=n
 CONFIG_RTE_LIBRTE_PMD_KNI=y
 CONFIG_RTE_LIBRTE_VHOST=y
 CONFIG_RTE_LIBRTE_PMD_VHOST=y
Signature · 1 line
2.1.4
#12 lore raw

PATCH 8/8 bus/pci: introduce pci bus

In reply to Gaetan Rivet

Move the PCI bus from the EAL to drivers/bus.

---
 config/common_base                             |   5 +
 drivers/bus/Makefile                           |   2 +
 drivers/bus/pci/Makefile                       |  60 ++
 drivers/bus/pci/bsd/Makefile                   |  32 ++
 drivers/bus/pci/bsd/rte_bus_pci_version.map    |  21 +
 drivers/bus/pci/bsd/rte_pci.c                  | 672 +++++++++++++++++++++++
 drivers/bus/pci/include/rte_pci.h              | 628 +++++++++++++++++++++
 drivers/bus/pci/linux/Makefile                 |  37 ++
 drivers/bus/pci/linux/rte_bus_pci_version.map  |  21 +
 drivers/bus/pci/linux/rte_pci.c                | 724 +++++++++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_init.h           |  97 ++++
 drivers/bus/pci/linux/rte_pci_uio.c            | 567 +++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_vfio.c           | 674 +++++++++++++++++++++++
 drivers/bus/pci/linux/rte_vfio_mp_sync.c       | 424 +++++++++++++++
 drivers/bus/pci/private.h                      | 167 ++++++
 drivers/bus/pci/rte_pci_common.c               | 615 +++++++++++++++++++++
 drivers/bus/pci/rte_pci_common_uio.c           | 233 ++++++++
 lib/librte_eal/bsdapp/eal/Makefile             |   3 -
 lib/librte_eal/bsdapp/eal/eal_pci.c            | 672 -----------------------
 lib/librte_eal/common/Makefile                 |   2 +-
 lib/librte_eal/common/eal_common_pci.c         | 615 ---------------------
 lib/librte_eal/common/eal_common_pci_uio.c     | 233 --------
 lib/librte_eal/linuxapp/eal/Makefile           |  10 -
 lib/librte_eal/linuxapp/eal/eal_pci.c          | 724 -------------------------
 lib/librte_eal/linuxapp/eal/eal_pci_init.h     |  97 ----
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c      | 567 -------------------
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c     | 674 -----------------------
 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c | 424 ---------------
 mk/rte.app.mk                                  |   2 +
 29 files changed, 4982 insertions(+), 4020 deletions(-)
 create mode 100644 drivers/bus/pci/Makefile
 create mode 100644 drivers/bus/pci/bsd/Makefile
 create mode 100644 drivers/bus/pci/bsd/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/bsd/rte_pci.c
 create mode 100644 drivers/bus/pci/include/rte_pci.h
 create mode 100644 drivers/bus/pci/linux/Makefile
 create mode 100644 drivers/bus/pci/linux/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/linux/rte_pci.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_init.h
 create mode 100644 drivers/bus/pci/linux/rte_pci_uio.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_vfio.c
 create mode 100644 drivers/bus/pci/linux/rte_vfio_mp_sync.c
 create mode 100644 drivers/bus/pci/private.h
 create mode 100644 drivers/bus/pci/rte_pci_common.c
 create mode 100644 drivers/bus/pci/rte_pci_common_uio.c
 delete mode 100644 lib/librte_eal/bsdapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci_uio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_init.h
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_uio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
config/common_base +5 -0
index f035ea6..65daeab 100644
@@ -150,6 +150,11 @@ CONFIG_RTE_ETHDEV_TX_PREPARE_NOOP=n
 CONFIG_RTE_NIC_BYPASS=n
 
 #
+# Compile PCI bus driver
+#
+CONFIG_RTE_LIBRTE_PCI_BUS=y
+
+#
 # Compile burst-oriented Amazon ENA PMD driver
 #
 CONFIG_RTE_LIBRTE_ENA_PMD=y
drivers/bus/Makefile +2 -0
index 1e5b281..1d1ddae 100644
@@ -35,5 +35,7 @@ core-libs := librte_eal librte_mbuf librte_mempool librte_ring librte_ether
 
 DIRS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc
 DEPDIRS-fslmc = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_PCI_BUS) += pci
+DEPDIRS-pci = $(core-libs)
 
 include $(RTE_SDK)/mk/rte.subdir.mk
drivers/bus/pci/Makefile new file +60 -0

60 lines not on this page · raw message

drivers/bus/pci/bsd/Makefile new file +32 -0
new file mode 100644
index 0000000..77cf539
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 6WIND S.A.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of 6WIND nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+SRCS += rte_pci.c
drivers/bus/pci/bsd/rte_bus_pci_version.map new file +21 -0
new file mode 100644
index 0000000..eca49e9
@@ -0,0 +1,21 @@
+DPDK_17.08 {
+	global:
+
+	rte_pci_detach;
+	rte_pci_dump;
+	rte_pci_ioport_map;
+	rte_pci_ioport_read;
+	rte_pci_ioport_unmap;
+	rte_pci_ioport_write;
+	rte_pci_map_device;
+	rte_pci_probe;
+	rte_pci_probe_one;
+	rte_pci_read_config;
+	rte_pci_register;
+	rte_pci_scan;
+	rte_pci_unmap_device;
+	rte_pci_unregister;
+	rte_pci_write_config;
+
+	local: *;
+};
drivers/bus/pci/bsd/rte_pci.c new file +672 -0

672 lines not on this page · raw message

drivers/bus/pci/include/rte_pci.h new file +628 -0

628 lines not on this page · raw message

drivers/bus/pci/linux/Makefile new file +37 -0
new file mode 100644
index 0000000..d2ea84c
@@ -0,0 +1,37 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 6WIND S.A.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of 6WIND nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+SRCS += rte_pci.c
+SRCS += rte_pci_uio.c
+SRCS += rte_pci_vfio.c
+SRCS += rte_vfio_mp_sync.c
+
+CFLAGS += -D_GNU_SOURCE
drivers/bus/pci/linux/rte_bus_pci_version.map new file +21 -0
new file mode 100644
index 0000000..eca49e9
@@ -0,0 +1,21 @@
+DPDK_17.08 {
+	global:
+
+	rte_pci_detach;
+	rte_pci_dump;
+	rte_pci_ioport_map;
+	rte_pci_ioport_read;
+	rte_pci_ioport_unmap;
+	rte_pci_ioport_write;
+	rte_pci_map_device;
+	rte_pci_probe;
+	rte_pci_probe_one;
+	rte_pci_read_config;
+	rte_pci_register;
+	rte_pci_scan;
+	rte_pci_unmap_device;
+	rte_pci_unregister;
+	rte_pci_write_config;
+
+	local: *;
+};
drivers/bus/pci/linux/rte_pci.c new file +724 -0

724 lines not on this page · raw message

drivers/bus/pci/linux/rte_pci_init.h new file +97 -0

97 lines not on this page · raw message

drivers/bus/pci/linux/rte_pci_uio.c new file +567 -0

567 lines not on this page · raw message

drivers/bus/pci/linux/rte_pci_vfio.c new file +674 -0

123 lines not on this page · raw message

drivers/bus/pci/linux/rte_vfio_mp_sync.c new file +424 -0

424 lines not on this page · raw message

drivers/bus/pci/private.h new file +167 -0

167 lines not on this page · raw message

drivers/bus/pci/rte_pci_common.c new file +615 -0

615 lines not on this page · raw message

drivers/bus/pci/rte_pci_common_uio.c new file +233 -0

233 lines not on this page · raw message

lib/librte_eal/bsdapp/eal/Makefile +0 -3
index a0f9950..f219848 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/bsdapp/eal/eal_pci.c deleted +0 -672

672 lines not on this page · raw message

lib/librte_eal/common/Makefile +1 -1
index a5bd108..c4e0af2 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/common/eal_common_pci.c deleted +0 -615

615 lines not on this page · raw message

lib/librte_eal/common/eal_common_pci_uio.c deleted +0 -233

233 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/Makefile +0 -10
index 530e286..872766e 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/linuxapp/eal/eal_pci.c deleted +0 -724

724 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_pci_init.h deleted +0 -97

97 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_pci_uio.c deleted +0 -567

567 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_pci_vfio.c deleted +0 -674

674 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c deleted +0 -424

424 lines not on this page · raw message

mk/rte.app.mk +2 -0
index bcaf1b3..d476068 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.1.4

Part of the diff is not shown here. View the raw message.

#13 lore raw

cover bus/pci: remove PCI bus from EAL

In reply to Gaetan Rivet

This patchset moves the PCI bus out of the EAL to the drivers/bus subdirectory.

The last remaining dependencies have been worked out and the PCI bus is now ready to be moved.
Several issues remain:

* librte_cryptodev
* librte_pdump
* librte_kni

All depend on the PCI bus being available within the EAL. This patchset disable them to allow for compilation, but it should be fixed before integration and the related commits removed.

The pmdinfogen app has been moved to the drivers subdirectory. This allows using the dependency syntax from the build system, as this app also depends on the PCI bus. The dependency graph is as follows:

drivers/bus/pci
|
+ drivers/pmdinfogen
|
+ drivers/net

The compilation has been tested on debian 8, Redhat 7.2 and FreeBSD 10.3

This patchset depends on:

eal: complete attach / detach support
http://dpdk.org/ml/archives/dev/2017-June/067057.html
http://dpdk.org/dev/patchwork/patch/24969/

v1 -> v2:

This patchet now depends also on the eventdev PCI dependency fix:

[PATCH v2 0/4] Remove PCI and VDEV dependency from eventdev library
http://dpdk.org/ml/archives/dev/2017-June/067402.html
http://dpdk.org/dev/patchwork/patch/25092/

* Fixes a few PCI dependency left
* While wholes files are moved, fixed a few checkpatch warnings to start anew.
* Updated eventdev and cryptodev build dependencies

People who want to evaluate / test the whole system can clone:
https://github.com/grivet/dpdk/tree/master-net

Gaetan Rivet (12):
eal: expose rte_eal_using_phys_addrs
ethdev: remove useless PCI dependency
bus: properly include rte_debug
eal: remove references to PCI
pmdinfogen: move to drivers subdirectory
cryptodev: disabled by default
pdump: disabled by default
kni: disabled by default
bus/pci: introduce pci bus
bus/pci: follow checkpatch
drivers: update eventdev dependencies
drivers: update cryptodev dependencies

 GNUmakefile                                     |   2 +-
 MAINTAINERS                                     |   2 +-
 buildtools/Makefile                             |  36 --
 buildtools/pmdinfogen/Makefile                  |  47 --
 buildtools/pmdinfogen/pmdinfogen.c              | 422 --------------
 buildtools/pmdinfogen/pmdinfogen.h              | 125 ----
 config/common_base                              |  14 +-
 config/common_linuxapp                          |   2 +-
 drivers/Makefile                                |   7 +-
 drivers/bus/Makefile                            |   2 +
 drivers/bus/pci/Makefile                        |  60 ++
 drivers/bus/pci/bsd/Makefile                    |  32 ++
 drivers/bus/pci/bsd/rte_bus_pci_version.map     |  21 +
 drivers/bus/pci/bsd/rte_pci.c                   | 672 ++++++++++++++++++++++
 drivers/bus/pci/include/rte_pci.h               | 654 +++++++++++++++++++++
 drivers/bus/pci/linux/Makefile                  |  37 ++
 drivers/bus/pci/linux/rte_bus_pci_version.map   |  21 +
 drivers/bus/pci/linux/rte_pci.c                 | 724 ++++++++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_init.h            |  97 ++++
 drivers/bus/pci/linux/rte_pci_uio.c             | 567 +++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_vfio.c            | 674 ++++++++++++++++++++++
 drivers/bus/pci/linux/rte_vfio_mp_sync.c        | 424 ++++++++++++++
 drivers/bus/pci/private.h                       | 167 ++++++
 drivers/bus/pci/rte_pci_common.c                | 598 +++++++++++++++++++
 drivers/bus/pci/rte_pci_common_uio.c            | 234 ++++++++
 drivers/pmdinfogen/Makefile                     |  47 ++
 drivers/pmdinfogen/pmdinfogen.c                 | 422 ++++++++++++++
 drivers/pmdinfogen/pmdinfogen.h                 | 125 ++++
 lib/librte_eal/bsdapp/eal/Makefile              |   3 -
 lib/librte_eal/bsdapp/eal/eal.c                 |   1 -
 lib/librte_eal/bsdapp/eal/eal_pci.c             | 672 ----------------------
 lib/librte_eal/common/Makefile                  |   2 +-
 lib/librte_eal/common/eal_common_bus.c          |   1 +
 lib/librte_eal/common/eal_common_pci.c          | 598 -------------------
 lib/librte_eal/common/eal_common_pci_uio.c      | 233 --------
 lib/librte_eal/common/eal_private.h             | 138 -----
 lib/librte_eal/linuxapp/eal/Makefile            |  12 +-
 lib/librte_eal/linuxapp/eal/eal.c               |   1 -
 lib/librte_eal/linuxapp/eal/eal_interrupts.c    |   1 -
 lib/librte_eal/linuxapp/eal/eal_memory.c        |   3 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           | 723 -----------------------
 lib/librte_eal/linuxapp/eal/eal_pci_init.h      |  97 ----
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c       | 567 -------------------
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c      | 674 ----------------------
 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c  | 424 --------------
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |   1 +
 lib/librte_eal/linuxapp/eal/rte_memory_linux.h  |  64 +++
 lib/librte_ether/rte_ethdev.c                   |   1 -
 mk/rte.app.mk                                   |   2 +
 49 files changed, 5671 insertions(+), 4782 deletions(-)
 delete mode 100644 buildtools/Makefile
 delete mode 100644 buildtools/pmdinfogen/Makefile
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.c
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.h
 create mode 100644 drivers/bus/pci/Makefile
 create mode 100644 drivers/bus/pci/bsd/Makefile
 create mode 100644 drivers/bus/pci/bsd/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/bsd/rte_pci.c
 create mode 100644 drivers/bus/pci/include/rte_pci.h
 create mode 100644 drivers/bus/pci/linux/Makefile
 create mode 100644 drivers/bus/pci/linux/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/linux/rte_pci.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_init.h
 create mode 100644 drivers/bus/pci/linux/rte_pci_uio.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_vfio.c
 create mode 100644 drivers/bus/pci/linux/rte_vfio_mp_sync.c
 create mode 100644 drivers/bus/pci/private.h
 create mode 100644 drivers/bus/pci/rte_pci_common.c
 create mode 100644 drivers/bus/pci/rte_pci_common_uio.c
 create mode 100644 drivers/pmdinfogen/Makefile
 create mode 100644 drivers/pmdinfogen/pmdinfogen.c
 create mode 100644 drivers/pmdinfogen/pmdinfogen.h
 delete mode 100644 lib/librte_eal/bsdapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci_uio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_init.h
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_uio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
 create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h
Signature · 1 line
2.1.4
#14 lore raw

PATCH v2 1/12 eal: expose rte_eal_using_phys_addrs

This function was previously private to the EAL layer. Other subsystems requires it, such as the PCI bus.

This function is only exposed for linuxapps.

In order not to force other components to include stdbool, which is incompatible with several NIC drivers, the return type has been changed from bool to int.

---
 lib/librte_eal/common/eal_private.h             | 11 -----
 lib/librte_eal/linuxapp/eal/Makefile            |  2 +
 lib/librte_eal/linuxapp/eal/eal_memory.c        |  3 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           |  1 +
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +
 lib/librte_eal/linuxapp/eal/rte_memory_linux.h  | 64 +++++++++++++++++++++++++
 6 files changed, 70 insertions(+), 12 deletions(-)
 create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h
lib/librte_eal/common/eal_private.h +0 -11
index 6d2206a..b7e4cc6 100644
@@ -327,17 +327,6 @@ int rte_eal_hugepage_init(void);
  */
 int rte_eal_hugepage_attach(void);
 
-/**
- * Returns true if the system is able to obtain
- * physical addresses. Return false if using DMA
- * addresses through an IOMMU.
- *
- * Drivers based on uio will not load unless physical
- * addresses are obtainable. It is only possible to get
- * physical addresses when running as a privileged user.
- */
-bool rte_eal_using_phys_addrs(void);
-
 /*
  * Validate a bus name.
  *
lib/librte_eal/linuxapp/eal/Makefile +2 -0
index 640afd0..530e286 100644
@@ -131,4 +131,6 @@ INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h
 SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include/exec-env := \
 	$(addprefix include/exec-env/,$(INC))
 
+SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include += rte_memory_linux.h
+
 include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_eal/linuxapp/eal/eal_memory.c +2 -1
index 9c9baf6..7a02dcd 100644
@@ -70,6 +70,7 @@
 #include "eal_internal_cfg.h"
 #include "eal_filesystem.h"
 #include "eal_hugepages.h"
+#include "rte_memory_linux.h"
 
 #define PFN_MASK_SIZE	8
 
@@ -1443,7 +1444,7 @@ rte_eal_hugepage_attach(void)
 	return -1;
 }
 
-bool
+int
 rte_eal_using_phys_addrs(void)
 {
 	return phys_addrs_available;
lib/librte_eal/linuxapp/eal/eal_pci.c +1 -0
index 595622b..9d5b051 100644
@@ -45,6 +45,7 @@
 #include "eal_filesystem.h"
 #include "eal_private.h"
 #include "eal_pci_init.h"
+#include "rte_memory_linux.h"
 
 /**
  * @file
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1 -0
index 19eec05..6a677fc 100644
@@ -209,5 +209,6 @@ DPDK_17.08 {
 	rte_bus_from_dev;
 	rte_eal_devargs_clone;
 	rte_eal_devargs_rmv;
+	rte_eal_using_phys_addrs;
 
 } DPDK_17.05;
lib/librte_eal/linuxapp/eal/rte_memory_linux.h new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
2.1.4
#15 lore raw

PATCH v2 2/12 ethdev: remove useless PCI dependency

In reply to Gaetan Rivet
---
 lib/librte_ether/rte_ethdev.c | 1 -
 1 file changed, 1 deletion(-)
lib/librte_ether/rte_ethdev.c +0 -1
index bc603c1..2446ed9 100644
@@ -47,7 +47,6 @@
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_interrupts.h>
-#include <rte_pci.h>
 #include <rte_memory.h>
 #include <rte_memcpy.h>
 #include <rte_memzone.h>
Signature · 1 line
2.1.4
#16 lore raw

PATCH v2 3/12 bus: properly include rte_debug

In reply to Gaetan Rivet
---
 lib/librte_eal/common/eal_common_bus.c | 1 +
 1 file changed, 1 insertion(+)
lib/librte_eal/common/eal_common_bus.c +1 -0
index bad1bd9..ebb5587 100644
@@ -36,6 +36,7 @@
 #include <sys/queue.h>
 
 #include <rte_bus.h>
+#include <rte_debug.h>
 
 #include "eal_private.h"
 
Signature · 1 line
2.1.4
#17 lore raw

PATCH v2 4/12 eal: remove references to PCI

In reply to Gaetan Rivet
---
 lib/librte_eal/bsdapp/eal/eal.c              |   1 -
 lib/librte_eal/bsdapp/eal/eal_pci.c          |   2 +-
 lib/librte_eal/common/eal_common_pci.c       |   2 +-
 lib/librte_eal/common/eal_common_pci_uio.c   |   3 +-
 lib/librte_eal/common/eal_private.h          | 127 ---------------------------
 lib/librte_eal/linuxapp/eal/eal.c            |   1 -
 lib/librte_eal/linuxapp/eal/eal_interrupts.c |   1 -
 7 files changed, 4 insertions(+), 133 deletions(-)
lib/librte_eal/bsdapp/eal/eal.c +0 -1
index 05f0c1f..d84e4f1 100644
@@ -66,7 +66,6 @@
 #include <rte_cpuflags.h>
 #include <rte_interrupts.h>
 #include <rte_bus.h>
-#include <rte_pci.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_common.h>
lib/librte_eal/bsdapp/eal/eal_pci.c +1 -1
index e321461..74b0172 100644
@@ -73,7 +73,7 @@
 #include <rte_devargs.h>
 
 #include "eal_filesystem.h"
-#include "eal_private.h"
+#include "private.h"
 
 /**
  * @file
lib/librte_eal/common/eal_common_pci.c +1 -1
index 6049b49..3fe9e7e 100644
@@ -54,7 +54,7 @@
 #include <rte_common.h>
 #include <rte_devargs.h>
 
-#include "eal_private.h"
+#include "private.h"
 
 extern struct rte_pci_bus rte_pci_bus;
 
lib/librte_eal/common/eal_common_pci_uio.c +2 -1
index 367a681..4365660 100644
@@ -39,11 +39,12 @@
 #include <sys/mman.h>
 
 #include <rte_eal.h>
+#include <rte_pci.h>
 #include <rte_tailq.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
 
-#include "eal_private.h"
+#include "private.h"
 
 static struct rte_tailq_elem rte_uio_tailq = {
 	.name = "UIO_RESOURCE_LIST",
lib/librte_eal/common/eal_private.h +0 -127

139 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal.c +0 -1
index 7c78f2d..cd4e757 100644
@@ -71,7 +71,6 @@
 #include <rte_cpuflags.h>
 #include <rte_interrupts.h>
 #include <rte_bus.h>
-#include <rte_pci.h>
 #include <rte_dev.h>
 #include <rte_devargs.h>
 #include <rte_common.h>
lib/librte_eal/linuxapp/eal/eal_interrupts.c +0 -1
index 2e3bd12..613804d 100644
@@ -60,7 +60,6 @@
 #include <rte_branch_prediction.h>
 #include <rte_debug.h>
 #include <rte_log.h>
-#include <rte_pci.h>
 #include <rte_malloc.h>
 #include <rte_errno.h>
 #include <rte_spinlock.h>
Signature · 1 line
2.1.4
#18 lore raw

PATCH v2 5/12 pmdinfogen: move to drivers subdirectory

In reply to Gaetan Rivet

pmdinfogen has a dependency on the PCI bus. The latter must be built first.

---
 GNUmakefile                        |   2 +-
 MAINTAINERS                        |   2 +-
 buildtools/Makefile                |  36 ----
 buildtools/pmdinfogen/Makefile     |  47 -----
 buildtools/pmdinfogen/pmdinfogen.c | 422 -------------------------------------
 buildtools/pmdinfogen/pmdinfogen.h | 125 -----------
 drivers/Makefile                   |   4 +-
 drivers/pmdinfogen/Makefile        |  47 +++++
 drivers/pmdinfogen/pmdinfogen.c    | 422 +++++++++++++++++++++++++++++++++++++
 drivers/pmdinfogen/pmdinfogen.h    | 125 +++++++++++
 10 files changed, 599 insertions(+), 633 deletions(-)
 delete mode 100644 buildtools/Makefile
 delete mode 100644 buildtools/pmdinfogen/Makefile
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.c
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.h
 create mode 100644 drivers/pmdinfogen/Makefile
 create mode 100644 drivers/pmdinfogen/pmdinfogen.c
 create mode 100644 drivers/pmdinfogen/pmdinfogen.h
GNUmakefile +1 -1
index 45b7fbb..c292646 100644
@@ -40,7 +40,7 @@ export RTE_SDK
 # directory list
 #
 
-ROOTDIRS-y := buildtools lib drivers app
+ROOTDIRS-y := lib drivers app
 ROOTDIRS-  := test
 
 include $(RTE_SDK)/mk/rte.sdkroot.mk
MAINTAINERS +1 -1
index f6095ef..c8c57cb 100644
@@ -72,7 +72,7 @@ F: doc/guides/rel_notes/deprecation.rst
 F: devtools/validate-abi.sh
 
 Driver information
-F: buildtools/pmdinfogen/
+F: drivers/pmdinfogen/
 F: usertools/dpdk-pmdinfo.py
 F: doc/guides/tools/pmdinfo.rst
 
buildtools/Makefile deleted +0 -36
deleted file mode 100644
index 35a42ff..0000000
@@ -1,36 +0,0 @@
-#   BSD LICENSE
-#
-#   Copyright(c) 2016 Neil Horman. All rights reserved.
-#   All rights reserved.
-#
-#   Redistribution and use in source and binary forms, with or without
-#   modification, are permitted provided that the following conditions
-#   are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in
-#       the documentation and/or other materials provided with the
-#       distribution.
-#     * Neither the name of Intel Corporation nor the names of its
-#       contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-include $(RTE_SDK)/mk/rte.vars.mk
-
-DIRS-y += pmdinfogen
-
-include $(RTE_SDK)/mk/rte.subdir.mk
buildtools/pmdinfogen/Makefile deleted +0 -47

47 lines not on this page · raw message

buildtools/pmdinfogen/pmdinfogen.c deleted +0 -422

422 lines not on this page · raw message

buildtools/pmdinfogen/pmdinfogen.h deleted +0 -125

125 lines not on this page · raw message

drivers/Makefile +3 -1
index a04a01f..f3f9417 100644
@@ -32,10 +32,12 @@
 include $(RTE_SDK)/mk/rte.vars.mk
 
 DIRS-y += bus
+DIRS-y += pmdinfogen
+DEPDIRS-pmdinfogen := bus
 DIRS-y += mempool
 DEPDIRS-mempool := bus
 DIRS-y += net
-DEPDIRS-net := bus mempool
+DEPDIRS-net := bus pmdinfogen mempool
 DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto
 DEPDIRS-crypto := mempool
 DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event
drivers/pmdinfogen/Makefile new file +47 -0

47 lines not on this page · raw message

drivers/pmdinfogen/pmdinfogen.c new file +422 -0

422 lines not on this page · raw message

drivers/pmdinfogen/pmdinfogen.h new file +125 -0

125 lines not on this page · raw message

Signature · 1 line
2.1.4
#19 lore raw

PATCH v2 6/12 cryptodev: disabled by default

In reply to Gaetan Rivet
---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base +1 -1
index 0e0b732..cade611 100644
@@ -430,7 +430,7 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 #
 # Compile generic crypto device library
 #
-CONFIG_RTE_LIBRTE_CRYPTODEV=y
+CONFIG_RTE_LIBRTE_CRYPTODEV=n
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
 CONFIG_RTE_CRYPTO_MAX_DEVS=64
 CONFIG_RTE_CRYPTODEV_NAME_LEN=64
Signature · 1 line
2.1.4
#20 lore raw

Re: [PATCH v2 06/12] cryptodev: disabled by default

Quoted 28 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Gaetan Rivet
Sent: Thursday, June 08, 2017 12:59 AM
To: [email protected]
Cc: Gaetan Rivet
Subject: [dpdk-dev] [PATCH v2 06/12] cryptodev: disabled by default

---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base +1 -2
index 0e0b732..cade611 100644
@@ -430,7 +430,7 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 #
 # Compile generic crypto device library
 #
-CONFIG_RTE_LIBRTE_CRYPTODEV=y
+CONFIG_RTE_LIBRTE_CRYPTODEV=n
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
 CONFIG_RTE_CRYPTO_MAX_DEVS=64
 CONFIG_RTE_CRYPTODEV_NAME_LEN=64
--
Quoted 1 line

2.1.4

As already discussed, there should be no need to disable this, after applying this: http://dpdk.org/ml/archives/dev/2017-May/066382.html

#21 lore raw

Re: [PATCH v2 06/12] cryptodev: disabled by default

Hi Pablo,

Quoted 24 lines · Pablo
Quoted 24 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Gaetan Rivet
Sent: Thursday, June 08, 2017 12:59 AM
To: [email protected]
Cc: Gaetan Rivet
Subject: [dpdk-dev] [PATCH v2 06/12] cryptodev: disabled by default

---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base +1 -1
index 0e0b732..cade611 100644
@@ -430,7 +430,7 @@ CONFIG_RTE_PMD_PACKET_PREFETCH=y
 #
 # Compile generic crypto device library
 #
-CONFIG_RTE_LIBRTE_CRYPTODEV=y
+CONFIG_RTE_LIBRTE_CRYPTODEV=n
Quoted 9 lines
Quoted 5 lines
config/common_base +0 -1
 CONFIG_RTE_LIBRTE_CRYPTODEV_DEBUG=n
 CONFIG_RTE_CRYPTO_MAX_DEVS=64
 CONFIG_RTE_CRYPTODEV_NAME_LEN=64
--

2.1.4

As already discussed, there should be no need to disable this, after applying this: http://dpdk.org/ml/archives/dev/2017-May/066382.html

Just to confirm, once properly applied, your patchset fixes the issue. I will remove this patch from the next version and update the dependencies to include your patchset.

Signature · 2 lines
Gaëtan Rivet
6WIND
#22 lore raw

PATCH v2 7/12 pdump: disabled by default

In reply to Gaetan Rivet
---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base +1 -1
index cade611..8ec5e4e 100644
@@ -700,7 +700,7 @@ CONFIG_RTE_KNI_PREEMPT_DEFAULT=y
 #
 # Compile the pdump library
 #
-CONFIG_RTE_LIBRTE_PDUMP=y
+CONFIG_RTE_LIBRTE_PDUMP=n
 
 #
 # Compile vhost user library
Signature · 1 line
2.1.4
#23 lore raw

Re: [PATCH v2 07/12] pdump: disabled by default

Hi,

Quoted 20 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Gaetan Rivet
Sent: Thursday, June 8, 2017 12:59 AM
To: [email protected]
Cc: Gaetan Rivet <[email protected]>
Subject: [dpdk-dev] [PATCH v2 07/12] pdump: disabled by default

---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base index renamed from config/common_base +0 -0

cade611..8ec5e4e 100644

config/common_base +0 -0
@@ -700,7 +700,7 @@ CONFIG_RTE_KNI_PREEMPT_DEFAULT=y  #  # Compile

the pdump library # -CONFIG_RTE_LIBRTE_PDUMP=y
+CONFIG_RTE_LIBRTE_PDUMP=n

Quoted 4 lines

#
# Compile vhost user library
--
2.1.4

Since, you already mentioned in other mail to Ferruh that config flag disabling patches are only for testers compilation purpose and you have plans to make proper fix by end of June. I will wait on for actual patch.

Please see if rte_pci.h can be removed from the includes of rte_pdump.c , might be unnecessary include.

Thanks,
Reshma

#24 lore raw

Re: [PATCH v2 07/12] pdump: disabled by default

Hi Reshma,

Quoted 22 lines · Reshma

Hi,

Quoted 20 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Gaetan Rivet
Sent: Thursday, June 8, 2017 12:59 AM
To: [email protected]
Cc: Gaetan Rivet <[email protected]>
Subject: [dpdk-dev] [PATCH v2 07/12] pdump: disabled by default

---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base index renamed from config/common_base +0 -0

cade611..8ec5e4e 100644

config/common_base +0 -0
@@ -700,7 +700,7 @@ CONFIG_RTE_KNI_PREEMPT_DEFAULT=y  #  # Compile

the pdump library # -CONFIG_RTE_LIBRTE_PDUMP=y
+CONFIG_RTE_LIBRTE_PDUMP=n

Quoted 7 lines
Quoted 4 lines

#
# Compile vhost user library
--
2.1.4

Since, you already mentioned in other mail to Ferruh that config flag disabling patches are only for testers compilation purpose and you have plans to make proper fix by end of June. I will wait on for actual patch.

I said I planned to do so, but found out that I would not have enough time before the end of June. Sorry about the ambiguous phrasing.

Do you think you will be able to fix this library in time?

Quoted 4 lines

Please see if rte_pci.h can be removed from the includes of rte_pdump.c , might be unnecessary include.

Thanks,
Reshma

Signature · 2 lines
Gaëtan Rivet
6WIND
#25 lore raw

Re: [PATCH v2 07/12] pdump: disabled by default

Quoted 33 lines · Gaëtan Rivet

Hi Reshma,

Quoted 22 lines · Reshma

Hi,

Quoted 20 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Gaetan Rivet
Sent: Thursday, June 8, 2017 12:59 AM
To: [email protected]
Cc: Gaetan Rivet <[email protected]>
Subject: [dpdk-dev] [PATCH v2 07/12] pdump: disabled by default

---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base index renamed from config/common_base +0 -0

cade611..8ec5e4e 100644

config/common_base +0 -0
@@ -700,7 +700,7 @@ CONFIG_RTE_KNI_PREEMPT_DEFAULT=y  #  # Compile

the pdump library # -CONFIG_RTE_LIBRTE_PDUMP=y
+CONFIG_RTE_LIBRTE_PDUMP=n

Quoted 7 lines
Quoted 4 lines

#
# Compile vhost user library
--
2.1.4

Since, you already mentioned in other mail to Ferruh that config flag disabling patches are only for testers compilation purpose and you have plans to make proper fix by end of June. I will wait on for actual patch.

Quoted 4 lines

I said I planned to do so, but found out that I would not have enough time before the end of June. Sorry about the ambiguous phrasing.

Do you think you will be able to fix this library in time?

KNI uses / depends pci, I am not sure what to fix here.

The problem to enable the KNI is build dependency problem, right?

I guess problem will be fixes if we can build in following order:
- lib/eal
- drivers/bus
- lib
- drivers

This was the case when bus drives compiled within eal. What do you think about this build order?

Quoted 6 lines
Quoted 5 lines

Please see if rte_pci.h can be removed from the includes of rte_pdump.c , might be unnecessary include.

Thanks,
Reshma

#26 lore raw

Re: [PATCH v2 07/12] pdump: disabled by default

Hi Ferruh,

Quoted 43 lines · Ferruh Yigit
Quoted 33 lines · Gaëtan Rivet

Hi Reshma,

Quoted 22 lines · Reshma

Hi,

Quoted 20 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Gaetan Rivet
Sent: Thursday, June 8, 2017 12:59 AM
To: [email protected]
Cc: Gaetan Rivet <[email protected]>
Subject: [dpdk-dev] [PATCH v2 07/12] pdump: disabled by default

---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base index renamed from config/common_base +0 -0

cade611..8ec5e4e 100644

config/common_base +0 -0
@@ -700,7 +700,7 @@ CONFIG_RTE_KNI_PREEMPT_DEFAULT=y  #  # Compile

the pdump library # -CONFIG_RTE_LIBRTE_PDUMP=y
+CONFIG_RTE_LIBRTE_PDUMP=n

Quoted 7 lines
Quoted 4 lines

#
# Compile vhost user library
--
2.1.4

Since, you already mentioned in other mail to Ferruh that config flag disabling patches are only for testers compilation purpose and you have plans to make proper fix by end of June. I will wait on for actual patch.

Quoted 4 lines

I said I planned to do so, but found out that I would not have enough time before the end of June. Sorry about the ambiguous phrasing.

Do you think you will be able to fix this library in time?

KNI uses / depends pci, I am not sure what to fix here.

The problem to enable the KNI is build dependency problem, right?

Quoted 9 lines

I guess problem will be fixes if we can build in following order:
- lib/eal
- drivers/bus
- lib
- drivers

This was the case when bus drives compiled within eal. What do you think about this build order?

Yes, that build order would fix the issue.
However, IMO this is not the proper way to proceed.
It obscures the architecture, the distinction between DPDK abstractions and their implementations.

Looking quickly into this dependency, it seems that the PCI info is only used during allocation, and only to register PCI information within device infos. They do not seem used afterward at the library level, except to print some device description upon device start.

They can be completely removed from KNI (both from the lib and the driver), without breaking the compilation.
This however changes the API of rte_kni_alloc() and the ABI of rte_kni_conf.

But it seems better than changing the build order and opening a can of all kind of worms, allowing a few libraries to skirt around their duty to remain generic and independent from abstraction implementations.

Ideally KNI interfaces should be able to use any rte_device, not only PCI. But if it is forced to use only PCI devices, then pointing to an rte_pci_device seems a better way to proceed, as it has all those infos readily available. It would allow the PCI device to grow and evolve without breaking the KNI lib.

Anyway, I think there are several possible solutions to this, before resorting to modifying the build order.

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

Please see if rte_pci.h can be removed from the includes of rte_pdump.c , might be unnecessary include.

Thanks,
Reshma

Signature · 2 lines
Gaëtan Rivet
6WIND
#27 lore raw

Re: [PATCH v2 07/12] pdump: disabled by default

Quoted 75 lines · Gaëtan Rivet

Hi Ferruh,

Quoted 43 lines · Ferruh Yigit
Quoted 33 lines · Gaëtan Rivet

Hi Reshma,

Quoted 22 lines · Reshma

Hi,

Quoted 20 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Gaetan Rivet
Sent: Thursday, June 8, 2017 12:59 AM
To: [email protected]
Cc: Gaetan Rivet <[email protected]>
Subject: [dpdk-dev] [PATCH v2 07/12] pdump: disabled by default

---
 config/common_base | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_base index renamed from config/common_base +0 -0

cade611..8ec5e4e 100644

config/common_base +0 -0
@@ -700,7 +700,7 @@ CONFIG_RTE_KNI_PREEMPT_DEFAULT=y  #  # Compile

the pdump library # -CONFIG_RTE_LIBRTE_PDUMP=y
+CONFIG_RTE_LIBRTE_PDUMP=n

Quoted 7 lines
Quoted 4 lines

#
# Compile vhost user library
--
2.1.4

Since, you already mentioned in other mail to Ferruh that config flag disabling patches are only for testers compilation purpose and you have plans to make proper fix by end of June. I will wait on for actual patch.

Quoted 4 lines

I said I planned to do so, but found out that I would not have enough time before the end of June. Sorry about the ambiguous phrasing.

Do you think you will be able to fix this library in time?

KNI uses / depends pci, I am not sure what to fix here.

The problem to enable the KNI is build dependency problem, right?

Quoted 9 lines

I guess problem will be fixes if we can build in following order:
- lib/eal
- drivers/bus
- lib
- drivers

This was the case when bus drives compiled within eal. What do you think about this build order?

Yes, that build order would fix the issue.
However, IMO this is not the proper way to proceed.
It obscures the architecture, the distinction between DPDK abstractions and their implementations.

Looking quickly into this dependency, it seems that the PCI info is only used during allocation, and only to register PCI information within device infos. They do not seem used afterward at the library level, except to print some device description upon device start.

They can be completely removed from KNI (both from the lib and the driver), without breaking the compilation.
This however changes the API of rte_kni_alloc() and the ABI of rte_kni_conf.

But it seems better than changing the build order and opening a can of all kind of worms, allowing a few libraries to skirt around their duty to remain generic and independent from abstraction implementations.

Quoted 8 lines

Ideally KNI interfaces should be able to use any rte_device, not only PCI. But if it is forced to use only PCI devices, then pointing to an rte_pci_device seems a better way to proceed, as it has all those infos readily available. It would allow the PCI device to grow and evolve without breaking the KNI lib.

Anyway, I think there are several possible solutions to this, before resorting to modifying the build order.

I started the discussion in wrong thread, I will copy your mail and answer from correct thread, hoping this won't make things more confusing.

For future reference, moving to:
http://dpdk.org/ml/archives/dev/2017-June/067688.html

Quoted 9 lines
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines

Please see if rte_pci.h can be removed from the includes of rte_pdump.c , might be unnecessary include.

Thanks,
Reshma

#28 lore raw

Re: [PATCH v2 07/12] pdump: disabled by default

In reply to Gaëtan Rivet

Hi,

Quoted 9 lines

-----Original Message-----
From: Gaëtan Rivet [mailto:[email protected]]
Sent: Sunday, June 11, 2017 8:42 PM
To: Pattan, Reshma <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 07/12] pdump: disabled by default

Quoted 2 lines

Since, you already mentioned in other mail to Ferruh that config flag

Quoted 8 lines

disabling patches are only for testers compilation purpose and you have plans to make proper fix by end of June. I will wait on for actual patch.

Quoted 1 line

I said I planned to do so, but found out that I would not have enough time before the end of June. Sorry about the ambiguous phrasing.

Do you think you will be able to fix this library in time?

rte_pci.h is unnecessary include in rte_pdump.c, hence I removed it and sent the patch.

Thanks,
Reshma

#29 lore raw

Re: [PATCH v2 07/12] pdump: disabled by default

Quoted 15 lines · Reshma

Hi,

Quoted 13 lines

-----Original Message-----
From: Gaëtan Rivet [mailto:[email protected]]
Sent: Sunday, June 11, 2017 8:42 PM
To: Pattan, Reshma <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 07/12] pdump: disabled by default

Quoted 2 lines

Since, you already mentioned in other mail to Ferruh that config flag

disabling patches are only for testers compilation purpose and you have plans to make proper fix by end of June. I will wait on for actual patch.

Quoted 1 line
Quoted 7 lines
Quoted 4 lines

I said I planned to do so, but found out that I would not have enough time before the end of June. Sorry about the ambiguous phrasing.

Do you think you will be able to fix this library in time?

rte_pci.h is unnecessary include in rte_pdump.c, hence I removed it and sent the patch.

I tested it, no problem.
The patch disabling pdump will be removed from the next version. Thanks.

Quoted 4 lines

Thanks,
Reshma

Signature · 2 lines
Gaëtan Rivet
6WIND
#30 lore raw

PATCH v2 8/12 kni: disabled by default

In reply to Gaetan Rivet
---
 config/common_linuxapp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_linuxapp +1 -1
index b3cf41b..cc85cc6 100644
@@ -38,7 +38,7 @@ CONFIG_RTE_EXEC_ENV_LINUXAPP=y
 CONFIG_RTE_EAL_IGB_UIO=y
 CONFIG_RTE_EAL_VFIO=y
 CONFIG_RTE_KNI_KMOD=y
-CONFIG_RTE_LIBRTE_KNI=y
+CONFIG_RTE_LIBRTE_KNI=n
 CONFIG_RTE_LIBRTE_PMD_KNI=y
 CONFIG_RTE_LIBRTE_VHOST=y
 CONFIG_RTE_LIBRTE_PMD_VHOST=y
Signature · 1 line
2.1.4
#31 lore raw

Re: [PATCH v2 08/12] kni: disabled by default

Quoted 11 lines · Gaetan Rivet
---
 config/common_linuxapp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_linuxapp +0 -0
index b3cf41b..cc85cc6 100644

config/common_linuxapp CONFIG_RTE_EXEC_ENV_LINUXAPP=y · line 44

Quoted 8 lines
config/common_linuxapp +1 -1
@@ -38,7 +38,7 @@ CONFIG_RTE_EXEC_ENV_LINUXAPP=y
 CONFIG_RTE_EAL_IGB_UIO=y
 CONFIG_RTE_EAL_VFIO=y
 CONFIG_RTE_KNI_KMOD=y
-CONFIG_RTE_LIBRTE_KNI=y
+CONFIG_RTE_LIBRTE_KNI=n
 CONFIG_RTE_LIBRTE_PMD_KNI=y
 CONFIG_RTE_LIBRTE_VHOST=y
 CONFIG_RTE_LIBRTE_PMD_VHOST=y

Hi Gaetan,

We shouldn't just disable components that doesn't compile.

And what happens when it is enabled, not compiled at all? So you are literally breaking the existing support with your patch?

Thanks,
ferruh

#32 lore raw

Re: [PATCH v2 08/12] kni: disabled by default

Hi Ferruh,

Quoted 23 lines · Ferruh Yigit
Quoted 11 lines · Gaetan Rivet
---
 config/common_linuxapp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_linuxapp +0 -0
index b3cf41b..cc85cc6 100644

config/common_linuxapp CONFIG_RTE_EXEC_ENV_LINUXAPP=y · line 44

Quoted 8 lines
config/common_linuxapp +1 -1
@@ -38,7 +38,7 @@ CONFIG_RTE_EXEC_ENV_LINUXAPP=y
 CONFIG_RTE_EAL_IGB_UIO=y
 CONFIG_RTE_EAL_VFIO=y
 CONFIG_RTE_KNI_KMOD=y
-CONFIG_RTE_LIBRTE_KNI=y
+CONFIG_RTE_LIBRTE_KNI=n
 CONFIG_RTE_LIBRTE_PMD_KNI=y
 CONFIG_RTE_LIBRTE_VHOST=y
 CONFIG_RTE_LIBRTE_PMD_VHOST=y

Hi Gaetan,

Quoted 2 lines

We shouldn't just disable components that doesn't compile.

Ah, sure :) . This patch is not meant to be integrated as is, but only as a convenient way for testers to apply the patchset and verify the compilation, as far as KNI is not concerned.

Eventdev and cryptodev fixed this dependency. I was thinking about looking into it for KNI and PDUMP but I don't have the time right now, and I'm not sure I will have until the end of June.

Quoted 6 lines

And what happens when it is enabled, not compiled at all? So you are literally breaking the existing support with your patch?

Thanks,
ferruh

Signature · 2 lines
Gaëtan Rivet
6WIND
#33 lore raw

Re: [PATCH v2 08/12] kni: disabled by default

Quoted 29 lines · Gaëtan Rivet

Hi Ferruh,

Quoted 23 lines · Ferruh Yigit
Quoted 11 lines · Gaetan Rivet
---
 config/common_linuxapp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_linuxapp +0 -0
index b3cf41b..cc85cc6 100644

config/common_linuxapp CONFIG_RTE_EXEC_ENV_LINUXAPP=y · line 44

Quoted 8 lines
config/common_linuxapp +1 -1
@@ -38,7 +38,7 @@ CONFIG_RTE_EXEC_ENV_LINUXAPP=y
 CONFIG_RTE_EAL_IGB_UIO=y
 CONFIG_RTE_EAL_VFIO=y
 CONFIG_RTE_KNI_KMOD=y
-CONFIG_RTE_LIBRTE_KNI=y
+CONFIG_RTE_LIBRTE_KNI=n
 CONFIG_RTE_LIBRTE_PMD_KNI=y
 CONFIG_RTE_LIBRTE_VHOST=y
 CONFIG_RTE_LIBRTE_PMD_VHOST=y

Hi Gaetan,

Quoted 2 lines

We shouldn't just disable components that doesn't compile.

Quoted 7 lines

Ah, sure :) . This patch is not meant to be integrated as is, but only as a convenient way for testers to apply the patchset and verify the compilation, as far as KNI is not concerned.

Eventdev and cryptodev fixed this dependency. I was thinking about looking into it for KNI and PDUMP but I don't have the time right now, and I'm not sure I will have until the end of June.

Moved from another mail thread
(http://dpdk.org/ml/archives/dev/2017-June/067936.html)

Quoted 24 lines
Quoted 4 lines

KNI uses / depends pci, I am not sure what to fix here.

The problem to enable the KNI is build dependency problem, right?

Quoted 9 lines

I guess problem will be fixes if we can build in following order:
- lib/eal
- drivers/bus
- lib
- drivers

This was the case when bus drives compiled within eal. What do you think about this build order?

Yes, that build order would fix the issue.
However, IMO this is not the proper way to proceed.
It obscures the architecture, the distinction between DPDK abstractions and their implementations.

Looking quickly into this dependency, it seems that the PCI info is only used during allocation, and only to register PCI information within device infos. They do not seem used afterward at the library level, except to print some device description upon device start.

Quoted 4 lines

They can be completely removed from KNI (both from the lib and the driver), without breaking the compilation.
This however changes the API of rte_kni_alloc() and the ABI of rte_kni_conf.

PCI info is not only for printing, it is required for ethtool support.

The pci info sent to KNI kernel module, which uses this information to associate kernel driver to DPDK interface. Basically this is required for control part support of KNI.

So I believe we can't just remove this.

Quoted 4 lines

But it seems better than changing the build order and opening a can of all kind of worms, allowing a few libraries to skirt around their duty to remain generic and independent from abstraction implementations.

I see your point.

Quoted 5 lines

Ideally KNI interfaces should be able to use any rte_device, not only PCI. But if it is forced to use only PCI devices, then pointing to an rte_pci_device seems a better way to proceed, as it has all those infos readily available. It would allow the PCI device to grow and evolve

without

Quoted 1 line

breaking the KNI lib.

Ideally this is good idea to make DPDK libraries bus agnostic.

But for KNI, it is not just lib/librte_kni, it has a kernel module counterpart and it needs to know the bus information, in this manner KNI is different.

Even if we assume it is possible to make KNI independent from bus, this effort is not very useful because we don't want to continue KNI ethtool support as it is (by having Linux NIC drivers in kernel module), so there won't be any other NIC that benefits from update.

And option can be replace KNI ethtool support with KCP, but we are struggling to upstream KCP for a while, and this is another story.

For specific to KNI, we can say, it is a library that is dependent to specific bus. I believe build system should be able to support some components depends to specific bus.

Quoted 3 lines

Anyway, I think there are several possible solutions to this, before resorting to modifying the build order.

#34 lore raw

Re: [PATCH v2 08/12] kni: disabled by default

Quoted 65 lines · Ferruh Yigit
Quoted 29 lines · Gaëtan Rivet

Hi Ferruh,

Quoted 23 lines · Ferruh Yigit
Quoted 11 lines · Gaetan Rivet
---
 config/common_linuxapp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_linuxapp +0 -0
index b3cf41b..cc85cc6 100644

config/common_linuxapp CONFIG_RTE_EXEC_ENV_LINUXAPP=y · line 44

Quoted 8 lines
config/common_linuxapp +1 -1
@@ -38,7 +38,7 @@ CONFIG_RTE_EXEC_ENV_LINUXAPP=y
 CONFIG_RTE_EAL_IGB_UIO=y
 CONFIG_RTE_EAL_VFIO=y
 CONFIG_RTE_KNI_KMOD=y
-CONFIG_RTE_LIBRTE_KNI=y
+CONFIG_RTE_LIBRTE_KNI=n
 CONFIG_RTE_LIBRTE_PMD_KNI=y
 CONFIG_RTE_LIBRTE_VHOST=y
 CONFIG_RTE_LIBRTE_PMD_VHOST=y

Hi Gaetan,

Quoted 2 lines

We shouldn't just disable components that doesn't compile.

Quoted 7 lines

Ah, sure :) . This patch is not meant to be integrated as is, but only as a convenient way for testers to apply the patchset and verify the compilation, as far as KNI is not concerned.

Eventdev and cryptodev fixed this dependency. I was thinking about looking into it for KNI and PDUMP but I don't have the time right now, and I'm not sure I will have until the end of June.

Moved from another mail thread
(http://dpdk.org/ml/archives/dev/2017-June/067936.html)

Quoted 24 lines
Quoted 4 lines

KNI uses / depends pci, I am not sure what to fix here.

The problem to enable the KNI is build dependency problem, right?

Quoted 9 lines

I guess problem will be fixes if we can build in following order:
- lib/eal
- drivers/bus
- lib
- drivers

This was the case when bus drives compiled within eal. What do you think about this build order?

Yes, that build order would fix the issue.
However, IMO this is not the proper way to proceed.
It obscures the architecture, the distinction between DPDK abstractions and their implementations.

Looking quickly into this dependency, it seems that the PCI info is only used during allocation, and only to register PCI information within device infos. They do not seem used afterward at the library level, except to print some device description upon device start.

Quoted 7 lines
Quoted 4 lines

They can be completely removed from KNI (both from the lib and the driver), without breaking the compilation.
This however changes the API of rte_kni_alloc() and the ABI of rte_kni_conf.

PCI info is not only for printing, it is required for ethtool support.

I see. Sorry, I never really looked into it before.

Quoted 6 lines

The pci info sent to KNI kernel module, which uses this information to associate kernel driver to DPDK interface. Basically this is required for control part support of KNI.

So I believe we can't just remove this.

Ok, those infos should stay reachable. Do they have to stay at the same place however?

Quoted 17 lines
Quoted 5 lines

Ideally KNI interfaces should be able to use any rte_device, not only PCI. But if it is forced to use only PCI devices, then pointing to an rte_pci_device seems a better way to proceed, as it has all those infos readily available. It would allow the PCI device to grow and evolve without breaking the KNI lib.

Ideally this is good idea to make DPDK libraries bus agnostic.

But for KNI, it is not just lib/librte_kni, it has a kernel module counterpart and it needs to know the bus information, in this manner KNI is different.

Even if we assume it is possible to make KNI independent from bus, this effort is not very useful because we don't want to continue KNI ethtool support as it is (by having Linux NIC drivers in kernel module), so there won't be any other NIC that benefits from update.

Quoted 7 lines

And option can be replace KNI ethtool support with KCP, but we are struggling to upstream KCP for a while, and this is another story.

For specific to KNI, we can say, it is a library that is dependent to specific bus. I believe build system should be able to support some components depends to specific bus.

Would it be feasible to have the same kind of bus-specific interface that was added for ethdev, cryptodev, eventdev? Having an rte_pci_device pointer within dev_infos for KNI itself, but setting it while at the drivers/net/kni level?

The problem is that it breaks KNI API / ABI. But I believe it's possible this way to reach feature parity while leaving the build order alone.

There may be a compromise, where for this release the build order is modified only for KNI and fixed in the next, thus respecting the API change rules in place.

Before that call could be made though, we should first determine whether KNI is fixable and a proper solution can be reached without impacting the build order in the long term. Once we have this plan, we can decide whether the priority is the KNI API and its users or the DPDK arch integrity.

Signature · 2 lines
Gaëtan Rivet
6WIND
#35 lore raw

PATCH v2 9/12 bus/pci: introduce pci bus

In reply to Gaetan Rivet

Move the PCI bus from the EAL to drivers/bus.

---
 config/common_base                             |  10 +
 drivers/bus/Makefile                           |   2 +
 drivers/bus/pci/Makefile                       |  60 ++
 drivers/bus/pci/bsd/Makefile                   |  32 ++
 drivers/bus/pci/bsd/rte_bus_pci_version.map    |  21 +
 drivers/bus/pci/bsd/rte_pci.c                  | 672 +++++++++++++++++++++++
 drivers/bus/pci/include/rte_pci.h              | 628 +++++++++++++++++++++
 drivers/bus/pci/linux/Makefile                 |  37 ++
 drivers/bus/pci/linux/rte_bus_pci_version.map  |  21 +
 drivers/bus/pci/linux/rte_pci.c                | 724 +++++++++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_init.h           |  97 ++++
 drivers/bus/pci/linux/rte_pci_uio.c            | 567 +++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_vfio.c           | 674 +++++++++++++++++++++++
 drivers/bus/pci/linux/rte_vfio_mp_sync.c       | 424 +++++++++++++++
 drivers/bus/pci/private.h                      | 167 ++++++
 drivers/bus/pci/rte_pci_common.c               | 598 ++++++++++++++++++++
 drivers/bus/pci/rte_pci_common_uio.c           | 234 ++++++++
 lib/librte_eal/bsdapp/eal/Makefile             |   3 -
 lib/librte_eal/bsdapp/eal/eal_pci.c            | 672 -----------------------
 lib/librte_eal/common/Makefile                 |   2 +-
 lib/librte_eal/common/eal_common_pci.c         | 598 --------------------
 lib/librte_eal/common/eal_common_pci_uio.c     | 234 --------
 lib/librte_eal/linuxapp/eal/Makefile           |  10 -
 lib/librte_eal/linuxapp/eal/eal_pci.c          | 724 -------------------------
 lib/librte_eal/linuxapp/eal/eal_pci_init.h     |  97 ----
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c      | 567 -------------------
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c     | 674 -----------------------
 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c | 424 ---------------
 mk/rte.app.mk                                  |   2 +
 29 files changed, 4971 insertions(+), 4004 deletions(-)
 create mode 100644 drivers/bus/pci/Makefile
 create mode 100644 drivers/bus/pci/bsd/Makefile
 create mode 100644 drivers/bus/pci/bsd/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/bsd/rte_pci.c
 create mode 100644 drivers/bus/pci/include/rte_pci.h
 create mode 100644 drivers/bus/pci/linux/Makefile
 create mode 100644 drivers/bus/pci/linux/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/linux/rte_pci.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_init.h
 create mode 100644 drivers/bus/pci/linux/rte_pci_uio.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_vfio.c
 create mode 100644 drivers/bus/pci/linux/rte_vfio_mp_sync.c
 create mode 100644 drivers/bus/pci/private.h
 create mode 100644 drivers/bus/pci/rte_pci_common.c
 create mode 100644 drivers/bus/pci/rte_pci_common_uio.c
 delete mode 100644 lib/librte_eal/bsdapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci_uio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_init.h
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_uio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
config/common_base +10 -0
index 8ec5e4e..1813f39 100644
@@ -145,6 +145,16 @@ CONFIG_RTE_ETHDEV_RXTX_CALLBACKS=y
 CONFIG_RTE_ETHDEV_TX_PREPARE_NOOP=n
 
 #
+# Support NIC bypass logic
+#
+CONFIG_RTE_NIC_BYPASS=n
+
+#
+# Compile PCI bus driver
+#
+CONFIG_RTE_LIBRTE_PCI_BUS=y
+
+#
 # Compile burst-oriented Amazon ENA PMD driver
 #
 CONFIG_RTE_LIBRTE_ENA_PMD=y
drivers/bus/Makefile +2 -0
index 1e5b281..1d1ddae 100644
@@ -35,5 +35,7 @@ core-libs := librte_eal librte_mbuf librte_mempool librte_ring librte_ether
 
 DIRS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc
 DEPDIRS-fslmc = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_PCI_BUS) += pci
+DEPDIRS-pci = $(core-libs)
 
 include $(RTE_SDK)/mk/rte.subdir.mk
drivers/bus/pci/Makefile new file +60 -0

60 lines not on this page · raw message

drivers/bus/pci/bsd/Makefile new file +32 -0
new file mode 100644
index 0000000..77cf539
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 6WIND S.A.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of 6WIND nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+SRCS += rte_pci.c
drivers/bus/pci/bsd/rte_bus_pci_version.map new file +21 -0
new file mode 100644
index 0000000..eca49e9
@@ -0,0 +1,21 @@
+DPDK_17.08 {
+	global:
+
+	rte_pci_detach;
+	rte_pci_dump;
+	rte_pci_ioport_map;
+	rte_pci_ioport_read;
+	rte_pci_ioport_unmap;
+	rte_pci_ioport_write;
+	rte_pci_map_device;
+	rte_pci_probe;
+	rte_pci_probe_one;
+	rte_pci_read_config;
+	rte_pci_register;
+	rte_pci_scan;
+	rte_pci_unmap_device;
+	rte_pci_unregister;
+	rte_pci_write_config;
+
+	local: *;
+};
drivers/bus/pci/bsd/rte_pci.c new file +672 -0

672 lines not on this page · raw message

drivers/bus/pci/include/rte_pci.h new file +628 -0

628 lines not on this page · raw message

drivers/bus/pci/linux/Makefile new file +37 -0
new file mode 100644
index 0000000..d2ea84c
@@ -0,0 +1,37 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 6WIND S.A.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of 6WIND nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+SRCS += rte_pci.c
+SRCS += rte_pci_uio.c
+SRCS += rte_pci_vfio.c
+SRCS += rte_vfio_mp_sync.c
+
+CFLAGS += -D_GNU_SOURCE
drivers/bus/pci/linux/rte_bus_pci_version.map new file +21 -0
new file mode 100644
index 0000000..eca49e9
@@ -0,0 +1,21 @@
+DPDK_17.08 {
+	global:
+
+	rte_pci_detach;
+	rte_pci_dump;
+	rte_pci_ioport_map;
+	rte_pci_ioport_read;
+	rte_pci_ioport_unmap;
+	rte_pci_ioport_write;
+	rte_pci_map_device;
+	rte_pci_probe;
+	rte_pci_probe_one;
+	rte_pci_read_config;
+	rte_pci_register;
+	rte_pci_scan;
+	rte_pci_unmap_device;
+	rte_pci_unregister;
+	rte_pci_write_config;
+
+	local: *;
+};
drivers/bus/pci/linux/rte_pci.c new file +724 -0

724 lines not on this page · raw message

drivers/bus/pci/linux/rte_pci_init.h new file +97 -0

97 lines not on this page · raw message

drivers/bus/pci/linux/rte_pci_uio.c new file +567 -0

567 lines not on this page · raw message

drivers/bus/pci/linux/rte_pci_vfio.c new file +674 -0

118 lines not on this page · raw message

drivers/bus/pci/linux/rte_vfio_mp_sync.c new file +424 -0

424 lines not on this page · raw message

drivers/bus/pci/private.h new file +167 -0

167 lines not on this page · raw message

drivers/bus/pci/rte_pci_common.c new file +598 -0

598 lines not on this page · raw message

drivers/bus/pci/rte_pci_common_uio.c new file +234 -0

234 lines not on this page · raw message

lib/librte_eal/bsdapp/eal/Makefile +0 -3
index a0f9950..f219848 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/bsdapp/eal/eal_pci.c deleted +0 -672

672 lines not on this page · raw message

lib/librte_eal/common/Makefile +1 -1
index a5bd108..c4e0af2 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/common/eal_common_pci.c deleted +0 -598

598 lines not on this page · raw message

lib/librte_eal/common/eal_common_pci_uio.c deleted +0 -234

234 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/Makefile +0 -10
index 530e286..872766e 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/linuxapp/eal/eal_pci.c deleted +0 -724

724 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_pci_init.h deleted +0 -97

97 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_pci_uio.c deleted +0 -567

567 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_pci_vfio.c deleted +0 -674

674 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c deleted +0 -424

424 lines not on this page · raw message

mk/rte.app.mk +2 -0
index bcaf1b3..d476068 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.1.4

Part of the diff is not shown here. View the raw message.

#36 lore raw

PATCH v2 10/12 bus/pci: follow checkpatch

In reply to Gaetan Rivet
---
 drivers/bus/pci/include/rte_pci.h | 102 ++++++++++++++++++++++++--------------
 1 file changed, 64 insertions(+), 38 deletions(-)
drivers/bus/pci/include/rte_pci.h +64 -38
index 45c5082..25adbed 100644
@@ -130,7 +130,7 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver);
  * table of these IDs for each device that it supports.
  */
 struct rte_pci_id {
-	uint32_t class_id;            /**< Class ID (class, subclass, pi) or RTE_CLASS_ANY_ID. */
+	uint32_t class_id;            /**< Class ID or RTE_CLASS_ANY_ID. */
 	uint16_t vendor_id;           /**< Vendor ID or PCI_ANY_ID. */
 	uint16_t device_id;           /**< Device ID or PCI_ANY_ID. */
 	uint16_t subsystem_vendor_id; /**< Subsystem vendor ID or PCI_ANY_ID. */
@@ -153,17 +153,17 @@ struct rte_devargs;
  * A structure describing a PCI device.
  */
 struct rte_pci_device {
-	TAILQ_ENTRY(rte_pci_device) next;       /**< Next probed PCI device. */
-	struct rte_device device;               /**< Inherit core device */
-	struct rte_pci_addr addr;               /**< PCI location. */
-	struct rte_pci_id id;                   /**< PCI ID. */
+	TAILQ_ENTRY(rte_pci_device) next;   /**< Next probed PCI device. */
+	struct rte_device device;           /**< Inherit core device */
+	struct rte_pci_addr addr;           /**< PCI location. */
+	struct rte_pci_id id;               /**< PCI ID. */
 	struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE];
-						/**< PCI Memory Resource */
-	struct rte_intr_handle intr_handle;     /**< Interrupt handle */
-	struct rte_pci_driver *driver;          /**< Associated driver */
-	uint16_t max_vfs;                       /**< sriov enable if not zero */
-	enum rte_kernel_driver kdrv;            /**< Kernel driver passthrough */
-	char name[PCI_PRI_STR_SIZE+1];          /**< PCI location (ASCII) */
+					    /**< PCI Memory Resource */
+	struct rte_intr_handle intr_handle; /**< Interrupt handle */
+	struct rte_pci_driver *driver;      /**< Associated driver */
+	uint16_t max_vfs;                   /**< sriov enable if not zero */
+	enum rte_kernel_driver kdrv;        /**< Kernel driver passthrough */
+	char name[PCI_PRI_STR_SIZE+1];      /**< PCI location (ASCII) */
 };
 
 /**
@@ -208,13 +208,13 @@ typedef int (pci_remove_t)(struct rte_pci_device *);
  * A structure describing a PCI driver.
  */
 struct rte_pci_driver {
-	TAILQ_ENTRY(rte_pci_driver) next;       /**< Next in list. */
-	struct rte_driver driver;               /**< Inherit core driver. */
-	struct rte_pci_bus *bus;                /**< PCI bus reference. */
-	pci_probe_t *probe;                     /**< Device Probe function. */
-	pci_remove_t *remove;                   /**< Device Remove function. */
-	const struct rte_pci_id *id_table;	/**< ID table, NULL terminated. */
-	uint32_t drv_flags;                     /**< Flags contolling handling of device. */
+	TAILQ_ENTRY(rte_pci_driver) next;  /**< Next in list. */
+	struct rte_driver driver;          /**< Inherit core driver. */
+	struct rte_pci_bus *bus;           /**< PCI bus reference. */
+	pci_probe_t *probe;                /**< Device Probe function. */
+	pci_remove_t *remove;              /**< Device Remove function. */
+	const struct rte_pci_id *id_table; /**< ID table, NULL terminated. */
+	uint32_t drv_flags;                /**< Flags contolling handling of device. */
 };
 
 /**
@@ -261,18 +261,22 @@ struct mapped_pci_resource {
 /** mapped pci device list */
 TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource);
 
-/**< Internal use only - Macro used by pci addr parsing functions **/
-#define GET_PCIADDR_FIELD(in, fd, lim, dlm)                   \
-do {                                                               \
-	unsigned long val;                                      \
-	char *end;                                              \
-	errno = 0;                                              \
-	val = strtoul((in), &end, 16);                          \
-	if (errno != 0 || end[0] != (dlm) || val > (lim))       \
-		return -EINVAL;                                 \
-	(fd) = (typeof (fd))val;                                \
-	(in) = end + 1;                                         \
-} while(0)
+static const char *
+get_u8_pciaddr_field(const char *in, void *_u8, char dlm)
+{
+	unsigned long val;
+	uint8_t *u8 = _u8;
+	char *end;
+
+	errno = 0;
+	val = strtoul(in, &end, 16);
+	if (errno != 0 || end[0] != dlm || val > UINT8_MAX) {
+		errno = errno ? errno : EINVAL;
+		return NULL;
+	}
+	*u8 = (uint8_t)val;
+	return end + 1;
+}
 
 /**
  * Utility function to produce a PCI Bus-Device-Function value
@@ -290,10 +294,18 @@ do {                                                               \
 static inline int
 eal_parse_pci_BDF(const char *input, struct rte_pci_addr *dev_addr)
 {
+	const char *in = input;
+
 	dev_addr->domain = 0;
-	GET_PCIADDR_FIELD(input, dev_addr->bus, UINT8_MAX, ':');
-	GET_PCIADDR_FIELD(input, dev_addr->devid, UINT8_MAX, '.');
-	GET_PCIADDR_FIELD(input, dev_addr->function, UINT8_MAX, 0);
+	in = get_u8_pciaddr_field(in, &dev_addr->bus, ':');
+	if (in == NULL)
+		return -EINVAL;
+	in = get_u8_pciaddr_field(in, &dev_addr->devid, '.');
+	if (in == NULL)
+		return -EINVAL;
+	in = get_u8_pciaddr_field(in, &dev_addr->function, '\0');
+	if (in == NULL)
+		return -EINVAL;
 	return 0;
 }
 
@@ -312,13 +324,27 @@ eal_parse_pci_BDF(const char *input, struct rte_pci_addr *dev_addr)
 static inline int
 eal_parse_pci_DomBDF(const char *input, struct rte_pci_addr *dev_addr)
 {
-	GET_PCIADDR_FIELD(input, dev_addr->domain, UINT16_MAX, ':');
-	GET_PCIADDR_FIELD(input, dev_addr->bus, UINT8_MAX, ':');
-	GET_PCIADDR_FIELD(input, dev_addr->devid, UINT8_MAX, '.');
-	GET_PCIADDR_FIELD(input, dev_addr->function, UINT8_MAX, 0);
+	const char *in = input;
+	unsigned long val;
+	char *end;
+
+	errno = 0;
+	val = strtoul(in, &end, 16);
+	if (errno != 0 || end[0] != ':' || val > UINT16_MAX)
+		return -EINVAL;
+	dev_addr->domain = (uint16_t)val;
+	in = end + 1;
+	in = get_u8_pciaddr_field(in, &dev_addr->bus, ':');
+	if (in == NULL)
+		return -EINVAL;
+	in = get_u8_pciaddr_field(in, &dev_addr->devid, '.');
+	if (in == NULL)
+		return -EINVAL;
+	in = get_u8_pciaddr_field(in, &dev_addr->function, '\0');
+	if (in == NULL)
+		return -EINVAL;
 	return 0;
 }
-#undef GET_PCIADDR_FIELD
 
 /**
  * Utility function to write a pci device name, this device name can later be
Signature · 1 line
2.1.4
#37 lore raw

PATCH v2 11/12 drivers: update eventdev dependencies

In reply to Gaetan Rivet
---
 drivers/Makefile | 1 +
 1 file changed, 1 insertion(+)
drivers/Makefile +1 -0
index f3f9417..84a4864 100644
@@ -41,5 +41,6 @@ DEPDIRS-net := bus pmdinfogen mempool
 DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto
 DEPDIRS-crypto := mempool
 DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event
+DEPDIRS-event := bus
 
 include $(RTE_SDK)/mk/rte.subdir.mk
Signature · 1 line
2.1.4
#38 lore raw

PATCH v2 12/12 drivers: update cryptodev dependencies

In reply to Gaetan Rivet
---
 drivers/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/Makefile +1 -1
index 84a4864..4a92422 100644
@@ -39,7 +39,7 @@ DEPDIRS-mempool := bus
 DIRS-y += net
 DEPDIRS-net := bus pmdinfogen mempool
 DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto
-DEPDIRS-crypto := mempool
+DEPDIRS-crypto := bus mempool
 DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event
 DEPDIRS-event := bus
 
Signature · 1 line
2.1.4
#39 lore raw

v3 cover bus/pci: remove PCI bus from EAL

In reply to Gaetan Rivet

This patchset moves the PCI bus out of the EAL to the drivers/bus subdirectory.

Almost all dependencies have been worked out, only remains KNI to be made fully independent from the PCI bus in its lib section.

This patchset includes a patch disabling it, that should be removed before integration, once all dependencies have been fixed.

The pmdinfogen app has been moved to the drivers subdirectory. This allows using the dependency syntax from the build system, as this app also depends on the PCI bus. The dependency graph is as follows:

drivers/bus/pci
|
+ drivers/pmdinfogen
|
+ drivers/net

The compilation has been tested on debian 8, Redhat 7.2 and FreeBSD 10.3

This patchset depends on:

eal: complete attach / detach support
http://dpdk.org/ml/archives/dev/2017-June/067057.html
http://dpdk.org/dev/patchwork/patch/24969/

v1 -> v2:

This patchet now depends also on the eventdev PCI dependency fix:

[PATCH v2 0/4] Remove PCI and VDEV dependency from eventdev library
http://dpdk.org/ml/archives/dev/2017-June/067402.html
http://dpdk.org/dev/patchwork/patch/25092/

* Fixes a few PCI dependency left
* While wholes files are moved, fixed a few checkpatch warnings to start anew.
* Updated eventdev and cryptodev build dependencies

People who want to evaluate / test the whole system can clone:
https://github.com/grivet/dpdk/tree/master-net

v3:

Further checkpatch fixes have been applied upon the new bus.
Both cryptodev and pdump have been fixed. The patches disabling them have been removed.
This patchset now depends on both the cryptodev and pdump dependency fixes:

[dpdk-dev] [PATCH 00/12] Remove cryptodev driver
http://dpdk.org/ml/archives/dev/2017-May/066382.html

[dpdk-dev] [PATCH] pdump: remove unnecessary header file
http://dpdk.org/ml/archives/dev/2017-June/067785.html

My tree has been updated to follow the latest state of the patchsets currently live on the ML:
https://github.com/grivet/dpdk/tree/master-net

Gaetan Rivet (9):
kni: disabled by default
eal: expose rte_eal_using_phys_addrs
ethdev: remove useless PCI dependency
bus: properly include rte_debug
pmdinfogen: move to drivers subdirectory
bus/pci: introduce pci bus
bus/pci: follow checkpatch
drivers: update eventdev dependencies
drivers: update cryptodev dependencies

 GNUmakefile                                     |   2 +-
 MAINTAINERS                                     |   2 +-
 buildtools/Makefile                             |  36 --
 buildtools/pmdinfogen/Makefile                  |  47 --
 buildtools/pmdinfogen/pmdinfogen.c              | 422 --------------
 buildtools/pmdinfogen/pmdinfogen.h              | 125 ----
 config/common_base                              |  10 +
 config/common_linuxapp                          |   2 +-
 drivers/Makefile                                |   7 +-
 drivers/bus/Makefile                            |   2 +
 drivers/bus/pci/Makefile                        |  60 ++
 drivers/bus/pci/bsd/Makefile                    |  32 ++
 drivers/bus/pci/bsd/rte_bus_pci_version.map     |  21 +
 drivers/bus/pci/bsd/rte_pci.c                   | 671 ++++++++++++++++++++++
 drivers/bus/pci/include/rte_pci.h               | 656 +++++++++++++++++++++
 drivers/bus/pci/linux/Makefile                  |  37 ++
 drivers/bus/pci/linux/rte_bus_pci_version.map   |  21 +
 drivers/bus/pci/linux/rte_pci.c                 | 722 +++++++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_init.h            |  97 ++++
 drivers/bus/pci/linux/rte_pci_uio.c             | 571 +++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_vfio.c            | 684 ++++++++++++++++++++++
 drivers/bus/pci/linux/rte_vfio_mp_sync.c        | 424 ++++++++++++++
 drivers/bus/pci/private.h                       | 169 ++++++
 drivers/bus/pci/rte_pci_common.c                | 601 ++++++++++++++++++++
 drivers/bus/pci/rte_pci_common_uio.c            | 234 ++++++++
 drivers/pmdinfogen/Makefile                     |  47 ++
 drivers/pmdinfogen/pmdinfogen.c                 | 422 ++++++++++++++
 drivers/pmdinfogen/pmdinfogen.h                 | 125 ++++
 lib/librte_eal/bsdapp/eal/Makefile              |   3 -
 lib/librte_eal/bsdapp/eal/eal.c                 |   1 -
 lib/librte_eal/bsdapp/eal/eal_pci.c             | 672 ----------------------
 lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  15 -
 lib/librte_eal/common/Makefile                  |   2 +-
 lib/librte_eal/common/eal_common_bus.c          |   1 +
 lib/librte_eal/common/eal_common_pci.c          | 603 --------------------
 lib/librte_eal/common/eal_common_pci_uio.c      | 233 --------
 lib/librte_eal/common/eal_private.h             | 138 -----
 lib/librte_eal/common/include/rte_pci.h         | 601 --------------------
 lib/librte_eal/linuxapp/eal/Makefile            |  12 +-
 lib/librte_eal/linuxapp/eal/eal.c               |   1 -
 lib/librte_eal/linuxapp/eal/eal_interrupts.c    |   1 -
 lib/librte_eal/linuxapp/eal/eal_memory.c        |   3 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           | 723 ------------------------
 lib/librte_eal/linuxapp/eal/eal_pci_init.h      |  97 ----
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c       | 567 -------------------
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c      | 674 ----------------------
 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c  | 424 --------------
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  16 +-
 lib/librte_eal/linuxapp/eal/rte_memory_linux.h  |  64 +++
 lib/librte_ether/rte_ethdev.c                   |   1 -
 mk/rte.app.mk                                   |   2 +
 51 files changed, 5687 insertions(+), 5416 deletions(-)
 delete mode 100644 buildtools/Makefile
 delete mode 100644 buildtools/pmdinfogen/Makefile
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.c
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.h
 create mode 100644 drivers/bus/pci/Makefile
 create mode 100644 drivers/bus/pci/bsd/Makefile
 create mode 100644 drivers/bus/pci/bsd/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/bsd/rte_pci.c
 create mode 100644 drivers/bus/pci/include/rte_pci.h
 create mode 100644 drivers/bus/pci/linux/Makefile
 create mode 100644 drivers/bus/pci/linux/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/linux/rte_pci.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_init.h
 create mode 100644 drivers/bus/pci/linux/rte_pci_uio.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_vfio.c
 create mode 100644 drivers/bus/pci/linux/rte_vfio_mp_sync.c
 create mode 100644 drivers/bus/pci/private.h
 create mode 100644 drivers/bus/pci/rte_pci_common.c
 create mode 100644 drivers/bus/pci/rte_pci_common_uio.c
 create mode 100644 drivers/pmdinfogen/Makefile
 create mode 100644 drivers/pmdinfogen/pmdinfogen.c
 create mode 100644 drivers/pmdinfogen/pmdinfogen.h
 delete mode 100644 lib/librte_eal/bsdapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci_uio.c
 delete mode 100644 lib/librte_eal/common/include/rte_pci.h
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_init.h
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_uio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
 create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h
Signature · 1 line
2.1.4
#40 lore raw

PATCH v3 1/9 kni: disabled by default

---
 config/common_linuxapp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
config/common_linuxapp +1 -1
index b3cf41b..cc85cc6 100644
@@ -38,7 +38,7 @@ CONFIG_RTE_EXEC_ENV_LINUXAPP=y
 CONFIG_RTE_EAL_IGB_UIO=y
 CONFIG_RTE_EAL_VFIO=y
 CONFIG_RTE_KNI_KMOD=y
-CONFIG_RTE_LIBRTE_KNI=y
+CONFIG_RTE_LIBRTE_KNI=n
 CONFIG_RTE_LIBRTE_PMD_KNI=y
 CONFIG_RTE_LIBRTE_VHOST=y
 CONFIG_RTE_LIBRTE_PMD_VHOST=y
Signature · 1 line
2.1.4
#41 lore raw

PATCH v3 2/9 eal: expose rte_eal_using_phys_addrs

In reply to Gaetan Rivet

This function was previously private to the EAL layer. Other subsystems requires it, such as the PCI bus.

This function is only exposed for linuxapps.

In order not to force other components to include stdbool, which is incompatible with several NIC drivers, the return type has been changed from bool to int.

---
 lib/librte_eal/common/eal_private.h             | 11 -----
 lib/librte_eal/linuxapp/eal/Makefile            |  2 +
 lib/librte_eal/linuxapp/eal/eal_memory.c        |  3 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           |  1 +
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  1 +
 lib/librte_eal/linuxapp/eal/rte_memory_linux.h  | 64 +++++++++++++++++++++++++
 6 files changed, 70 insertions(+), 12 deletions(-)
 create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h
lib/librte_eal/common/eal_private.h +0 -11
index 6cacce0..bdec053 100644
@@ -327,15 +327,4 @@ int rte_eal_hugepage_init(void);
  */
 int rte_eal_hugepage_attach(void);
 
-/**
- * Returns true if the system is able to obtain
- * physical addresses. Return false if using DMA
- * addresses through an IOMMU.
- *
- * Drivers based on uio will not load unless physical
- * addresses are obtainable. It is only possible to get
- * physical addresses when running as a privileged user.
- */
-bool rte_eal_using_phys_addrs(void);
-
 #endif /* _EAL_PRIVATE_H_ */
lib/librte_eal/linuxapp/eal/Makefile +2 -0
index 640afd0..530e286 100644
@@ -131,4 +131,6 @@ INC := rte_interrupts.h rte_kni_common.h rte_dom0_common.h
 SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include/exec-env := \
 	$(addprefix include/exec-env/,$(INC))
 
+SYMLINK-$(CONFIG_RTE_EXEC_ENV_LINUXAPP)-include += rte_memory_linux.h
+
 include $(RTE_SDK)/mk/rte.lib.mk
lib/librte_eal/linuxapp/eal/eal_memory.c +2 -1
index e17c9cb..d53c364 100644
@@ -70,6 +70,7 @@
 #include "eal_internal_cfg.h"
 #include "eal_filesystem.h"
 #include "eal_hugepages.h"
+#include "rte_memory_linux.h"
 
 #define PFN_MASK_SIZE	8
 
@@ -1433,7 +1434,7 @@ rte_eal_hugepage_attach(void)
 	return -1;
 }
 
-bool
+int
 rte_eal_using_phys_addrs(void)
 {
 	return phys_addrs_available;
lib/librte_eal/linuxapp/eal/eal_pci.c +1 -0
index 595622b..9d5b051 100644
@@ -45,6 +45,7 @@
 #include "eal_filesystem.h"
 #include "eal_private.h"
 #include "eal_pci_init.h"
+#include "rte_memory_linux.h"
 
 /**
  * @file
lib/librte_eal/linuxapp/eal/rte_eal_version.map +1 -0
index 19eec05..6a677fc 100644
@@ -209,5 +209,6 @@ DPDK_17.08 {
 	rte_bus_from_dev;
 	rte_eal_devargs_clone;
 	rte_eal_devargs_rmv;
+	rte_eal_using_phys_addrs;
 
 } DPDK_17.05;
lib/librte_eal/linuxapp/eal/rte_memory_linux.h new file +64 -0

64 lines not on this page · raw message

Signature · 1 line
2.1.4
#42 lore raw

Re: [PATCH v3 2/9] eal: expose rte_eal_using_phys_addrs

21/06/2017 01:36, Gaetan Rivet:

Quoted 4 lines

This function was previously private to the EAL layer. Other subsystems requires it, such as the PCI bus.

This function is only exposed for linuxapps.

Why exposing it only for Linux?
Every API should be common, even if it is not implemented for FreeBSD.

#43 lore raw

Re: [PATCH v3 2/9] eal: expose rte_eal_using_phys_addrs

Quoted 9 lines · Thomas Monjalon

21/06/2017 01:36, Gaetan Rivet:

Quoted 4 lines

This function was previously private to the EAL layer. Other subsystems requires it, such as the PCI bus.

This function is only exposed for linuxapps.

Why exposing it only for Linux?
Every API should be common, even if it is not implemented for FreeBSD.

Ok, will fix in next version.

Signature · 2 lines
Gaëtan Rivet
6WIND
#44 lore raw

PATCH v3 3/9 ethdev: remove useless PCI dependency

In reply to Gaetan Rivet
---
 lib/librte_ether/rte_ethdev.c | 1 -
 1 file changed, 1 deletion(-)
lib/librte_ether/rte_ethdev.c +0 -1
index 4a1d0b9..bc4941e 100644
@@ -47,7 +47,6 @@
 #include <rte_log.h>
 #include <rte_debug.h>
 #include <rte_interrupts.h>
-#include <rte_pci.h>
 #include <rte_memory.h>
 #include <rte_memcpy.h>
 #include <rte_memzone.h>
Signature · 1 line
2.1.4
#45 lore raw

PATCH v3 4/9 bus: properly include rte_debug

In reply to Gaetan Rivet
---
 lib/librte_eal/common/eal_common_bus.c | 1 +
 1 file changed, 1 insertion(+)
lib/librte_eal/common/eal_common_bus.c +1 -0
index e9fbc03..7e8d50b 100644
@@ -36,6 +36,7 @@
 #include <sys/queue.h>
 
 #include <rte_bus.h>
+#include <rte_debug.h>
 
 #include "eal_private.h"
 
Signature · 1 line
2.1.4
#47 lore raw

Re: [PATCH v3 4/9] bus: properly include rte_debug

Quoted 4 lines · Thomas Monjalon

21/06/2017 01:36, Gaetan Rivet:

Quoted 1 line

Please add a comment to explain why this include is required now.

This commit will have this comment in the next version:

This include is necessary for rte_bus, but it is currently brought by eal_private.h including rte_pci.h, including rte_debug.h.

rte_pci.h will move out of the EAL. All compilation units should be self-sufficient include-wise.

Cheers,

Signature · 2 lines
Gaëtan Rivet
6WIND
#48 lore raw

PATCH v3 5/9 pmdinfogen: move to drivers subdirectory

In reply to Gaetan Rivet

pmdinfogen has a dependency on the PCI bus. The latter must be built first.

---
 GNUmakefile                        |   2 +-
 MAINTAINERS                        |   2 +-
 buildtools/Makefile                |  36 ----
 buildtools/pmdinfogen/Makefile     |  47 -----
 buildtools/pmdinfogen/pmdinfogen.c | 422 -------------------------------------
 buildtools/pmdinfogen/pmdinfogen.h | 125 -----------
 drivers/Makefile                   |   4 +-
 drivers/pmdinfogen/Makefile        |  47 +++++
 drivers/pmdinfogen/pmdinfogen.c    | 422 +++++++++++++++++++++++++++++++++++++
 drivers/pmdinfogen/pmdinfogen.h    | 125 +++++++++++
 10 files changed, 599 insertions(+), 633 deletions(-)
 delete mode 100644 buildtools/Makefile
 delete mode 100644 buildtools/pmdinfogen/Makefile
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.c
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.h
 create mode 100644 drivers/pmdinfogen/Makefile
 create mode 100644 drivers/pmdinfogen/pmdinfogen.c
 create mode 100644 drivers/pmdinfogen/pmdinfogen.h
GNUmakefile +1 -1
index 45b7fbb..c292646 100644
@@ -40,7 +40,7 @@ export RTE_SDK
 # directory list
 #
 
-ROOTDIRS-y := buildtools lib drivers app
+ROOTDIRS-y := lib drivers app
 ROOTDIRS-  := test
 
 include $(RTE_SDK)/mk/rte.sdkroot.mk
MAINTAINERS +1 -1
index f6095ef..c8c57cb 100644
@@ -72,7 +72,7 @@ F: doc/guides/rel_notes/deprecation.rst
 F: devtools/validate-abi.sh
 
 Driver information
-F: buildtools/pmdinfogen/
+F: drivers/pmdinfogen/
 F: usertools/dpdk-pmdinfo.py
 F: doc/guides/tools/pmdinfo.rst
 
buildtools/Makefile deleted +0 -36
deleted file mode 100644
index 35a42ff..0000000
@@ -1,36 +0,0 @@
-#   BSD LICENSE
-#
-#   Copyright(c) 2016 Neil Horman. All rights reserved.
-#   All rights reserved.
-#
-#   Redistribution and use in source and binary forms, with or without
-#   modification, are permitted provided that the following conditions
-#   are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in
-#       the documentation and/or other materials provided with the
-#       distribution.
-#     * Neither the name of Intel Corporation nor the names of its
-#       contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-include $(RTE_SDK)/mk/rte.vars.mk
-
-DIRS-y += pmdinfogen
-
-include $(RTE_SDK)/mk/rte.subdir.mk
buildtools/pmdinfogen/Makefile deleted +0 -47

47 lines not on this page · raw message

buildtools/pmdinfogen/pmdinfogen.c deleted +0 -422

422 lines not on this page · raw message

buildtools/pmdinfogen/pmdinfogen.h deleted +0 -125

125 lines not on this page · raw message

drivers/Makefile +3 -1
index a04a01f..f3f9417 100644
@@ -32,10 +32,12 @@
 include $(RTE_SDK)/mk/rte.vars.mk
 
 DIRS-y += bus
+DIRS-y += pmdinfogen
+DEPDIRS-pmdinfogen := bus
 DIRS-y += mempool
 DEPDIRS-mempool := bus
 DIRS-y += net
-DEPDIRS-net := bus mempool
+DEPDIRS-net := bus pmdinfogen mempool
 DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto
 DEPDIRS-crypto := mempool
 DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event
drivers/pmdinfogen/Makefile new file +47 -0

47 lines not on this page · raw message

drivers/pmdinfogen/pmdinfogen.c new file +422 -0

422 lines not on this page · raw message

drivers/pmdinfogen/pmdinfogen.h new file +125 -0

125 lines not on this page · raw message

Signature · 1 line
2.1.4
#49 lore raw

Re: [PATCH v3 5/9] pmdinfogen: move to drivers subdirectory

21/06/2017 01:36, Gaetan Rivet:

Quoted 2 lines

pmdinfogen has a dependency on the PCI bus. The latter must be built first.

I think it should not be moved outside of buildtools.

The build order can be fixed by installing headers before any compilation like proposed in this RFC: http://dpdk.org/patch/25463

Another (probably better) solution is to keep basic definitions and helpers in EAL:
- rte_pci.h keeps only some PCI definitions and helpers
like rte_pci_addr and eal_parse_pci_BDF() in EAL
- bus management is done in the PCI driver

For pmdinfogen, we just need struct rte_pci_id.
Other tools or applications will probably need this kind of basic struct and functions available in EAL.

#50 lore raw

Re: [PATCH v3 5/9] pmdinfogen: move to drivers subdirectory

Quoted 6 lines · Thomas Monjalon

21/06/2017 01:36, Gaetan Rivet:

Quoted 2 lines

pmdinfogen has a dependency on the PCI bus. The latter must be built first.

I think it should not be moved outside of buildtools.

Right, I agree. I took the simplest path here, but if there is a better solution to be found I'd prefer to use it.

Quoted 3 lines

The build order can be fixed by installing headers before any compilation like proposed in this RFC: http://dpdk.org/patch/25463

This RFC should be discussed on its own merit, I will chime in the relevant thread.

Quoted 9 lines

Another (probably better) solution is to keep basic definitions and helpers in EAL:
- rte_pci.h keeps only some PCI definitions and helpers
like rte_pci_addr and eal_parse_pci_BDF() in EAL
- bus management is done in the PCI driver

For pmdinfogen, we just need struct rte_pci_id.
Other tools or applications will probably need this kind of basic struct and functions available in EAL.

I mostly agree, this proposal should be kept to a minimum at first for this release and carefully expanded afterward.

If that's ok, I will propose a new version of this patchset with a new librte_pci, that might fix both pmdinfogen and librte_kni.

Signature · 2 lines
Gaëtan Rivet
6WIND
#51 lore raw

Re: [PATCH v3 5/9] pmdinfogen: move to drivers subdirectory

21/06/2017 11:40, Gaëtan Rivet:

Quoted 11 lines · Thomas Monjalon
Quoted 9 lines

Another (probably better) solution is to keep basic definitions and helpers in EAL:
- rte_pci.h keeps only some PCI definitions and helpers
like rte_pci_addr and eal_parse_pci_BDF() in EAL
- bus management is done in the PCI driver

For pmdinfogen, we just need struct rte_pci_id.
Other tools or applications will probably need this kind of basic struct and functions available in EAL.

Quoted 5 lines

I mostly agree, this proposal should be kept to a minimum at first for this release and carefully expanded afterward.

If that's ok, I will propose a new version of this patchset with a new librte_pci, that might fix both pmdinfogen and librte_kni.

Why creating a new librte_pci instead of just keeping it in EAL?

#52 lore raw

Re: [PATCH v3 5/9] pmdinfogen: move to drivers subdirectory

Quoted 12 lines · Thomas Monjalon

21/06/2017 11:40, Gaëtan Rivet:

Quoted 11 lines · Thomas Monjalon
Quoted 9 lines

Another (probably better) solution is to keep basic definitions and helpers in EAL:
- rte_pci.h keeps only some PCI definitions and helpers
like rte_pci_addr and eal_parse_pci_BDF() in EAL
- bus management is done in the PCI driver

For pmdinfogen, we just need struct rte_pci_id.
Other tools or applications will probably need this kind of basic struct and functions available in EAL.

Quoted 7 lines
Quoted 5 lines

I mostly agree, this proposal should be kept to a minimum at first for this release and carefully expanded afterward.

If that's ok, I will propose a new version of this patchset with a new librte_pci, that might fix both pmdinfogen and librte_kni.

Why creating a new librte_pci instead of just keeping it in EAL?

While I agree that it makes sense to have PCI helpers shared among several subsystems, I do not see a reason for the EAL to rely on it.

The EAL is the bedrock of the whole system. Having those helpers within would mean that one expects them to be used to build this bedrock. It would be misleading.

In the context of a framework, aimed at being used by others, an okay architecture is one that works. A good architecture is one that intrinsically convey meaning and explains its goal to developers relying on it. I think that having this PCI lib within EAL just because nothing prevents us from doing so is mistaken, in this regard.

Conversely, the argument about being conservative in the changes, especially to an essential part such as the EAL, is obsolete for this release and this subsystem, as deep changes are necessary anyway, and the design should be right from the get go to allow further stability.

Finally, the PCI lib and bus is also an example for other developers. I do not think that all other hardware buses should be allowed in adding their own specific helpers to the EAL. In this regard, there is no reason to have an exception made just for the PCI lib.

Signature · 2 lines
Gaëtan Rivet
6WIND
#53 lore raw

Re: [PATCH v3 5/9] pmdinfogen: move to drivers subdirectory

21/06/2017 13:39, Gaëtan Rivet:

Quoted 39 lines · Thomas Monjalon
Quoted 12 lines

21/06/2017 11:40, Gaëtan Rivet:

Quoted 11 lines · Thomas Monjalon
Quoted 9 lines

Another (probably better) solution is to keep basic definitions and helpers in EAL:
- rte_pci.h keeps only some PCI definitions and helpers
like rte_pci_addr and eal_parse_pci_BDF() in EAL
- bus management is done in the PCI driver

For pmdinfogen, we just need struct rte_pci_id.
Other tools or applications will probably need this kind of basic struct and functions available in EAL.

Quoted 7 lines
Quoted 5 lines

I mostly agree, this proposal should be kept to a minimum at first for this release and carefully expanded afterward.

If that's ok, I will propose a new version of this patchset with a new librte_pci, that might fix both pmdinfogen and librte_kni.

Why creating a new librte_pci instead of just keeping it in EAL?

While I agree that it makes sense to have PCI helpers shared among several subsystems, I do not see a reason for the EAL to rely on it.

The EAL is the bedrock of the whole system. Having those helpers within would mean that one expects them to be used to build this bedrock. It would be misleading.

In the context of a framework, aimed at being used by others, an okay architecture is one that works. A good architecture is one that intrinsically convey meaning and explains its goal to developers relying on it. I think that having this PCI lib within EAL just because nothing prevents us from doing so is mistaken, in this regard.

Conversely, the argument about being conservative in the changes, especially to an essential part such as the EAL, is obsolete for this release and this subsystem, as deep changes are necessary anyway, and the design should be right from the get go to allow further stability.

Quoted 4 lines

Finally, the PCI lib and bus is also an example for other developers. I do not think that all other hardware buses should be allowed in adding their own specific helpers to the EAL. In this regard, there is no reason to have an exception made just for the PCI lib.

You get a point :)

#54 lore raw

PATCH v3 6/9 bus/pci: introduce pci bus

In reply to Gaetan Rivet

Move the PCI bus from the EAL to drivers/bus.

---
 config/common_base                              |  10 +
 drivers/bus/Makefile                            |   2 +
 drivers/bus/pci/Makefile                        |  60 ++
 drivers/bus/pci/bsd/Makefile                    |  32 ++
 drivers/bus/pci/bsd/rte_bus_pci_version.map     |  21 +
 drivers/bus/pci/bsd/rte_pci.c                   | 672 ++++++++++++++++++++++
 drivers/bus/pci/include/rte_pci.h               | 630 +++++++++++++++++++++
 drivers/bus/pci/linux/Makefile                  |  37 ++
 drivers/bus/pci/linux/rte_bus_pci_version.map   |  21 +
 drivers/bus/pci/linux/rte_pci.c                 | 724 ++++++++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_init.h            |  97 ++++
 drivers/bus/pci/linux/rte_pci_uio.c             | 567 +++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_vfio.c            | 674 ++++++++++++++++++++++
 drivers/bus/pci/linux/rte_vfio_mp_sync.c        | 424 ++++++++++++++
 drivers/bus/pci/private.h                       | 167 ++++++
 drivers/bus/pci/rte_pci_common.c                | 603 ++++++++++++++++++++
 drivers/bus/pci/rte_pci_common_uio.c            | 234 ++++++++
 lib/librte_eal/bsdapp/eal/Makefile              |   3 -
 lib/librte_eal/bsdapp/eal/eal.c                 |   1 -
 lib/librte_eal/bsdapp/eal/eal_pci.c             | 672 ----------------------
 lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  15 -
 lib/librte_eal/common/Makefile                  |   2 +-
 lib/librte_eal/common/eal_common_pci.c          | 603 --------------------
 lib/librte_eal/common/eal_common_pci_uio.c      | 233 --------
 lib/librte_eal/common/eal_private.h             | 127 -----
 lib/librte_eal/common/include/rte_pci.h         | 601 --------------------
 lib/librte_eal/linuxapp/eal/Makefile            |  10 -
 lib/librte_eal/linuxapp/eal/eal.c               |   1 -
 lib/librte_eal/linuxapp/eal/eal_interrupts.c    |   1 -
 lib/librte_eal/linuxapp/eal/eal_pci.c           | 724 ------------------------
 lib/librte_eal/linuxapp/eal/eal_pci_init.h      |  97 ----
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c       | 567 -------------------
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c      | 674 ----------------------
 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c  | 424 --------------
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  15 -
 mk/rte.app.mk                                   |   2 +
 36 files changed, 4978 insertions(+), 4769 deletions(-)
 create mode 100644 drivers/bus/pci/Makefile
 create mode 100644 drivers/bus/pci/bsd/Makefile
 create mode 100644 drivers/bus/pci/bsd/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/bsd/rte_pci.c
 create mode 100644 drivers/bus/pci/include/rte_pci.h
 create mode 100644 drivers/bus/pci/linux/Makefile
 create mode 100644 drivers/bus/pci/linux/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/linux/rte_pci.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_init.h
 create mode 100644 drivers/bus/pci/linux/rte_pci_uio.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_vfio.c
 create mode 100644 drivers/bus/pci/linux/rte_vfio_mp_sync.c
 create mode 100644 drivers/bus/pci/private.h
 create mode 100644 drivers/bus/pci/rte_pci_common.c
 create mode 100644 drivers/bus/pci/rte_pci_common_uio.c
 delete mode 100644 lib/librte_eal/bsdapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci_uio.c
 delete mode 100644 lib/librte_eal/common/include/rte_pci.h
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_init.h
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_uio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
config/common_base +10 -0
index f6aafd1..0522a90 100644
@@ -145,6 +145,16 @@ CONFIG_RTE_ETHDEV_RXTX_CALLBACKS=y
 CONFIG_RTE_ETHDEV_TX_PREPARE_NOOP=n
 
 #
+# Support NIC bypass logic
+#
+CONFIG_RTE_NIC_BYPASS=n
+
+#
+# Compile PCI bus driver
+#
+CONFIG_RTE_LIBRTE_PCI_BUS=y
+
+#
 # Compile burst-oriented Amazon ENA PMD driver
 #
 CONFIG_RTE_LIBRTE_ENA_PMD=y
drivers/bus/Makefile +2 -0
index 1e5b281..1d1ddae 100644
@@ -35,5 +35,7 @@ core-libs := librte_eal librte_mbuf librte_mempool librte_ring librte_ether
 
 DIRS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc
 DEPDIRS-fslmc = $(core-libs)
+DIRS-$(CONFIG_RTE_LIBRTE_PCI_BUS) += pci
+DEPDIRS-pci = $(core-libs)
 
 include $(RTE_SDK)/mk/rte.subdir.mk
drivers/bus/pci/Makefile new file +60 -0

60 lines not on this page · raw message

drivers/bus/pci/bsd/Makefile new file +32 -0
new file mode 100644
index 0000000..77cf539
@@ -0,0 +1,32 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 6WIND S.A.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of 6WIND nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+SRCS += rte_pci.c
drivers/bus/pci/bsd/rte_bus_pci_version.map new file +21 -0
new file mode 100644
index 0000000..eca49e9
@@ -0,0 +1,21 @@
+DPDK_17.08 {
+	global:
+
+	rte_pci_detach;
+	rte_pci_dump;
+	rte_pci_ioport_map;
+	rte_pci_ioport_read;
+	rte_pci_ioport_unmap;
+	rte_pci_ioport_write;
+	rte_pci_map_device;
+	rte_pci_probe;
+	rte_pci_probe_one;
+	rte_pci_read_config;
+	rte_pci_register;
+	rte_pci_scan;
+	rte_pci_unmap_device;
+	rte_pci_unregister;
+	rte_pci_write_config;
+
+	local: *;
+};
drivers/bus/pci/bsd/rte_pci.c new file +672 -0

672 lines not on this page · raw message

drivers/bus/pci/include/rte_pci.h new file +630 -0

630 lines not on this page · raw message

drivers/bus/pci/linux/Makefile new file +37 -0
new file mode 100644
index 0000000..d2ea84c
@@ -0,0 +1,37 @@
+#   BSD LICENSE
+#
+#   Copyright(c) 2017 6WIND S.A.
+#   All rights reserved.
+#
+#   Redistribution and use in source and binary forms, with or without
+#   modification, are permitted provided that the following conditions
+#   are met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above copyright
+#       notice, this list of conditions and the following disclaimer in
+#       the documentation and/or other materials provided with the
+#       distribution.
+#     * Neither the name of 6WIND nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+#   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+#   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+#   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+#   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+#   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+#   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+#   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+#   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+#   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+#   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+SRCS += rte_pci.c
+SRCS += rte_pci_uio.c
+SRCS += rte_pci_vfio.c
+SRCS += rte_vfio_mp_sync.c
+
+CFLAGS += -D_GNU_SOURCE
drivers/bus/pci/linux/rte_bus_pci_version.map new file +21 -0
new file mode 100644
index 0000000..eca49e9
@@ -0,0 +1,21 @@
+DPDK_17.08 {
+	global:
+
+	rte_pci_detach;
+	rte_pci_dump;
+	rte_pci_ioport_map;
+	rte_pci_ioport_read;
+	rte_pci_ioport_unmap;
+	rte_pci_ioport_write;
+	rte_pci_map_device;
+	rte_pci_probe;
+	rte_pci_probe_one;
+	rte_pci_read_config;
+	rte_pci_register;
+	rte_pci_scan;
+	rte_pci_unmap_device;
+	rte_pci_unregister;
+	rte_pci_write_config;
+
+	local: *;
+};
drivers/bus/pci/linux/rte_pci.c new file +724 -0

724 lines not on this page · raw message

drivers/bus/pci/linux/rte_pci_init.h new file +97 -0

97 lines not on this page · raw message

drivers/bus/pci/linux/rte_pci_uio.c new file +567 -0

567 lines not on this page · raw message

drivers/bus/pci/linux/rte_pci_vfio.c new file +674 -0

116 lines not on this page · raw message

drivers/bus/pci/linux/rte_vfio_mp_sync.c new file +424 -0

424 lines not on this page · raw message

drivers/bus/pci/private.h new file +167 -0

167 lines not on this page · raw message

drivers/bus/pci/rte_pci_common.c new file +603 -0

603 lines not on this page · raw message

drivers/bus/pci/rte_pci_common_uio.c new file +234 -0

234 lines not on this page · raw message

lib/librte_eal/bsdapp/eal/Makefile +0 -3
index a0f9950..f219848 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/bsdapp/eal/eal.c +0 -1
index 05f0c1f..d84e4f1 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/bsdapp/eal/eal_pci.c deleted +0 -672

672 lines not on this page · raw message

lib/librte_eal/bsdapp/eal/rte_eal_version.map +0 -15
index d069de0..63d93bb 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/common/Makefile +1 -1
index a5bd108..c4e0af2 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/common/eal_common_pci.c deleted +0 -603

603 lines not on this page · raw message

lib/librte_eal/common/eal_common_pci_uio.c deleted +0 -233

233 lines not on this page · raw message

lib/librte_eal/common/eal_private.h +0 -127

127 lines not on this page · raw message

lib/librte_eal/common/include/rte_pci.h deleted +0 -601

601 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/Makefile +0 -10
index 530e286..872766e 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/linuxapp/eal/eal.c +0 -1
index 7c78f2d..cd4e757 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/linuxapp/eal/eal_interrupts.c +0 -1
index 2e3bd12..613804d 100644

Lines of this file are not shown. View the raw message.

lib/librte_eal/linuxapp/eal/eal_pci.c deleted +0 -724

724 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_pci_init.h deleted +0 -97

97 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_pci_uio.c deleted +0 -567

567 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_pci_vfio.c deleted +0 -674

674 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c deleted +0 -424

424 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/rte_eal_version.map +0 -15
index 6a677fc..1b24a78 100644

Lines of this file are not shown. View the raw message.

mk/rte.app.mk +2 -0
index bcaf1b3..d476068 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.1.4

Part of the diff is not shown here. View the raw message.

#55 lore raw

PATCH v3 7/9 bus/pci: follow checkpatch

In reply to Gaetan Rivet

As the PCI bus has been moved entirely to drivers/bus,
it is possible to use checkpatch for the whole set and fix it, as future fixes and merges should not be impaired any more than by the move itelf.

---
 drivers/bus/pci/bsd/rte_pci.c        |  23 ++++----
 drivers/bus/pci/include/rte_pci.h    | 102 ++++++++++++++++++++++-------------
 drivers/bus/pci/linux/rte_pci.c      |  14 +++--
 drivers/bus/pci/linux/rte_pci_init.h |   2 +-
 drivers/bus/pci/linux/rte_pci_uio.c  |  18 ++++---
 drivers/bus/pci/linux/rte_pci_vfio.c |  40 ++++++++------
 drivers/bus/pci/private.h            |   2 +
 drivers/bus/pci/rte_pci_common.c     |   2 -
 8 files changed, 120 insertions(+), 83 deletions(-)
drivers/bus/pci/bsd/rte_pci.c +11 -12
index 74b0172..d051370 100644
@@ -87,8 +87,6 @@
  * enabling bus master.
  */
 
-extern struct rte_pci_bus rte_pci_bus;
-
 /* Map pci device */
 int
 rte_pci_map_device(struct rte_pci_device *dev)
@@ -154,8 +152,9 @@ pci_uio_alloc_resource(struct rte_pci_device *dev,
 			dev->addr.bus, dev->addr.devid, dev->addr.function);
 
 	if (access(devname, O_RDWR) < 0) {
-		RTE_LOG(WARNING, EAL, "  "PCI_PRI_FMT" not managed by UIO driver, "
-				"skipping\n", loc->domain, loc->bus, loc->devid, loc->function);
+		RTE_LOG(WARNING, EAL, "  " PCI_PRI_FMT
+			" not managed by UIO driver, skipping\n",
+			loc->domain, loc->bus, loc->devid, loc->function);
 		return 1;
 	}
 
@@ -246,12 +245,11 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)
 {
 	struct rte_pci_device *dev;
 	struct pci_bar_io bar;
-	unsigned i, max;
+	unsigned int i, max;
 
 	dev = malloc(sizeof(*dev));
-	if (dev == NULL) {
+	if (dev == NULL)
 		return -1;
-	}
 
 	memset(dev, 0, sizeof(*dev));
 	dev->addr.domain = conf->pc_sel.pc_domain;
@@ -311,7 +309,8 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)
 
 		dev->mem_resource[i].len = bar.pbi_length;
 		if (PCI_BAR_IO(bar.pbi_base)) {
-			dev->mem_resource[i].addr = (void *)(bar.pbi_base & ~((uint64_t)0xf));
+			dev->mem_resource[i].addr =
+				(void *)(bar.pbi_base & ~((uint64_t)0xf));
 			continue;
 		}
 		dev->mem_resource[i].phys_addr = bar.pbi_base & ~((uint64_t)0xf);
@@ -320,8 +319,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)
 	/* device is valid, add in list (sorted) */
 	if (TAILQ_EMPTY(&rte_pci_bus.device_list)) {
 		rte_pci_add_device(dev);
-	}
-	else {
+	} else {
 		struct rte_pci_device *dev2 = NULL;
 		int ret;
 
@@ -359,7 +357,7 @@ int
 rte_pci_scan(void)
 {
 	int fd;
-	unsigned dev_count = 0;
+	unsigned int dev_count = 0;
 	struct pci_conf matches[16];
 	struct pci_conf_io conf_io = {
 			.pat_buf_len = 0,
@@ -380,7 +378,8 @@ rte_pci_scan(void)
 	}
 
 	do {
-		unsigned i;
+		unsigned int i;
+
 		if (ioctl(fd, PCIOCGETCONF, &conf_io) < 0) {
 			RTE_LOG(ERR, EAL, "%s(): error with ioctl on /dev/pci: %s\n",
 					__func__, strerror(errno));
drivers/bus/pci/include/rte_pci.h +64 -38

142 lines not on this page · raw message

drivers/bus/pci/linux/rte_pci.c +6 -8
index 3c4b425..5a6de9d 100644
@@ -56,8 +56,6 @@
  * IGB_UIO driver (or doesn't initialize, if the device wasn't bound to it).
  */
 
-extern struct rte_pci_bus rte_pci_bus;
-
 static int
 pci_get_kernel_driver_by_path(const char *filename, char *dri_name)
 {
@@ -147,7 +145,7 @@ pci_find_max_end_va(void)
 {
 	const struct rte_memseg *seg = rte_eal_get_physmem_layout();
 	const struct rte_memseg *last = seg;
-	unsigned i = 0;
+	unsigned int i = 0;
 
 	for (i = 0; i < RTE_MAX_MEMSEG; i++, seg++) {
 		if (seg->addr == NULL)
@@ -209,8 +207,7 @@ pci_parse_sysfs_resource(const char *filename, struct rte_pci_device *dev)
 		return -1;
 	}
 
-	for (i = 0; i<PCI_MAX_RESOURCE; i++) {
-
+	for (i = 0; i < PCI_MAX_RESOURCE; i++) {
 		if (fgets(buf, sizeof(buf), f) == NULL) {
 			RTE_LOG(ERR, EAL,
 				"%s(): cannot read resource\n", __func__);
@@ -424,7 +421,7 @@ parse_pci_addr_format(const char *buf, int bufsize, struct rte_pci_addr *addr)
 			!= PCI_FMT_NVAL - 1)
 		goto error;
 	/* final split is on '.' between devid and function */
-	splitaddr.function = strchr(splitaddr.devid,'.');
+	splitaddr.function = strchr(splitaddr.devid, '.');
 	if (splitaddr.function == NULL)
 		goto error;
 	*splitaddr.function++ = '\0';
@@ -579,8 +576,9 @@ pci_ioport_map(struct rte_pci_device *dev, int bar __rte_unused,
 			while (*ptr && isspace(*ptr))
 				ptr++;
 
-			sscanf(ptr, "%04hx-%04hx", &start, &end);
-
+			n = sscanf(ptr, "%04hx-%04hx", &start, &end);
+			if (n != 2)
+				return -1;
 			break;
 		}
 	}
drivers/bus/pci/linux/rte_pci_init.h +1 -1
index ae2980d..297dd66 100644
@@ -81,7 +81,7 @@ int pci_vfio_write_config(const struct rte_intr_handle *intr_handle,
 			  const void *buf, size_t len, off_t offs);
 
 int pci_vfio_ioport_map(struct rte_pci_device *dev, int bar,
-		        struct rte_pci_ioport *p);
+			struct rte_pci_ioport *p);
 void pci_vfio_ioport_read(struct rte_pci_ioport *p,
 			  void *data, size_t len, off_t offset);
 void pci_vfio_ioport_write(struct rte_pci_ioport *p,
drivers/bus/pci/linux/rte_pci_uio.c +11 -7
index eed6d0f..44fae6d 100644
@@ -102,16 +102,17 @@ pci_uio_set_bus_master(int dev_fd)
 }
 
 static int
-pci_mknod_uio_dev(const char *sysfs_uio_path, unsigned uio_num)
+pci_mknod_uio_dev(const char *sysfs_uio_path, unsigned int uio_num)
 {
 	FILE *f;
 	char filename[PATH_MAX];
 	int ret;
-	unsigned major, minor;
+	unsigned int major, minor;
 	dev_t dev;
 
 	/* get the name of the sysfs file that contains the major and minor
-	 * of the uio device and read its content */
+	 * of the uio device and read its content.
+	 */
 	snprintf(filename, sizeof(filename), "%s/dev", sysfs_uio_path);
 
 	f = fopen(filename, "r");
@@ -160,7 +161,8 @@ pci_get_uio_dev(struct rte_pci_device *dev, char *dstbuf,
 	char dirname[PATH_MAX];
 
 	/* depending on kernel version, uio can be located in uio/uioX
-	 * or uio:uioX */
+	 * or uio:uioX
+	 */
 
 	snprintf(dirname, sizeof(dirname),
 			"%s/" PCI_PRI_FMT "/uio", pci_get_sysfs_path(),
@@ -253,8 +255,9 @@ pci_uio_alloc_resource(struct rte_pci_device *dev,
 	/* find uio resource */
 	uio_num = pci_get_uio_dev(dev, dirname, sizeof(dirname), 1);
 	if (uio_num < 0) {
-		RTE_LOG(WARNING, EAL, "  "PCI_PRI_FMT" not managed by UIO driver, "
-				"skipping\n", loc->domain, loc->bus, loc->devid, loc->function);
+		RTE_LOG(WARNING, EAL, "  " PCI_PRI_FMT
+			" not managed by UIO driver, skipping\n",
+			loc->domain, loc->bus, loc->devid, loc->function);
 		return 1;
 	}
 	snprintf(devname, sizeof(devname), "/dev/uio%u", uio_num);
@@ -394,7 +397,8 @@ pci_uio_ioport_map(struct rte_pci_device *dev, int bar,
 		return -1;
 	}
 	/* ensure we don't get anything funny here, read/write will cast to
-	 * uin16_t */
+	 * uin16_t.
+	 */
 	if (start > UINT16_MAX)
 		return -1;
 
drivers/bus/pci/linux/rte_pci_vfio.c +25 -15
index 81b67c9..e5a60e8 100644
@@ -127,8 +127,9 @@ pci_vfio_get_msix_bar(int fd, int *msix_bar, uint32_t *msix_table_offset,
 		/* if we haven't reached MSI-X, check next capability */
 		if (cap_id != PCI_CAP_ID_MSIX) {
 			ret = pread64(fd, &reg, sizeof(reg),
-					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
-					cap_offset);
+					VFIO_GET_REGION_ADDR(
+						VFIO_PCI_CONFIG_REGION_INDEX
+					) + cap_offset);
 			if (ret != sizeof(reg)) {
 				RTE_LOG(ERR, EAL, "Cannot read capability pointer from PCI "
 						"config space!\n");
@@ -144,8 +145,9 @@ pci_vfio_get_msix_bar(int fd, int *msix_bar, uint32_t *msix_table_offset,
 		else {
 			/* table offset resides in the next 4 bytes */
 			ret = pread64(fd, &reg, sizeof(reg),
-					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
-					cap_offset + 4);
+					VFIO_GET_REGION_ADDR(
+						VFIO_PCI_CONFIG_REGION_INDEX
+					) + cap_offset + 4);
 			if (ret != sizeof(reg)) {
 				RTE_LOG(ERR, EAL, "Cannot read table offset from PCI config "
 						"space!\n");
@@ -153,8 +155,9 @@ pci_vfio_get_msix_bar(int fd, int *msix_bar, uint32_t *msix_table_offset,
 			}
 
 			ret = pread64(fd, &flags, sizeof(flags),
-					VFIO_GET_REGION_ADDR(VFIO_PCI_CONFIG_REGION_INDEX) +
-					cap_offset + 2);
+					VFIO_GET_REGION_ADDR(
+						VFIO_PCI_CONFIG_REGION_INDEX
+					) + cap_offset + 2);
 			if (ret != sizeof(flags)) {
 				RTE_LOG(ERR, EAL, "Cannot read table flags from PCI config "
 						"space!\n");
@@ -254,14 +257,15 @@ pci_vfio_setup_interrupts(struct rte_pci_device *dev, int vfio_dev_fd)
 		}
 
 		/* if this vector cannot be used with eventfd, fail if we explicitly
-		 * specified interrupt type, otherwise continue */
+		 * specified interrupt type, otherwise continue.
+		 */
 		if ((irq.flags & VFIO_IRQ_INFO_EVENTFD) == 0) {
 			if (internal_config.vfio_intr_mode != RTE_INTR_MODE_NONE) {
 				RTE_LOG(ERR, EAL,
 						"  interrupt vector does not support eventfd!\n");
 				return -1;
-			} else
-				continue;
+			}
+			continue;
 		}
 
 		/* set up an eventfd for interrupts */
@@ -313,7 +317,8 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
 	struct rte_pci_addr *loc = &dev->addr;
 	int i, ret, msix_bar;
 	struct mapped_pci_resource *vfio_res = NULL;
-	struct mapped_pci_res_list *vfio_res_list = RTE_TAILQ_CAST(rte_vfio_tailq.head, mapped_pci_res_list);
+	struct mapped_pci_res_list *vfio_res_list =
+		RTE_TAILQ_CAST(rte_vfio_tailq.head, mapped_pci_res_list);
 
 	struct pci_map *maps;
 	uint32_t msix_table_offset = 0;
@@ -331,8 +336,10 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
 					&vfio_dev_fd, &device_info)))
 		return ret;
 
-	/* get MSI-X BAR, if any (we have to know where it is because we can't
-	 * easily mmap it when using VFIO) */
+	/*
+	 * get MSI-X BAR, if any (we have to know where it is because we can't
+	 * easily mmap it when using VFIO)
+	 */
 	msix_bar = -1;
 	ret = pci_vfio_get_msix_bar(vfio_dev_fd, &msix_bar,
 				    &msix_table_offset, &msix_table_size);
@@ -389,7 +396,8 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
 
 		if (ret) {
 			RTE_LOG(ERR, EAL, "  %s cannot get device region info "
-					"error %i (%s)\n", pci_addr, errno, strerror(errno));
+				"error %i (%s)\n",
+				pci_addr, errno, strerror(errno));
 			close(vfio_dev_fd);
 			if (internal_config.process_type == RTE_PROC_PRIMARY)
 				rte_free(vfio_res);
@@ -515,7 +523,8 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
 	/* if secondary process, do not set up interrupts */
 	if (internal_config.process_type == RTE_PROC_PRIMARY) {
 		if (pci_vfio_setup_interrupts(dev, vfio_dev_fd) != 0) {
-			RTE_LOG(ERR, EAL, "  %s error setting up interrupts!\n", pci_addr);
+			RTE_LOG(ERR, EAL, "  %s error setting up interrupts!\n",
+				pci_addr);
 			close(vfio_dev_fd);
 			rte_free(vfio_res);
 			return -1;
@@ -523,7 +532,8 @@ pci_vfio_map_resource(struct rte_pci_device *dev)
 
 		/* set bus mastering for the device */
 		if (pci_vfio_set_bus_master(vfio_dev_fd, true)) {
-			RTE_LOG(ERR, EAL, "  %s cannot set up bus mastering!\n", pci_addr);
+			RTE_LOG(ERR, EAL, "  %s cannot set up bus mastering!\n",
+				pci_addr);
 			close(vfio_dev_fd);
 			rte_free(vfio_res);
 			return -1;
drivers/bus/pci/private.h +2 -0
index e5ccfd5..d28b63c 100644
@@ -41,6 +41,8 @@
 struct rte_pci_driver;
 struct rte_pci_device;
 
+extern struct rte_pci_bus rte_pci_bus;
+
 /**
  * Add a PCI device to the PCI Bus (append to PCI Device list). This function
  * also updates the bus references of the PCI Device (and the generic device
drivers/bus/pci/rte_pci_common.c +0 -2
index 75c4f64..3816005 100644
@@ -56,8 +56,6 @@
 
 #include "private.h"
 
-extern struct rte_pci_bus rte_pci_bus;
-
 #define SYSFS_PCI_DEVICES "/sys/bus/pci/devices"
 
 const char *pci_get_sysfs_path(void)
Signature · 1 line
2.1.4
#56 lore raw

PATCH v3 8/9 drivers: update eventdev dependencies

In reply to Gaetan Rivet
---
 drivers/Makefile | 1 +
 1 file changed, 1 insertion(+)
drivers/Makefile +1 -0
index f3f9417..30c28e4 100644
@@ -41,5 +41,6 @@ DEPDIRS-net := bus pmdinfogen mempool
 DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto
 DEPDIRS-crypto := mempool
 DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event
+DEPDIRS-event := bus pmdinfogen
 
 include $(RTE_SDK)/mk/rte.subdir.mk
Signature · 1 line
2.1.4
#57 lore raw

PATCH v3 9/9 drivers: update cryptodev dependencies

In reply to Gaetan Rivet
---
 drivers/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/Makefile +1 -1
index 30c28e4..c94d102 100644
@@ -39,7 +39,7 @@ DEPDIRS-mempool := bus
 DIRS-y += net
 DEPDIRS-net := bus pmdinfogen mempool
 DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto
-DEPDIRS-crypto := mempool
+DEPDIRS-crypto := bus mempool
 DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event
 DEPDIRS-event := bus pmdinfogen
 
Signature · 1 line
2.1.4
#58 lore raw
In reply to Gaetan Rivet

Hi Gaetan,

Do you (or anyone else) have plan to move vdev bus into drivers/bus/.

Thanks,
Jianfeng

Quoted 157 lines · Gaetan Rivet

This patchset moves the PCI bus out of the EAL to the drivers/bus subdirectory.

Almost all dependencies have been worked out, only remains KNI to be made fully independent from the PCI bus in its lib section.

This patchset includes a patch disabling it, that should be removed before integration, once all dependencies have been fixed.

The pmdinfogen app has been moved to the drivers subdirectory. This allows using the dependency syntax from the build system, as this app also depends on the PCI bus. The dependency graph is as follows:

drivers/bus/pci
|
+ drivers/pmdinfogen
|
+ drivers/net

The compilation has been tested on debian 8, Redhat 7.2 and FreeBSD 10.3

This patchset depends on:

eal: complete attach / detach support
http://dpdk.org/ml/archives/dev/2017-June/067057.html
http://dpdk.org/dev/patchwork/patch/24969/

v1 -> v2:

This patchet now depends also on the eventdev PCI dependency fix:

[PATCH v2 0/4] Remove PCI and VDEV dependency from eventdev library
http://dpdk.org/ml/archives/dev/2017-June/067402.html
http://dpdk.org/dev/patchwork/patch/25092/

* Fixes a few PCI dependency left
* While wholes files are moved, fixed a few checkpatch warnings to start anew.
* Updated eventdev and cryptodev build dependencies

People who want to evaluate / test the whole system can clone:
https://github.com/grivet/dpdk/tree/master-net

v3:

Further checkpatch fixes have been applied upon the new bus.
Both cryptodev and pdump have been fixed. The patches disabling them have been removed.
This patchset now depends on both the cryptodev and pdump dependency fixes:

[dpdk-dev] [PATCH 00/12] Remove cryptodev driver
http://dpdk.org/ml/archives/dev/2017-May/066382.html

[dpdk-dev] [PATCH] pdump: remove unnecessary header file
http://dpdk.org/ml/archives/dev/2017-June/067785.html

My tree has been updated to follow the latest state of the patchsets currently live on the ML:
https://github.com/grivet/dpdk/tree/master-net

Gaetan Rivet (9):
kni: disabled by default
eal: expose rte_eal_using_phys_addrs
ethdev: remove useless PCI dependency
bus: properly include rte_debug
pmdinfogen: move to drivers subdirectory
bus/pci: introduce pci bus
bus/pci: follow checkpatch
drivers: update eventdev dependencies
drivers: update cryptodev dependencies

  GNUmakefile                                     |   2 +-
  MAINTAINERS                                     |   2 +-
  buildtools/Makefile                             |  36 --
  buildtools/pmdinfogen/Makefile                  |  47 --
  buildtools/pmdinfogen/pmdinfogen.c              | 422 --------------
  buildtools/pmdinfogen/pmdinfogen.h              | 125 ----
  config/common_base                              |  10 +
  config/common_linuxapp                          |   2 +-
  drivers/Makefile                                |   7 +-
  drivers/bus/Makefile                            |   2 +
  drivers/bus/pci/Makefile                        |  60 ++
  drivers/bus/pci/bsd/Makefile                    |  32 ++
  drivers/bus/pci/bsd/rte_bus_pci_version.map     |  21 +
  drivers/bus/pci/bsd/rte_pci.c                   | 671 ++++++++++++++++++++++
  drivers/bus/pci/include/rte_pci.h               | 656 +++++++++++++++++++++
  drivers/bus/pci/linux/Makefile                  |  37 ++
  drivers/bus/pci/linux/rte_bus_pci_version.map   |  21 +
  drivers/bus/pci/linux/rte_pci.c                 | 722 +++++++++++++++++++++++
  drivers/bus/pci/linux/rte_pci_init.h            |  97 ++++
  drivers/bus/pci/linux/rte_pci_uio.c             | 571 +++++++++++++++++++
  drivers/bus/pci/linux/rte_pci_vfio.c            | 684 ++++++++++++++++++++++
  drivers/bus/pci/linux/rte_vfio_mp_sync.c        | 424 ++++++++++++++
  drivers/bus/pci/private.h                       | 169 ++++++
  drivers/bus/pci/rte_pci_common.c                | 601 ++++++++++++++++++++
  drivers/bus/pci/rte_pci_common_uio.c            | 234 ++++++++
  drivers/pmdinfogen/Makefile                     |  47 ++
  drivers/pmdinfogen/pmdinfogen.c                 | 422 ++++++++++++++
  drivers/pmdinfogen/pmdinfogen.h                 | 125 ++++
  lib/librte_eal/bsdapp/eal/Makefile              |   3 -
  lib/librte_eal/bsdapp/eal/eal.c                 |   1 -
  lib/librte_eal/bsdapp/eal/eal_pci.c             | 672 ----------------------
  lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  15 -
  lib/librte_eal/common/Makefile                  |   2 +-
  lib/librte_eal/common/eal_common_bus.c          |   1 +
  lib/librte_eal/common/eal_common_pci.c          | 603 --------------------
  lib/librte_eal/common/eal_common_pci_uio.c      | 233 --------
  lib/librte_eal/common/eal_private.h             | 138 -----
  lib/librte_eal/common/include/rte_pci.h         | 601 --------------------
  lib/librte_eal/linuxapp/eal/Makefile            |  12 +-
  lib/librte_eal/linuxapp/eal/eal.c               |   1 -
  lib/librte_eal/linuxapp/eal/eal_interrupts.c    |   1 -
  lib/librte_eal/linuxapp/eal/eal_memory.c        |   3 +-
  lib/librte_eal/linuxapp/eal/eal_pci.c           | 723 ------------------------
  lib/librte_eal/linuxapp/eal/eal_pci_init.h      |  97 ----
  lib/librte_eal/linuxapp/eal/eal_pci_uio.c       | 567 -------------------
  lib/librte_eal/linuxapp/eal/eal_pci_vfio.c      | 674 ----------------------
  lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c  | 424 --------------
  lib/librte_eal/linuxapp/eal/rte_eal_version.map |  16 +-
  lib/librte_eal/linuxapp/eal/rte_memory_linux.h  |  64 +++
  lib/librte_ether/rte_ethdev.c                   |   1 -
  mk/rte.app.mk                                   |   2 +
  51 files changed, 5687 insertions(+), 5416 deletions(-)

delete mode 100644 buildtools/Makefile
delete mode 100644 buildtools/pmdinfogen/Makefile delete mode 100644 buildtools/pmdinfogen/pmdinfogen.c delete mode 100644 buildtools/pmdinfogen/pmdinfogen.h create mode 100644 drivers/bus/pci/Makefile
create mode 100644 drivers/bus/pci/bsd/Makefile
create mode 100644 drivers/bus/pci/bsd/rte_bus_pci_version.map create mode 100644 drivers/bus/pci/bsd/rte_pci.c create mode 100644 drivers/bus/pci/include/rte_pci.h create mode 100644 drivers/bus/pci/linux/Makefile create mode 100644 drivers/bus/pci/linux/rte_bus_pci_version.map create mode 100644 drivers/bus/pci/linux/rte_pci.c create mode 100644 drivers/bus/pci/linux/rte_pci_init.h create mode 100644 drivers/bus/pci/linux/rte_pci_uio.c create mode 100644 drivers/bus/pci/linux/rte_pci_vfio.c create mode 100644 drivers/bus/pci/linux/rte_vfio_mp_sync.c create mode 100644 drivers/bus/pci/private.h
create mode 100644 drivers/bus/pci/rte_pci_common.c create mode 100644 drivers/bus/pci/rte_pci_common_uio.c create mode 100644 drivers/pmdinfogen/Makefile
create mode 100644 drivers/pmdinfogen/pmdinfogen.c create mode 100644 drivers/pmdinfogen/pmdinfogen.h delete mode 100644 lib/librte_eal/bsdapp/eal/eal_pci.c delete mode 100644 lib/librte_eal/common/eal_common_pci.c delete mode 100644 lib/librte_eal/common/eal_common_pci_uio.c delete mode 100644 lib/librte_eal/common/include/rte_pci.h delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci.c delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_init.h delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_uio.c delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c delete mode 100644 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h

#59 lore raw

Hi Jianfeng,

Quoted 4 lines · Jianfeng

Hi Gaetan,

Do you (or anyone else) have plan to move vdev bus into drivers/bus/.

It is in the roadmap for the DPDK, but I haven't planned to do it.

Quoted 162 lines

Thanks,
Jianfeng

Quoted 157 lines · Gaetan Rivet

This patchset moves the PCI bus out of the EAL to the drivers/bus subdirectory.

Almost all dependencies have been worked out, only remains KNI to be made fully independent from the PCI bus in its lib section.

This patchset includes a patch disabling it, that should be removed before integration, once all dependencies have been fixed.

The pmdinfogen app has been moved to the drivers subdirectory. This allows using the dependency syntax from the build system, as this app also depends on the PCI bus. The dependency graph is as follows:

drivers/bus/pci
|
+ drivers/pmdinfogen
|
+ drivers/net

The compilation has been tested on debian 8, Redhat 7.2 and FreeBSD 10.3

This patchset depends on:

eal: complete attach / detach support
http://dpdk.org/ml/archives/dev/2017-June/067057.html
http://dpdk.org/dev/patchwork/patch/24969/

v1 -> v2:

This patchet now depends also on the eventdev PCI dependency fix:

[PATCH v2 0/4] Remove PCI and VDEV dependency from eventdev library
http://dpdk.org/ml/archives/dev/2017-June/067402.html
http://dpdk.org/dev/patchwork/patch/25092/

* Fixes a few PCI dependency left
* While wholes files are moved, fixed a few checkpatch warnings to start anew.
* Updated eventdev and cryptodev build dependencies

People who want to evaluate / test the whole system can clone:
https://github.com/grivet/dpdk/tree/master-net

v3:

Further checkpatch fixes have been applied upon the new bus.
Both cryptodev and pdump have been fixed. The patches disabling them have been removed.
This patchset now depends on both the cryptodev and pdump dependency fixes:

[dpdk-dev] [PATCH 00/12] Remove cryptodev driver
http://dpdk.org/ml/archives/dev/2017-May/066382.html

[dpdk-dev] [PATCH] pdump: remove unnecessary header file
http://dpdk.org/ml/archives/dev/2017-June/067785.html

My tree has been updated to follow the latest state of the patchsets currently live on the ML:
https://github.com/grivet/dpdk/tree/master-net

Gaetan Rivet (9):
kni: disabled by default
eal: expose rte_eal_using_phys_addrs
ethdev: remove useless PCI dependency
bus: properly include rte_debug
pmdinfogen: move to drivers subdirectory
bus/pci: introduce pci bus
bus/pci: follow checkpatch
drivers: update eventdev dependencies
drivers: update cryptodev dependencies

 GNUmakefile                                     |   2 +-
 MAINTAINERS                                     |   2 +-
 buildtools/Makefile                             |  36 --
 buildtools/pmdinfogen/Makefile                  |  47 --
 buildtools/pmdinfogen/pmdinfogen.c              | 422 --------------
 buildtools/pmdinfogen/pmdinfogen.h              | 125 ----
 config/common_base                              |  10 +
 config/common_linuxapp                          |   2 +-
 drivers/Makefile                                |   7 +-
 drivers/bus/Makefile                            |   2 +
 drivers/bus/pci/Makefile                        |  60 ++
 drivers/bus/pci/bsd/Makefile                    |  32 ++
 drivers/bus/pci/bsd/rte_bus_pci_version.map     |  21 +
 drivers/bus/pci/bsd/rte_pci.c                   | 671 ++++++++++++++++++++++
 drivers/bus/pci/include/rte_pci.h               | 656 +++++++++++++++++++++
 drivers/bus/pci/linux/Makefile                  |  37 ++
 drivers/bus/pci/linux/rte_bus_pci_version.map   |  21 +
 drivers/bus/pci/linux/rte_pci.c                 | 722 +++++++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_init.h            |  97 ++++
 drivers/bus/pci/linux/rte_pci_uio.c             | 571 +++++++++++++++++++
 drivers/bus/pci/linux/rte_pci_vfio.c            | 684 ++++++++++++++++++++++
 drivers/bus/pci/linux/rte_vfio_mp_sync.c        | 424 ++++++++++++++
 drivers/bus/pci/private.h                       | 169 ++++++
 drivers/bus/pci/rte_pci_common.c                | 601 ++++++++++++++++++++
 drivers/bus/pci/rte_pci_common_uio.c            | 234 ++++++++
 drivers/pmdinfogen/Makefile                     |  47 ++
 drivers/pmdinfogen/pmdinfogen.c                 | 422 ++++++++++++++
 drivers/pmdinfogen/pmdinfogen.h                 | 125 ++++
 lib/librte_eal/bsdapp/eal/Makefile              |   3 -
 lib/librte_eal/bsdapp/eal/eal.c                 |   1 -
 lib/librte_eal/bsdapp/eal/eal_pci.c             | 672 ----------------------
 lib/librte_eal/bsdapp/eal/rte_eal_version.map   |  15 -
 lib/librte_eal/common/Makefile                  |   2 +-
 lib/librte_eal/common/eal_common_bus.c          |   1 +
 lib/librte_eal/common/eal_common_pci.c          | 603 --------------------
 lib/librte_eal/common/eal_common_pci_uio.c      | 233 --------
 lib/librte_eal/common/eal_private.h             | 138 -----
 lib/librte_eal/common/include/rte_pci.h         | 601 --------------------
 lib/librte_eal/linuxapp/eal/Makefile            |  12 +-
 lib/librte_eal/linuxapp/eal/eal.c               |   1 -
 lib/librte_eal/linuxapp/eal/eal_interrupts.c    |   1 -
 lib/librte_eal/linuxapp/eal/eal_memory.c        |   3 +-
 lib/librte_eal/linuxapp/eal/eal_pci.c           | 723 ------------------------
 lib/librte_eal/linuxapp/eal/eal_pci_init.h      |  97 ----
 lib/librte_eal/linuxapp/eal/eal_pci_uio.c       | 567 -------------------
 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c      | 674 ----------------------
 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c  | 424 --------------
 lib/librte_eal/linuxapp/eal/rte_eal_version.map |  16 +-
 lib/librte_eal/linuxapp/eal/rte_memory_linux.h  |  64 +++
 lib/librte_ether/rte_ethdev.c                   |   1 -
 mk/rte.app.mk                                   |   2 +
 51 files changed, 5687 insertions(+), 5416 deletions(-)
 delete mode 100644 buildtools/Makefile
 delete mode 100644 buildtools/pmdinfogen/Makefile
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.c
 delete mode 100644 buildtools/pmdinfogen/pmdinfogen.h
 create mode 100644 drivers/bus/pci/Makefile
 create mode 100644 drivers/bus/pci/bsd/Makefile
 create mode 100644 drivers/bus/pci/bsd/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/bsd/rte_pci.c
 create mode 100644 drivers/bus/pci/include/rte_pci.h
 create mode 100644 drivers/bus/pci/linux/Makefile
 create mode 100644 drivers/bus/pci/linux/rte_bus_pci_version.map
 create mode 100644 drivers/bus/pci/linux/rte_pci.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_init.h
 create mode 100644 drivers/bus/pci/linux/rte_pci_uio.c
 create mode 100644 drivers/bus/pci/linux/rte_pci_vfio.c
 create mode 100644 drivers/bus/pci/linux/rte_vfio_mp_sync.c
 create mode 100644 drivers/bus/pci/private.h
 create mode 100644 drivers/bus/pci/rte_pci_common.c
 create mode 100644 drivers/bus/pci/rte_pci_common_uio.c
 create mode 100644 drivers/pmdinfogen/Makefile
 create mode 100644 drivers/pmdinfogen/pmdinfogen.c
 create mode 100644 drivers/pmdinfogen/pmdinfogen.h
 delete mode 100644 lib/librte_eal/bsdapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci.c
 delete mode 100644 lib/librte_eal/common/eal_common_pci_uio.c
 delete mode 100644 lib/librte_eal/common/include/rte_pci.h
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_init.h
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_uio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_pci_vfio.c
 delete mode 100644 lib/librte_eal/linuxapp/eal/eal_vfio_mp_sync.c
 create mode 100644 lib/librte_eal/linuxapp/eal/rte_memory_linux.h
Signature · 2 lines
Gaëtan Rivet
6WIND
#60 lore raw

23/06/2017 10:19, Gaëtan Rivet:

Quoted 8 lines

Hi Jianfeng,

Quoted 3 lines · Jianfeng

Hi Gaetan,

Do you (or anyone else) have plan to move vdev bus into drivers/bus/.

It is in the roadmap for the DPDK, but I haven't planned to do it.

We need to move vdev in drivers/bus/ to complete the bus rework.

Any volunteer?

#61 lore raw

Hi Thomas & Gaetan,

Quoted 12 lines · Thomas Monjalon

23/06/2017 10:19, Gaëtan Rivet:

Quoted 7 lines

Hi Jianfeng,

Quoted 3 lines · Jianfeng

Hi Gaetan,

Do you (or anyone else) have plan to move vdev bus into drivers/bus/.

It is in the roadmap for the DPDK, but I haven't planned to do it.

We need to move vdev in drivers/bus/ to complete the bus rework.

Any volunteer?

Actually I have a version when I'm trying to support vdev in primary/secondary mode. I would love to send it out for review.

Thanks,
Jianfeng

#62 lore raw

23/06/2017 16:35, Tan, Jianfeng:

Quoted 11 lines

Hi Thomas & Gaetan,

Quoted 7 lines · Thomas Monjalon

23/06/2017 10:19, Gaëtan Rivet:

Quoted 6 lines

Hi Jianfeng,

Quoted 3 lines · Jianfeng

Hi Gaetan,

Do you (or anyone else) have plan to move vdev bus into drivers/bus/.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

It is in the roadmap for the DPDK, but I haven't planned to do it.

We need to move vdev in drivers/bus/ to complete the bus rework.

Any volunteer?

Actually I have a version when I'm trying to support vdev in primary/secondary mode. I would love to send it out for review.

Please do.