The ifpga bus interface is for drivers only.
Mark as internal and move the header in the driver headers list.
While at it, cleanup the code:
- remove unneeded list head structure type,
- reorder the definitions and macro manipulating the bus singleton object,
- remove inclusion of rte_bus.h and fix the code that relied on implicit
inclusion,
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
---
Changes since RFC v2:
- squashed cleanup for this bus code from other patches,
- updated release notes,
---
doc/guides/rel_notes/release_22_11.rst | 2 +-
.../{rte_bus_ifpga.h => bus_ifpga_driver.h} | 18 ++++++++----------
drivers/bus/ifpga/ifpga_bus.c | 6 +++---
drivers/bus/ifpga/ifpga_common.h | 2 +-
drivers/bus/ifpga/meson.build | 2 +-
drivers/bus/ifpga/version.map | 2 +-
drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +-
drivers/net/ipn3ke/ipn3ke_ethdev.h | 2 +-
drivers/net/ipn3ke/ipn3ke_flow.c | 2 +-
drivers/net/ipn3ke/ipn3ke_representor.c | 2 +-
drivers/net/ipn3ke/ipn3ke_tm.c | 2 +-
drivers/raw/ifpga/afu_pmd_core.h | 2 +-
drivers/raw/ifpga/afu_pmd_he_hssi.c | 2 +-
drivers/raw/ifpga/afu_pmd_he_lpbk.c | 2 +-
drivers/raw/ifpga/afu_pmd_he_mem.c | 2 +-
drivers/raw/ifpga/afu_pmd_n3000.c | 2 +-
drivers/raw/ifpga/ifpga_rawdev.c | 2 +-
17 files changed, 26 insertions(+), 28 deletions(-)
rename drivers/bus/ifpga/{rte_bus_ifpga.h => bus_ifpga_driver.h} (91%)
@@ -88,7 +88,7 @@ API Changes
in the future. Applications can use ``devtools/cocci/func_or_ret.cocci``
to update their code.
-* drivers: Registering a driver on the ``auxiliary``,
+* drivers: Registering a driver on the ``auxiliary``, ``ifpga``
buses has been marked as an internal API.
External users may still register their driver using the associated driver
headers (see ``enable_driver_sdk`` meson option).
similarity index 91%
rename from drivers/bus/ifpga/rte_bus_ifpga.h
rename to drivers/bus/ifpga/bus_ifpga_driver.h
@@ -2,8 +2,8 @@
* Copyright(c) 2010-2018 Intel Corporation
*/
-#ifndef _RTE_BUS_IFPGA_H_
-#define _RTE_BUS_IFPGA_H_
+#ifndef BUS_IFPGA_DRIVER_H
+#define BUS_IFPGA_DRIVER_H
/**
* @file
@@ -15,23 +15,17 @@
extern "C" {
#endif /* __cplusplus */
-#include <rte_bus.h>
+#include <rte_compat.h>
#include <rte_pci.h>
#include <rte_interrupts.h>
#include <rte_spinlock.h>
-/** Name of Intel FPGA Bus */
#define IFPGA_BUS_NAME ifpga
/* Forward declarations */
struct rte_afu_device;
struct rte_afu_driver;
-/** Double linked list of Intel FPGA AFU device. */
-RTE_TAILQ_HEAD(ifpga_afu_dev_list, rte_afu_device);
-/** Double linked list of Intel FPGA AFU device drivers. */
-RTE_TAILQ_HEAD(ifpga_afu_drv_list, rte_afu_driver);
-
#define IFPGA_BUS_BITSTREAM_PATH_MAX_LEN 256
struct rte_afu_uuid {
@@ -112,6 +106,7 @@ struct rte_afu_driver {
const struct rte_afu_uuid *id_table; /**< AFU uuid within FPGA. */
};
+__rte_internal
static inline const char *
rte_ifpga_device_name(const struct rte_afu_device *afu)
{
@@ -126,6 +121,7 @@ rte_ifpga_device_name(const struct rte_afu_device *afu)
* @param name
* A pointer to AFU name string.
*/
+__rte_internal
struct rte_afu_device *
rte_ifpga_find_afu_by_name(const char *name);
@@ -136,6 +132,7 @@ rte_ifpga_find_afu_by_name(const char *name);
* A pointer to a rte_afu_driver structure describing the driver
* to be registered.
*/
+__rte_internal
void rte_ifpga_driver_register(struct rte_afu_driver *driver);
/**
@@ -145,6 +142,7 @@ void rte_ifpga_driver_register(struct rte_afu_driver *driver);
* A pointer to a rte_afu_driver structure describing the driver
* to be unregistered.
*/
+__rte_internal
void rte_ifpga_driver_unregister(struct rte_afu_driver *driver);
#define RTE_PMD_REGISTER_AFU(nm, afudrv)\
@@ -164,4 +162,4 @@ static const char *afudrvinit_ ## nm ## _alias = RTE_STR(alias)
}
#endif /* __cplusplus */
-#endif /* _RTE_BUS_IFPGA_H_ */
+#endif /* BUS_IFPGA_DRIVER_H */
@@ -28,7 +28,7 @@
#include "rte_rawdev.h"
#include "rte_rawdev_pmd.h"
-#include "rte_bus_ifpga.h"
+#include "bus_ifpga_driver.h"
#include "ifpga_logs.h"
#include "ifpga_common.h"
@@ -37,9 +37,9 @@
*/
static struct rte_bus rte_ifpga_bus;
-static struct ifpga_afu_dev_list ifpga_afu_dev_list =
+static TAILQ_HEAD(, rte_afu_device) ifpga_afu_dev_list =
TAILQ_HEAD_INITIALIZER(ifpga_afu_dev_list);
-static struct ifpga_afu_drv_list ifpga_afu_drv_list =
+static TAILQ_HEAD(, rte_afu_driver) ifpga_afu_drv_list =
TAILQ_HEAD_INITIALIZER(ifpga_afu_drv_list);
@@ -9,7 +9,7 @@
#include <stdlib.h>
#include <string.h>
-#include <rte_bus_ifpga.h>
+#include <bus_ifpga_driver.h>
#include <rte_common.h>
static inline int
@@ -8,5 +8,5 @@ if is_windows
endif
deps += ['pci', 'kvargs', 'rawdev']
-headers = files('rte_bus_ifpga.h')
+driver_sdk_headers += files('bus_ifpga_driver.h')
sources = files('ifpga_bus.c')
@@ -1,4 +1,4 @@
-DPDK_23 {
+INTERNAL {
global:
rte_ifpga_driver_register;
@@ -16,7 +16,7 @@
#include <rte_io.h>
#include <rte_rawdev.h>
#include <rte_rawdev_pmd.h>
-#include <rte_bus_ifpga.h>
+#include <bus_ifpga_driver.h>
#include <ifpga_common.h>
#include <ifpga_logs.h>
#include <ifpga_rawdev.h>
@@ -24,7 +24,7 @@
#include <rte_spinlock.h>
#include <rte_cycles.h>
-#include <rte_bus_ifpga.h>
+#include <bus_ifpga_driver.h>
#include <rte_tm_driver.h>
#define IPN3KE_TM_SCRATCH_RW 0
@@ -20,7 +20,7 @@
#include <rte_tailq.h>
#include <rte_rawdev.h>
#include <rte_rawdev_pmd.h>
-#include <rte_bus_ifpga.h>
+#include <bus_ifpga_driver.h>
#include <ifpga_common.h>
#include <ifpga_logs.h>
#include <ifpga_rawdev.h>
@@ -18,7 +18,7 @@
#include <rte_io.h>
#include <rte_rawdev.h>
#include <rte_rawdev_pmd.h>
-#include <rte_bus_ifpga.h>
+#include <bus_ifpga_driver.h>
#include <ifpga_logs.h>
#include "ipn3ke_rawdev_api.h"
@@ -19,7 +19,7 @@
#include <rte_io.h>
#include <rte_rawdev.h>
#include <rte_rawdev_pmd.h>
-#include <rte_bus_ifpga.h>
+#include <bus_ifpga_driver.h>
#include <ifpga_logs.h>
#include "ipn3ke_rawdev_api.h"
@@ -15,7 +15,7 @@ extern "C" {
#include <rte_spinlock.h>
#include <rte_cycles.h>
-#include <rte_bus_ifpga.h>
+#include <bus_ifpga_driver.h>
#include <rte_rawdev.h>
#include "ifpga_rawdev.h"
@@ -19,7 +19,7 @@
#include <rte_io.h>
#include <rte_vfio.h>
#include <rte_bus_pci.h>
-#include <rte_bus_ifpga.h>
+#include <bus_ifpga_driver.h>
#include <rte_rawdev.h>
#include "afu_pmd_core.h"
@@ -19,7 +19,7 @@
#include <rte_io.h>
#include <rte_vfio.h>
#include <rte_bus_pci.h>
-#include <rte_bus_ifpga.h>
+#include <bus_ifpga_driver.h>
#include <rte_rawdev.h>
#include "afu_pmd_core.h"
@@ -18,7 +18,7 @@
#include <rte_io.h>
#include <rte_vfio.h>
#include <rte_bus_pci.h>
-#include <rte_bus_ifpga.h>
+#include <bus_ifpga_driver.h>
#include <rte_rawdev.h>
#include "afu_pmd_core.h"
@@ -19,7 +19,7 @@
#include <rte_io.h>
#include <rte_vfio.h>
#include <rte_bus_pci.h>
-#include <rte_bus_ifpga.h>
+#include <bus_ifpga_driver.h>
#include <rte_rawdev.h>
#include "afu_pmd_core.h"
@@ -35,7 +35,7 @@
#include "base/ifpga_api.h"
#include "rte_rawdev.h"
#include "rte_rawdev_pmd.h"
-#include "rte_bus_ifpga.h"
+#include "bus_ifpga_driver.h"
#include "ifpga_common.h"
#include "ifpga_logs.h"
#include "ifpga_rawdev.h"