Commit d1d64d44 authored by Tomasz Zawadzki's avatar Tomasz Zawadzki Committed by Tomasz Zawadzki
Browse files

lib/env_dpdk: apply DPDK 25.07 changes to PCI headers



Changes introduced in DPDK 25.07 are not affecting SPDK,
so just revert those changes for the test.

Change-Id: I90babb0dc6b65ffe99ef66d97401143d7c3708a0
Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@nutanix.com>
Reviewed-on: https://review.spdk.io/c/spdk/spdk/+/26638


Reviewed-by: default avatarJim Harris <jim.harris@nvidia.com>
Tested-by: default avatarSPDK Automated Test System <spdkbot@gmail.com>
Reviewed-by: default avatarKonrad Sztyber <ksztyber@nvidia.com>
parent 789d910c
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -5,16 +5,16 @@
 #ifndef BUS_DRIVER_H
 #define BUS_DRIVER_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "rte_bus.h"
-#include <rte_bus.h>
 #include <rte_compat.h>
+#include "rte_dev.h"
-#include <rte_dev.h>
 #include <rte_eal.h>
 #include <rte_tailq.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct rte_devargs;
 struct rte_device;
 
+28 −0
Original line number Diff line number Diff line
@@ -6,14 +6,14 @@
 #ifndef BUS_PCI_DRIVER_H
 #define BUS_PCI_DRIVER_H
 
-#include <rte_bus_pci.h>
-#include <dev_driver.h>
-#include <rte_compat.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+#include "rte_bus_pci.h"
+#include "dev_driver.h"
+#include <rte_compat.h>
+
 /** Pathname of PCI devices directory. */
 __rte_internal
 const char *rte_pci_get_sysfs_path(void);
@@ -171,7 +171,7 @@
 	(pci_drv).driver.name = RTE_STR(nm);\
 	rte_pci_register(&pci_drv); \
 } \
+RTE_PMD_EXPORT_NAME(nm, __COUNTER__)
-RTE_PMD_EXPORT_NAME(nm)
 
 /**
  * Unregister a PCI driver.
+64 −0
Original line number Diff line number Diff line
@@ -5,8 +5,12 @@
 #ifndef DEV_DRIVER_H
 #define DEV_DRIVER_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <rte_common.h>
+#include "rte_dev.h"
-#include <rte_dev.h>
 
 /**
  * A structure describing a device driver.
@@ -30,47 +34,8 @@
 	struct rte_devargs *devargs;  /**< Arguments for latest probing */
 };
 
+#ifdef __cplusplus
+}
-#ifdef RTE_TOOLCHAIN_MSVC
-#define RTE_PMD_EXPORT_SYMBOL(type, name) \
-__pragma(comment(linker, "/include:" RTE_STR(name))) type name
-#else
-#define RTE_PMD_EXPORT_SYMBOL(type, name) \
-__attribute__((used)) type name
 #endif
 
