Commit ebcd659c authored by Tomasz Zawadzki's avatar Tomasz Zawadzki
Browse files

lib/env_dpdk: apply DPDK 23.11 changes to PCI headers



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

- Added rte_pci_pasid_set_state()
- Promoted some functions from experimental to stable

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKamil Godzwon <kamilx.godzwon@intel.com>
Reviewed-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: default avatarBen Walker <ben@nvidia.com>
parent cfe8449e
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -68,16 +68,33 @@
 
 /**
  * Enables/Disables Bus Master for device's PCI command register.
@@ -153,7 +99,7 @@ off_t rte_pci_find_ext_capability(const struct rte_pci_device *dev, uint32_t cap
@@ -153,24 +99,7 @@ off_t rte_pci_find_ext_capability(const struct rte_pci_device *dev, uint32_t cap
  *  0 on success, -1 on error in PCI config space read/write.
  */
 __rte_experimental
-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);
+int rte_pci_set_bus_master(struct rte_pci_device *dev, bool enable);
 
 /**
  * Read PCI config space.
@@ -189,54 +135,6 @@ int rte_pci_read_config(const struct rte_pci_device *device,
@@ -206,54 +135,6 @@ int rte_pci_read_config(const struct rte_pci_device *device,
 int rte_pci_write_config(const struct rte_pci_device *device,
 		const void *buf, size_t len, off_t offset);
 
+150 −1
Original line number Diff line number Diff line
@@ -42,6 +42,19 @@
@@ -21,6 +21,7 @@ extern "C" {

 #include <rte_config.h>
 #include <rte_common.h>
+#include <rte_compat.h>
 #include <rte_log.h>

 struct rte_bus;
@@ -41,6 +42,19 @@ typedef void (*rte_dev_event_cb_fn)(const char *device_name,
 					enum rte_dev_event_type event,
 					void *cb_arg);
 
@@ -18,3 +26,144 @@
 /**
  * Device policies.
  */
@@ -340,6 +354,7 @@ typedef void *(*rte_dev_iterate_t)(const void *start,
  *   0 on successful initialization.
  *   <0 on error.
  */
+__rte_experimental
 int
 rte_dev_iterator_init(struct rte_dev_iterator *it, const char *str);

@@ -359,6 +374,7 @@ rte_dev_iterator_init(struct rte_dev_iterator *it, const char *str);
  *   NULL if an error occurred (rte_errno is set).
  *   NULL if no device could be found (rte_errno is not set).
  */
+__rte_experimental
 struct rte_device *
 rte_dev_iterator_next(struct rte_dev_iterator *it);

@@ -369,6 +385,9 @@ rte_dev_iterator_next(struct rte_dev_iterator *it);
	     dev = rte_dev_iterator_next(it))

 /**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
  * It registers the callback for the specific device.
  * Multiple callbacks can be registered at the same time.
  *
@@ -384,12 +403,16 @@ rte_dev_iterator_next(struct rte_dev_iterator *it);
  *  - On success, zero.
  *  - On failure, a negative value.
  */
+__rte_experimental
 int
 rte_dev_event_callback_register(const char *device_name,
				rte_dev_event_cb_fn cb_fn,
				void *cb_arg);

 /**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
  * It unregisters the callback according to the specified device.
  *
  * @param device_name
@@ -405,12 +428,16 @@ rte_dev_event_callback_register(const char *device_name,
  *  - On success, return the number of callback entities removed.
  *  - On failure, a negative value.
  */
+__rte_experimental
 int
 rte_dev_event_callback_unregister(const char *device_name,
				  rte_dev_event_cb_fn cb_fn,
				  void *cb_arg);

 /**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
  * Executes all the user application registered callbacks for
  * the specific device.
  *
@@ -419,47 +446,64 @@ rte_dev_event_callback_unregister(const char *device_name,
  * @param event
  *  the device event type.
  */
+__rte_experimental
 void
 rte_dev_event_callback_process(const char *device_name,
			       enum rte_dev_event_type event);

 /**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
  * Start the device event monitoring.
  *
  * @return
  *   - On success, zero.
  *   - On failure, a negative value.
  */
+__rte_experimental
 int
 rte_dev_event_monitor_start(void);

 /**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
  * Stop the device event monitoring.
  *
  * @return
  *   - On success, zero.
  *   - On failure, a negative value.
  */
+__rte_experimental
 int
 rte_dev_event_monitor_stop(void);

 /**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
  * Enable hotplug handling for devices.
  *
  * @return
  *   - On success, zero.
  *   - On failure, a negative value.
  */
+__rte_experimental
 int
 rte_dev_hotplug_handle_enable(void);

 /**
+ * @warning
+ * @b EXPERIMENTAL: this API may change without prior notice
+ *
  * Disable hotplug handling for devices.
  *
  * @return
  *   - On success, zero.
  *   - On failure, a negative value.
  */
+__rte_experimental
 int
 rte_dev_hotplug_handle_disable(void);

@@ -483,6 +527,7 @@ rte_dev_hotplug_handle_disable(void);
  *	0 if mapping was successful.
  *	Negative value and rte_errno is set otherwise.
  */
+__rte_experimental
 int
 rte_dev_dma_map(struct rte_device *dev, void *addr, uint64_t iova, size_t len);

@@ -506,6 +551,7 @@ rte_dev_dma_map(struct rte_device *dev, void *addr, uint64_t iova, size_t len);
  *	0 if un-mapping was successful.
  *	Negative value and rte_errno is set otherwise.
  */
+__rte_experimental
 int
 rte_dev_dma_unmap(struct rte_device *dev, void *addr, uint64_t iova,
		  size_t len);