bus/auxiliary: make driver-only headers private
The auxiliary bus interface is for drivers only. Mark as internal and move the header in the driver headers list. While at it, cleanup the code: - fix indentation, - remove unneeded reference to bus specific singleton object, - 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>
This commit is contained in:
parent
ada7338954
commit
b3f89090d6
@ -88,6 +88,11 @@ 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``,
|
||||
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).
|
||||
|
||||
* raw/ifgpa: The function ``rte_pmd_ifpga_get_pci_bus`` has been removed.
|
||||
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include <rte_devargs.h>
|
||||
|
||||
#include "private.h"
|
||||
#include "rte_bus_auxiliary.h"
|
||||
|
||||
static struct rte_devargs *
|
||||
auxiliary_devargs_lookup(const char *name)
|
||||
@ -259,7 +258,6 @@ void
|
||||
rte_auxiliary_register(struct rte_auxiliary_driver *driver)
|
||||
{
|
||||
TAILQ_INSERT_TAIL(&auxiliary_bus.driver_list, driver, next);
|
||||
driver->bus = &auxiliary_bus;
|
||||
}
|
||||
|
||||
/* Unregister a driver */
|
||||
@ -267,7 +265,6 @@ void
|
||||
rte_auxiliary_unregister(struct rte_auxiliary_driver *driver)
|
||||
{
|
||||
TAILQ_REMOVE(&auxiliary_bus.driver_list, driver, next);
|
||||
driver->bus = NULL;
|
||||
}
|
||||
|
||||
/* Add a device to auxiliary bus */
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include <rte_kvargs.h>
|
||||
|
||||
#include "private.h"
|
||||
#include "rte_bus_auxiliary.h"
|
||||
|
||||
enum auxiliary_params {
|
||||
RTE_AUXILIARY_PARAM_NAME,
|
||||
|
@ -2,8 +2,8 @@
|
||||
* Copyright (c) 2021 NVIDIA Corporation & Affiliates
|
||||
*/
|
||||
|
||||
#ifndef RTE_BUS_AUXILIARY_H
|
||||
#define RTE_BUS_AUXILIARY_H
|
||||
#ifndef BUS_AUXILIARY_DRIVER_H
|
||||
#define BUS_AUXILIARY_DRIVER_H
|
||||
|
||||
/**
|
||||
* @file
|
||||
@ -22,17 +22,16 @@ extern "C" {
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <rte_compat.h>
|
||||
#include <rte_debug.h>
|
||||
#include <rte_interrupts.h>
|
||||
#include <rte_dev.h>
|
||||
#include <rte_bus.h>
|
||||
#include <rte_kvargs.h>
|
||||
|
||||
#define RTE_BUS_AUXILIARY_NAME "auxiliary"
|
||||
|
||||
/* Forward declarations */
|
||||
struct rte_auxiliary_driver;
|
||||
struct rte_auxiliary_bus;
|
||||
struct rte_auxiliary_device;
|
||||
|
||||
/**
|
||||
@ -43,7 +42,7 @@ struct rte_auxiliary_device;
|
||||
* @return
|
||||
* Whether the driver can handle the auxiliary device.
|
||||
*/
|
||||
typedef bool(rte_auxiliary_match_t)(const char *name);
|
||||
typedef bool (rte_auxiliary_match_t)(const char *name);
|
||||
|
||||
/**
|
||||
* Initialization function for the driver called during auxiliary probing.
|
||||
@ -56,8 +55,8 @@ typedef bool(rte_auxiliary_match_t)(const char *name);
|
||||
* - 0 On success.
|
||||
* - Negative value and rte_errno is set otherwise.
|
||||
*/
|
||||
typedef int(rte_auxiliary_probe_t)(struct rte_auxiliary_driver *drv,
|
||||
struct rte_auxiliary_device *dev);
|
||||
typedef int (rte_auxiliary_probe_t)(struct rte_auxiliary_driver *drv,
|
||||
struct rte_auxiliary_device *dev);
|
||||
|
||||
/**
|
||||
* Uninitialization function for the driver called during hotplugging.
|
||||
@ -87,7 +86,7 @@ typedef int (rte_auxiliary_remove_t)(struct rte_auxiliary_device *dev);
|
||||
* - Negative value and rte_errno is set otherwise.
|
||||
*/
|
||||
typedef int (rte_auxiliary_dma_map_t)(struct rte_auxiliary_device *dev,
|
||||
void *addr, uint64_t iova, size_t len);
|
||||
void *addr, uint64_t iova, size_t len);
|
||||
|
||||
/**
|
||||
* Driver-specific DMA un-mapping. After a successful call the device
|
||||
@ -106,7 +105,7 @@ typedef int (rte_auxiliary_dma_map_t)(struct rte_auxiliary_device *dev,
|
||||
* - Negative value and rte_errno is set otherwise.
|
||||
*/
|
||||
typedef int (rte_auxiliary_dma_unmap_t)(struct rte_auxiliary_device *dev,
|
||||
void *addr, uint64_t iova, size_t len);
|
||||
void *addr, uint64_t iova, size_t len);
|
||||
|
||||
/**
|
||||
* A structure describing an auxiliary device.
|
||||
@ -125,7 +124,6 @@ struct rte_auxiliary_device {
|
||||
struct rte_auxiliary_driver {
|
||||
RTE_TAILQ_ENTRY(rte_auxiliary_driver) next; /**< Next in list. */
|
||||
struct rte_driver driver; /**< Inherit core driver. */
|
||||
struct rte_auxiliary_bus *bus; /**< Auxiliary bus reference. */
|
||||
rte_auxiliary_match_t *match; /**< Device match function. */
|
||||
rte_auxiliary_probe_t *probe; /**< Device probe function. */
|
||||
rte_auxiliary_remove_t *remove; /**< Device remove function. */
|
||||
@ -160,7 +158,7 @@ struct rte_auxiliary_driver {
|
||||
* A pointer to a rte_auxiliary_driver structure describing the driver
|
||||
* to be registered.
|
||||
*/
|
||||
__rte_experimental
|
||||
__rte_internal
|
||||
void rte_auxiliary_register(struct rte_auxiliary_driver *driver);
|
||||
|
||||
/** Helper for auxiliary device registration from driver instance */
|
||||
@ -182,11 +180,11 @@ void rte_auxiliary_register(struct rte_auxiliary_driver *driver);
|
||||
* A pointer to a rte_auxiliary_driver structure describing the driver
|
||||
* to be unregistered.
|
||||
*/
|
||||
__rte_experimental
|
||||
__rte_internal
|
||||
void rte_auxiliary_unregister(struct rte_auxiliary_driver *driver);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* RTE_BUS_AUXILIARY_H */
|
||||
#endif /* BUS_AUXILIARY_DRIVER_H */
|
@ -6,13 +6,11 @@
|
||||
#include <dirent.h>
|
||||
|
||||
#include <rte_log.h>
|
||||
#include <rte_bus.h>
|
||||
#include <rte_malloc.h>
|
||||
#include <rte_devargs.h>
|
||||
#include <rte_memcpy.h>
|
||||
#include <eal_filesystem.h>
|
||||
|
||||
#include "../rte_bus_auxiliary.h"
|
||||
#include "../private.h"
|
||||
|
||||
#define AUXILIARY_SYSFS_PATH "/sys/bus/auxiliary/devices"
|
||||
|
@ -1,9 +1,7 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
# Copyright (c) 2021 NVIDIA Corporation & Affiliates
|
||||
|
||||
headers = files(
|
||||
'rte_bus_auxiliary.h',
|
||||
)
|
||||
driver_sdk_headers += files('bus_auxiliary_driver.h')
|
||||
sources = files(
|
||||
'auxiliary_common.c',
|
||||
'auxiliary_params.c',
|
||||
|
@ -9,9 +9,10 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/queue.h>
|
||||
|
||||
#include "rte_bus_auxiliary.h"
|
||||
#include <rte_bus.h>
|
||||
|
||||
#include "bus_auxiliary_driver.h"
|
||||
|
||||
extern struct rte_auxiliary_bus auxiliary_bus;
|
||||
extern int auxiliary_bus_logtype;
|
||||
|
||||
#define AUXILIARY_LOG(level, ...) \
|
||||
@ -19,27 +20,24 @@ extern int auxiliary_bus_logtype;
|
||||
RTE_FMT("auxiliary bus: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \
|
||||
RTE_FMT_TAIL(__VA_ARGS__,)))
|
||||
|
||||
/* Auxiliary bus iterators */
|
||||
#define FOREACH_DEVICE_ON_AUXILIARY_BUS(p) \
|
||||
TAILQ_FOREACH(p, &(auxiliary_bus.device_list), next)
|
||||
|
||||
#define FOREACH_DRIVER_ON_AUXILIARY_BUS(p) \
|
||||
TAILQ_FOREACH(p, &(auxiliary_bus.driver_list), next)
|
||||
|
||||
/* List of auxiliary devices. */
|
||||
TAILQ_HEAD(rte_auxiliary_device_list, rte_auxiliary_device);
|
||||
/* List of auxiliary drivers. */
|
||||
TAILQ_HEAD(rte_auxiliary_driver_list, rte_auxiliary_driver);
|
||||
|
||||
/*
|
||||
* Structure describing the auxiliary bus
|
||||
*/
|
||||
struct rte_auxiliary_bus {
|
||||
struct rte_bus bus; /* Inherit the generic class */
|
||||
struct rte_auxiliary_device_list device_list; /* List of devices */
|
||||
struct rte_auxiliary_driver_list driver_list; /* List of drivers */
|
||||
TAILQ_HEAD(, rte_auxiliary_device) device_list; /* List of devices */
|
||||
TAILQ_HEAD(, rte_auxiliary_driver) driver_list; /* List of drivers */
|
||||
};
|
||||
|
||||
extern struct rte_auxiliary_bus auxiliary_bus;
|
||||
|
||||
/* Auxiliary bus iterators */
|
||||
#define FOREACH_DEVICE_ON_AUXILIARY_BUS(p) \
|
||||
TAILQ_FOREACH(p, &(auxiliary_bus.device_list), next)
|
||||
|
||||
#define FOREACH_DRIVER_ON_AUXILIARY_BUS(p) \
|
||||
TAILQ_FOREACH(p, &(auxiliary_bus.driver_list), next)
|
||||
|
||||
/*
|
||||
* Test whether the auxiliary device exist.
|
||||
*/
|
||||
|
@ -1,7 +1,6 @@
|
||||
EXPERIMENTAL {
|
||||
INTERNAL {
|
||||
global:
|
||||
|
||||
# added in 21.08
|
||||
rte_auxiliary_register;
|
||||
rte_auxiliary_unregister;
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include <rte_malloc.h>
|
||||
#include <rte_errno.h>
|
||||
#include <rte_bus_auxiliary.h>
|
||||
#include <bus_auxiliary_driver.h>
|
||||
#include <rte_common.h>
|
||||
#include "eal_filesystem.h"
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <rte_errno.h>
|
||||
#include <rte_string_fns.h>
|
||||
#include <rte_bus_pci.h>
|
||||
#include <rte_bus_auxiliary.h>
|
||||
#include <bus_auxiliary_driver.h>
|
||||
|
||||
#include "mlx5_common.h"
|
||||
#include "mlx5_nl.h"
|
||||
|
@ -6,7 +6,7 @@
|
||||
#define MLX5_COMMON_PRIVATE_H
|
||||
|
||||
#include <rte_pci.h>
|
||||
#include <rte_bus_auxiliary.h>
|
||||
#include <bus_auxiliary_driver.h>
|
||||
|
||||
#include "mlx5_common.h"
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <ethdev_pci.h>
|
||||
#include <rte_pci.h>
|
||||
#include <rte_bus_pci.h>
|
||||
#include <rte_bus_auxiliary.h>
|
||||
#include <bus_auxiliary_driver.h>
|
||||
#include <rte_common.h>
|
||||
#include <rte_kvargs.h>
|
||||
#include <rte_rwlock.h>
|
||||
|
Loading…
Reference in New Issue
Block a user