Commit 396e6fac authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

lib/env_dpdk: update PCI headers for DPDK 23.07



The header copies are placed in directory named
after first release where a breaking change was introduced.
DPDK 22.11 introduced a breaking change and as such new
copies were created.
Since then, DPDK 23.07 is the first version where API is changed.
This time around it does not affect backwards compatibility,
as new functions were added. Headers from DPDK 22.11 will still
work for DPDK 23.07 and prior versions, so long as the new functions
are not used.

To avoid unnecessarily creating another copy of headers and implementation,
for DPDK 23.07, the DPDK 22.11 remained as they were.

If rte_pci_mmio_read/write() are to be used in future,
simply a new copy and implementation should be created.
To catch the case of someone unaware of this versioning,
starts to use this API an redefinition of those functions were
added.

For purposes of test verifying the DPDK PCI headers,
a patch removing those functions was added.
This way DPDK 23.07 and later will match current
header copies.

Change-Id: I5d3813eced7f15d6dc4d7b8654f256ae1eebcd32
Signed-off-by: default avatarTomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19333


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarSebastian Brzezinka <sebastian.brzezinka@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent 11694e8d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -59,12 +59,13 @@ dpdk_pci_init(void)
		}
		g_dpdk_fn_table = &fn_table_2211;
	} else if (year == 23) {
		/* Only 23.03.0 is supported */
		if (month != 3 || minor != 0) {
		/* Only 23.07.0 and 23.03.0 is supported */
		if ((month != 7 || minor != 0) &&
		    (month != 3 || minor != 0)) {
			SPDK_ERRLOG("DPDK version 23.%02d.%d is not supported.\n", month, minor);
			return -EINVAL;
		}
		/* There were no changes between 22.11 and 23.03, so use the 22.11 implementation */
		/* There were no changes between 22.11 and 23.07, so use the 22.11 implementation */
		g_dpdk_fn_table = &fn_table_2211;
	} else {
		/* Everything else we use the 22.07 implementation. */
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,12 @@ SPDK_STATIC_ASSERT(offsetof(struct spdk_pci_driver, driver_buf) == 0, "driver_bu
SPDK_STATIC_ASSERT(offsetof(struct spdk_pci_driver, driver) >= sizeof(struct rte_pci_driver),
		   "driver_buf not big enough");

/* Following API was added in versions later than DPDK 22.11.
 * It is unused right now, if this changes a new pci_dpdk_* should be added.
 */
#define rte_pci_mmio_read(...) SPDK_STATIC_ASSERT(false, "rte_pci_mmio_read requires new pci_dpdk_2307 compat layer")
#define rte_pci_mmio_write(...) SPDK_STATIC_ASSERT(false, "rte_pci_mmio_write requires new pci_dpdk_2307 compat layer")

static struct rte_mem_resource *
pci_device_get_mem_resource_2211(struct rte_pci_device *dev, uint32_t bar)
{
+55 −0
Original line number Diff line number Diff line
@@ -136,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).