-#define RTE_PMD_EXPORT_NAME(name) \
-RTE_PMD_EXPORT_SYMBOL(const char, this_pmd_name ## name)[] = RTE_STR(name)
-
-#define DRV_EXP_TAG(name, tag) __##name##_##tag
-
-#define RTE_PMD_REGISTER_PCI_TABLE(name, table) \
-RTE_PMD_EXPORT_SYMBOL(const char, DRV_EXP_TAG(name, pci_tbl_export))[] = RTE_STR(table)
-
-#define RTE_PMD_REGISTER_PARAM_STRING(name, str) \
-RTE_PMD_EXPORT_SYMBOL(const char, DRV_EXP_TAG(name, param_string_export))[] = str
-
-/**
- * Advertise the list of kernel modules required to run this driver
- *
- * This string lists the kernel modules required for the devices
- * associated to a PMD. The format of each line of the string is:
- * "<device-pattern> <kmod-expression>".
- *
- * The possible formats for the device pattern are:
- *   "*"                     all devices supported by this driver
- *   "pci:*"                 all PCI devices supported by this driver
- *   "pci:v8086:d*:sv*:sd*"  all PCI devices supported by this driver
- *                           whose vendor id is 0x8086.
- *
- * The format of the kernel modules list is a parenthesized expression
- * containing logical-and (&) and logical-or (|).
- *
- * The device pattern and the kmod expression are separated by a space.
- *
- * Example:
- * - "* igb_uio | uio_pci_generic | vfio"
- */
-#define RTE_PMD_REGISTER_KMOD_DEP(name, str) \
-RTE_PMD_EXPORT_SYMBOL(const char, DRV_EXP_TAG(name, kmod_dep_export))[] = str
-
 #endif /* DEV_DRIVER_H */
+19 −0
Original line number Diff line number Diff line
@@ -14,14 +14,14 @@
  * over the devices and drivers in EAL.
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdio.h>
 
 #include <rte_eal.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 struct rte_bus;
 struct rte_device;
 
+173 −0
Original line number Diff line number Diff line
@@ -11,6 +11,10 @@
  * PCI device & driver interface
  */
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <limits.h>
@@ -23,10 +27,6 @@
 #include <rte_interrupts.h>
 #include <rte_pci.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* Forward declarations */
 struct rte_pci_device;
 struct rte_pci_driver;
@@ -69,60 +69,6 @@
 void rte_pci_dump(FILE *f);
 
 /**
- * Check whether this device has a PCI capability list.
- *
- *  @param dev
- *    A pointer to rte_pci_device structure.
- *
- *  @return
- *    true/false
- */
-__rte_experimental
-bool rte_pci_has_capability_list(const struct rte_pci_device *dev);
-
-/**
- * Find device's PCI capability.
- *
- *  @param dev
- *    A pointer to rte_pci_device structure.
- *
- *  @param cap
- *    Capability to be found, which can be any from
- *    RTE_PCI_CAP_ID_*, defined in librte_pci.
- *
- *  @return
- *  > 0: The offset of the next matching capability structure
- *       within the device's PCI configuration space.
- *  < 0: An error in PCI config space read.
- *  = 0: Device does not support it.
- */
-__rte_experimental
-off_t rte_pci_find_capability(const struct rte_pci_device *dev, uint8_t cap);
-
-/**
- * Find device's PCI capability starting from a previous offset in PCI
- * configuration space.
- *
- *  @param dev
- *    A pointer to rte_pci_device structure.
- *
- *  @param cap
- *    Capability to be found, which can be any from
- *    RTE_PCI_CAP_ID_*, defined in librte_pci.
- *  @param offset
- *    An offset in the PCI configuration space from which the capability is
- *    looked for.
- *
- *  @return
- *  > 0: The offset of the next matching capability structure
- *       within the device's PCI configuration space.
- *  < 0: An error in PCI config space read.
- *  = 0: Device does not support it.
- */
-__rte_experimental
-off_t rte_pci_find_next_capability(const struct rte_pci_device *dev, uint8_t cap, off_t offset);
-
-/**
  * Find device's extended PCI capability.
  *
  *  @param dev
@@ -139,7 +85,7 @@
  *  = 0: Device does not support it.
  */
 __rte_experimental
+off_t rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t cap);
-off_t rte_pci_find_ext_capability(const struct rte_pci_device *dev, uint32_t cap);
 
 /**
  * Enables/Disables Bus Master for device's PCI command register.
@@ -153,24 +99,7 @@
  *  0 on success, -1 on error in PCI config space read/write.
  */
 __rte_experimental
+int rte_pci_set_bus_master(struct rte_pci_device *dev, bool enable);
-int rte_pci_set_bus_master(const struct rte_pci_device *dev, bool enable);
-
-/**
- * Enable/Disable PASID (Process Address Space ID).
- *
- * @param dev
- *   A pointer to a rte_pci_device structure.
- * @param offset
- *   Offset of the PASID external capability structure.
- * @param enable
- *   Flag to enable or disable PASID.
- *
- * @return
- *   0 on success, -1 on error in PCI config space read/write.
- */
-__rte_internal
-int rte_pci_pasid_set_state(const struct rte_pci_device *dev,
-		off_t offset, bool enable);
 
 /**
  * Read PCI config space.
@@ -207,54 +136,6 @@
 		const void *buf, size_t len, off_t offset);
 
 /**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
- * Read from a MMIO PCI resource.
- *
- * @param device
- *   A pointer to a rte_pci_device structure describing the device
- *   to use.
- * @param bar
- *   Index of the IO PCI resource we want to access.
- * @param buf
- *   A data buffer where the bytes should be read into.
- * @param len
- *   The length of the data buffer.
- * @param offset
- *   The offset into MMIO space described by @bar.
- * @return
- *   Number of bytes read on success, negative on error.
- */
-__rte_experimental
-int rte_pci_mmio_read(const struct rte_pci_device *device, int bar,
-		void *buf, size_t len, off_t offset);
-
-/**
- * @warning
- * @b EXPERIMENTAL: this API may change without prior notice.
- *
- * Write to a MMIO PCI resource.
- *
- * @param device
- *   A pointer to a rte_pci_device structure describing the device
- *   to use.
- * @param bar
- *   Index of the IO PCI resource we want to access.
- * @param buf
- *   A data buffer containing the bytes should be written.
- * @param len
- *   The length of the data buffer.
- * @param offset
- *   The offset into MMIO space described by @bar.
- * @return
- *   Number of bytes written on success, negative on error.
- */
-__rte_experimental
-int rte_pci_mmio_write(const struct rte_pci_device *device, int bar,
-		const void *buf, size_t len, off_t offset);
-
-/**
  * Initialize a rte_pci_ioport object for a pci device io resource.
  *
  * This object is then used to gain access to those io resources (see below).
Loading