bus/dpaa: make driver-only headers private

The dpaa bus interface is for drivers only.
Mark as internal and move the header in the driver headers list.

While at it, cleanup internal structures:
- 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 update code that relied on it,

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
This commit is contained in:
David Marchand 2022-07-28 17:26:26 +02:00
parent b3f89090d6
commit a2f1da7da8
10 changed files with 26 additions and 35 deletions

View File

@ -7,7 +7,7 @@
#include "qman.h" #include "qman.h"
#include <rte_branch_prediction.h> #include <rte_branch_prediction.h>
#include <rte_dpaa_bus.h> #include <bus_dpaa_driver.h>
#include <rte_eventdev.h> #include <rte_eventdev.h>
#include <rte_byteorder.h> #include <rte_byteorder.h>

View File

@ -3,12 +3,14 @@
* Copyright 2017-2022 NXP * Copyright 2017-2022 NXP
* *
*/ */
#ifndef __RTE_DPAA_BUS_H__ #ifndef BUS_DPAA_DRIVER_H
#define __RTE_DPAA_BUS_H__ #define BUS_DPAA_DRIVER_H
#include <rte_bus.h> #include <rte_compat.h>
#include <rte_dev.h>
#include <rte_mbuf_dyn.h> #include <rte_mbuf_dyn.h>
#include <rte_mempool.h> #include <rte_mempool.h>
#include <dpaax_iova_table.h> #include <dpaax_iova_table.h>
#include <dpaa_of.h> #include <dpaa_of.h>
@ -73,24 +75,12 @@ extern unsigned int dpaa_svr_family;
struct rte_dpaa_device; struct rte_dpaa_device;
struct rte_dpaa_driver; struct rte_dpaa_driver;
/* DPAA Device and Driver lists for DPAA bus */
TAILQ_HEAD(rte_dpaa_device_list, rte_dpaa_device);
TAILQ_HEAD(rte_dpaa_driver_list, rte_dpaa_driver);
enum rte_dpaa_type { enum rte_dpaa_type {
FSL_DPAA_ETH = 1, FSL_DPAA_ETH = 1,
FSL_DPAA_CRYPTO, FSL_DPAA_CRYPTO,
FSL_DPAA_QDMA FSL_DPAA_QDMA
}; };
struct rte_dpaa_bus {
struct rte_bus bus;
struct rte_dpaa_device_list device_list;
struct rte_dpaa_driver_list driver_list;
int device_count;
int detected;
};
struct dpaa_device_id { struct dpaa_device_id {
uint8_t fman_id; /**< Fman interface ID, for ETH type device */ uint8_t fman_id; /**< Fman interface ID, for ETH type device */
uint8_t mac_id; /**< Fman MAC interface ID, for ETH type device */ uint8_t mac_id; /**< Fman MAC interface ID, for ETH type device */
@ -119,7 +109,6 @@ typedef int (*rte_dpaa_remove_t)(struct rte_dpaa_device *dpaa_dev);
struct rte_dpaa_driver { struct rte_dpaa_driver {
TAILQ_ENTRY(rte_dpaa_driver) next; TAILQ_ENTRY(rte_dpaa_driver) next;
struct rte_driver driver; struct rte_driver driver;
struct rte_dpaa_bus *dpaa_bus;
enum rte_dpaa_type drv_type; enum rte_dpaa_type drv_type;
rte_dpaa_probe_t probe; rte_dpaa_probe_t probe;
rte_dpaa_remove_t remove; rte_dpaa_remove_t remove;
@ -166,6 +155,7 @@ extern struct dpaa_memseg_list rte_dpaa_memsegs;
/* Either iterate over the list of internal memseg references or fallback to /* Either iterate over the list of internal memseg references or fallback to
* EAL memseg based iova2virt. * EAL memseg based iova2virt.
*/ */
__rte_internal
static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr) static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr)
{ {
struct dpaa_memseg *ms; struct dpaa_memseg *ms;
@ -192,6 +182,7 @@ static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr)
return va; return va;
} }
__rte_internal
static inline rte_iova_t static inline rte_iova_t
rte_dpaa_mem_vtop(void *vaddr) rte_dpaa_mem_vtop(void *vaddr)
{ {
@ -263,4 +254,4 @@ struct fm_eth_port_cfg *dpaa_get_eth_port_cfg(int dev_id);
} }
#endif #endif
#endif /* __RTE_DPAA_BUS_H__ */ #endif /* BUS_DPAA_DRIVER_H */

View File

@ -34,7 +34,7 @@
#include <rte_mbuf_dyn.h> #include <rte_mbuf_dyn.h>
#include <dpaa_of.h> #include <dpaa_of.h>
#include <rte_dpaa_bus.h> #include <bus_dpaa_driver.h>
#include <rte_dpaa_logs.h> #include <rte_dpaa_logs.h>
#include <dpaax_iova_table.h> #include <dpaax_iova_table.h>
@ -43,6 +43,14 @@
#include <fsl_bman.h> #include <fsl_bman.h>
#include <netcfg.h> #include <netcfg.h>
struct rte_dpaa_bus {
struct rte_bus bus;
TAILQ_HEAD(, rte_dpaa_device) device_list;
TAILQ_HEAD(, rte_dpaa_driver) driver_list;
int device_count;
int detected;
};
static struct rte_dpaa_bus rte_dpaa_bus; static struct rte_dpaa_bus rte_dpaa_bus;
struct netcfg_info *dpaa_netcfg; struct netcfg_info *dpaa_netcfg;
@ -520,23 +528,15 @@ rte_dpaa_driver_register(struct rte_dpaa_driver *driver)
BUS_INIT_FUNC_TRACE(); BUS_INIT_FUNC_TRACE();
TAILQ_INSERT_TAIL(&rte_dpaa_bus.driver_list, driver, next); TAILQ_INSERT_TAIL(&rte_dpaa_bus.driver_list, driver, next);
/* Update Bus references */
driver->dpaa_bus = &rte_dpaa_bus;
} }
/* un-register a dpaa bus based dpaa driver */ /* un-register a dpaa bus based dpaa driver */
void void
rte_dpaa_driver_unregister(struct rte_dpaa_driver *driver) rte_dpaa_driver_unregister(struct rte_dpaa_driver *driver)
{ {
struct rte_dpaa_bus *dpaa_bus;
BUS_INIT_FUNC_TRACE(); BUS_INIT_FUNC_TRACE();
dpaa_bus = driver->dpaa_bus; TAILQ_REMOVE(&rte_dpaa_bus.driver_list, driver, next);
TAILQ_REMOVE(&dpaa_bus->driver_list, driver, next);
/* Update Bus references */
driver->dpaa_bus = NULL;
} }
static int static int

View File

@ -41,7 +41,7 @@
#include <desc/pdcp.h> #include <desc/pdcp.h>
#include <desc/sdap.h> #include <desc/sdap.h>
#include <rte_dpaa_bus.h> #include <bus_dpaa_driver.h>
#include <dpaa_sec.h> #include <dpaa_sec.h>
#include <dpaa_sec_event.h> #include <dpaa_sec_event.h>
#include <dpaa_sec_log.h> #include <dpaa_sec_log.h>

View File

@ -15,7 +15,7 @@
#include <desc/algo.h> #include <desc/algo.h>
#include <desc/ipsec.h> #include <desc/ipsec.h>
#include <rte_dpaa_bus.h> #include <bus_dpaa_driver.h>
#include <dpaa_sec.h> #include <dpaa_sec.h>
#include <dpaa_sec_log.h> #include <dpaa_sec_log.h>

View File

@ -2,7 +2,7 @@
* Copyright 2021 NXP * Copyright 2021 NXP
*/ */
#include <rte_dpaa_bus.h> #include <bus_dpaa_driver.h>
#include <rte_dmadev_pmd.h> #include <rte_dmadev_pmd.h>
#include "dpaa_qdma.h" #include "dpaa_qdma.h"

View File

@ -29,7 +29,7 @@
#include <rte_event_eth_rx_adapter.h> #include <rte_event_eth_rx_adapter.h>
#include <rte_event_eth_tx_adapter.h> #include <rte_event_eth_tx_adapter.h>
#include <cryptodev_pmd.h> #include <cryptodev_pmd.h>
#include <rte_dpaa_bus.h> #include <bus_dpaa_driver.h>
#include <rte_dpaa_logs.h> #include <rte_dpaa_logs.h>
#include <rte_cycles.h> #include <rte_cycles.h>
#include <rte_kvargs.h> #include <rte_kvargs.h>

View File

@ -14,7 +14,7 @@
#include <rte_mempool.h> #include <rte_mempool.h>
#include <rte_dpaa_bus.h> #include <bus_dpaa_driver.h>
#include <rte_dpaa_logs.h> #include <rte_dpaa_logs.h>
#include <fsl_usd.h> #include <fsl_usd.h>

View File

@ -33,7 +33,7 @@
#include <rte_malloc.h> #include <rte_malloc.h>
#include <rte_ring.h> #include <rte_ring.h>
#include <rte_dpaa_bus.h> #include <bus_dpaa_driver.h>
#include <rte_dpaa_logs.h> #include <rte_dpaa_logs.h>
#include <dpaa_mempool.h> #include <dpaa_mempool.h>

View File

@ -37,7 +37,7 @@
#include "dpaa_ethdev.h" #include "dpaa_ethdev.h"
#include "dpaa_rxtx.h" #include "dpaa_rxtx.h"
#include <rte_dpaa_bus.h> #include <bus_dpaa_driver.h>
#include <dpaa_mempool.h> #include <dpaa_mempool.h>
#include <qman.h> #include <qman.h>