lib/env_dpdk: remove spdk prefix from internal functions.

Signed-off-by: Seth Howell <seth.howell@intel.com>
Change-Id: I20fddc974cdbd7763e7f148f060ddb76d59e0923
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1709
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Seth Howell 2020-04-07 00:32:40 -07:00 committed by Tomasz Zawadzki
parent 229ef16bb9
commit 15d0ae628d
9 changed files with 35 additions and 35 deletions

View File

@ -62,7 +62,7 @@
#define SPDK_PMD_REGISTER_PCI(pci_drv) \ #define SPDK_PMD_REGISTER_PCI(pci_drv) \
__attribute__((constructor)) static void pci_drv ## _register(void) \ __attribute__((constructor)) static void pci_drv ## _register(void) \
{ \ { \
spdk_pci_driver_register(&pci_drv); \ pci_driver_register(&pci_drv); \
} }
struct spdk_pci_driver { struct spdk_pci_driver {
@ -73,27 +73,27 @@ struct spdk_pci_driver {
TAILQ_ENTRY(spdk_pci_driver) tailq; TAILQ_ENTRY(spdk_pci_driver) tailq;
}; };
void spdk_pci_driver_register(struct spdk_pci_driver *driver); void pci_driver_register(struct spdk_pci_driver *driver);
int spdk_pci_device_init(struct rte_pci_driver *driver, struct rte_pci_device *device); int pci_device_init(struct rte_pci_driver *driver, struct rte_pci_device *device);
int spdk_pci_device_fini(struct rte_pci_device *device); int pci_device_fini(struct rte_pci_device *device);
void spdk_pci_init(void); void pci_init(void);
void spdk_pci_fini(void); void pci_fini(void);
int spdk_mem_map_init(bool legacy_mem); int mem_map_init(bool legacy_mem);
int spdk_vtophys_init(void); int vtophys_init(void);
/** /**
* Report a DMA-capable PCI device to the vtophys translation code. * Report a DMA-capable PCI device to the vtophys translation code.
* Increases the refcount of active DMA-capable devices managed by SPDK. * Increases the refcount of active DMA-capable devices managed by SPDK.
* This must be called after a `rte_pci_device` is created. * This must be called after a `rte_pci_device` is created.
*/ */
void spdk_vtophys_pci_device_added(struct rte_pci_device *pci_device); void vtophys_pci_device_added(struct rte_pci_device *pci_device);
/** /**
* Report the removal of a DMA-capable PCI device to the vtophys translation code. * Report the removal of a DMA-capable PCI device to the vtophys translation code.
* Decreases the refcount of active DMA-capable devices managed by SPDK. * Decreases the refcount of active DMA-capable devices managed by SPDK.
* This must be called before a `rte_pci_device` is destroyed. * This must be called before a `rte_pci_device` is destroyed.
*/ */
void spdk_vtophys_pci_device_removed(struct rte_pci_device *pci_device); void vtophys_pci_device_removed(struct rte_pci_device *pci_device);
#endif #endif

View File

@ -499,15 +499,15 @@ spdk_env_dpdk_post_init(bool legacy_mem)
{ {
int rc; int rc;
spdk_pci_init(); pci_init();
rc = spdk_mem_map_init(legacy_mem); rc = mem_map_init(legacy_mem);
if (rc < 0) { if (rc < 0) {
fprintf(stderr, "Failed to allocate mem_map\n"); fprintf(stderr, "Failed to allocate mem_map\n");
return rc; return rc;
} }
rc = spdk_vtophys_init(); rc = vtophys_init();
if (rc < 0) { if (rc < 0) {
fprintf(stderr, "Failed to initialize vtophys\n"); fprintf(stderr, "Failed to initialize vtophys\n");
return rc; return rc;
@ -519,7 +519,7 @@ spdk_env_dpdk_post_init(bool legacy_mem)
void void
spdk_env_dpdk_post_fini(void) spdk_env_dpdk_post_fini(void)
{ {
spdk_pci_fini(); pci_fini();
spdk_free_args(g_eal_cmdline, g_eal_cmdline_argcount); spdk_free_args(g_eal_cmdline, g_eal_cmdline_argcount);
} }

View File

@ -724,7 +724,7 @@ memory_iter_cb(const struct rte_memseg_list *msl,
#endif #endif
int int
spdk_mem_map_init(bool legacy_mem) mem_map_init(bool legacy_mem)
{ {
g_legacy_mem = legacy_mem; g_legacy_mem = legacy_mem;
@ -1306,7 +1306,7 @@ spdk_vtophys_iommu_init(void)
#endif #endif
void void
spdk_vtophys_pci_device_added(struct rte_pci_device *pci_device) vtophys_pci_device_added(struct rte_pci_device *pci_device)
{ {
struct spdk_vtophys_pci_device *vtophys_dev; struct spdk_vtophys_pci_device *vtophys_dev;
@ -1352,7 +1352,7 @@ spdk_vtophys_pci_device_added(struct rte_pci_device *pci_device)
} }
void void
spdk_vtophys_pci_device_removed(struct rte_pci_device *pci_device) vtophys_pci_device_removed(struct rte_pci_device *pci_device)
{ {
struct spdk_vtophys_pci_device *vtophys_dev; struct spdk_vtophys_pci_device *vtophys_dev;
@ -1400,7 +1400,7 @@ spdk_vtophys_pci_device_removed(struct rte_pci_device *pci_device)
} }
int int
spdk_vtophys_init(void) vtophys_init(void)
{ {
const struct spdk_mem_map_ops vtophys_map_ops = { const struct spdk_mem_map_ops vtophys_map_ops = {
.notify_cb = spdk_vtophys_notify, .notify_cb = spdk_vtophys_notify,

View File

@ -173,7 +173,7 @@ spdk_detach_rte(struct spdk_pci_device *dev)
} }
void void
spdk_pci_driver_register(struct spdk_pci_driver *driver) pci_driver_register(struct spdk_pci_driver *driver)
{ {
TAILQ_INSERT_TAIL(&g_pci_drivers, driver, tailq); TAILQ_INSERT_TAIL(&g_pci_drivers, driver, tailq);
} }
@ -238,7 +238,7 @@ cleanup_pci_devices(void)
continue; continue;
} }
spdk_vtophys_pci_device_removed(dev->dev_handle); vtophys_pci_device_removed(dev->dev_handle);
TAILQ_REMOVE(&g_pci_devices, dev, internal.tailq); TAILQ_REMOVE(&g_pci_devices, dev, internal.tailq);
free(dev); free(dev);
} }
@ -247,7 +247,7 @@ cleanup_pci_devices(void)
TAILQ_FOREACH_SAFE(dev, &g_pci_hotplugged_devices, internal.tailq, tmp) { TAILQ_FOREACH_SAFE(dev, &g_pci_hotplugged_devices, internal.tailq, tmp) {
TAILQ_REMOVE(&g_pci_hotplugged_devices, dev, internal.tailq); TAILQ_REMOVE(&g_pci_hotplugged_devices, dev, internal.tailq);
TAILQ_INSERT_TAIL(&g_pci_devices, dev, internal.tailq); TAILQ_INSERT_TAIL(&g_pci_devices, dev, internal.tailq);
spdk_vtophys_pci_device_added(dev->dev_handle); vtophys_pci_device_added(dev->dev_handle);
} }
pthread_mutex_unlock(&g_pci_mutex); pthread_mutex_unlock(&g_pci_mutex);
} }
@ -259,7 +259,7 @@ _get_alarm_thread_cb(void *unused)
} }
void void
spdk_pci_init(void) pci_init(void)
{ {
#if RTE_VERSION >= RTE_VERSION_NUM(18, 11, 0, 0) #if RTE_VERSION >= RTE_VERSION_NUM(18, 11, 0, 0)
struct spdk_pci_driver *driver; struct spdk_pci_driver *driver;
@ -298,7 +298,7 @@ spdk_pci_init(void)
} }
void void
spdk_pci_fini(void) pci_fini(void)
{ {
struct spdk_pci_device *dev; struct spdk_pci_device *dev;
char bdf[32]; char bdf[32];
@ -319,8 +319,8 @@ spdk_pci_fini(void)
} }
int int
spdk_pci_device_init(struct rte_pci_driver *_drv, pci_device_init(struct rte_pci_driver *_drv,
struct rte_pci_device *_dev) struct rte_pci_device *_dev)
{ {
struct spdk_pci_driver *driver = (struct spdk_pci_driver *)_drv; struct spdk_pci_driver *driver = (struct spdk_pci_driver *)_drv;
struct spdk_pci_device *dev; struct spdk_pci_device *dev;
@ -378,7 +378,7 @@ spdk_pci_device_init(struct rte_pci_driver *_drv,
} }
int int
spdk_pci_device_fini(struct rte_pci_device *_dev) pci_device_fini(struct rte_pci_device *_dev)
{ {
struct spdk_pci_device *dev; struct spdk_pci_device *dev;

View File

@ -93,8 +93,8 @@ static struct spdk_pci_driver g_ioat_pci_drv = {
.driver = { .driver = {
.drv_flags = RTE_PCI_DRV_NEED_MAPPING, .drv_flags = RTE_PCI_DRV_NEED_MAPPING,
.id_table = ioat_driver_id, .id_table = ioat_driver_id,
.probe = spdk_pci_device_init, .probe = pci_device_init,
.remove = spdk_pci_device_fini, .remove = pci_device_fini,
.driver.name = "spdk_ioat", .driver.name = "spdk_ioat",
}, },

View File

@ -54,8 +54,8 @@ static struct spdk_pci_driver g_nvme_pci_drv = {
#endif #endif
, ,
.id_table = nvme_pci_driver_id, .id_table = nvme_pci_driver_id,
.probe = spdk_pci_device_init, .probe = pci_device_init,
.remove = spdk_pci_device_fini, .remove = pci_device_fini,
.driver.name = "spdk_nvme", .driver.name = "spdk_nvme",
}, },

View File

@ -49,8 +49,8 @@ static struct spdk_pci_driver g_virtio_pci_drv = {
#endif #endif
, ,
.id_table = virtio_pci_driver_id, .id_table = virtio_pci_driver_id,
.probe = spdk_pci_device_init, .probe = pci_device_init,
.remove = spdk_pci_device_fini, .remove = pci_device_fini,
.driver.name = "spdk_virtio", .driver.name = "spdk_virtio",
}, },

View File

@ -48,8 +48,8 @@ static struct spdk_pci_driver g_vmd_pci_drv = {
#endif #endif
, ,
.id_table = vmd_pci_driver_id, .id_table = vmd_pci_driver_id,
.probe = spdk_pci_device_init, .probe = pci_device_init,
.remove = spdk_pci_device_fini, .remove = pci_device_fini,
.driver.name = "spdk_vmd", .driver.name = "spdk_vmd",
}, },

View File

@ -503,7 +503,7 @@ main(int argc, char **argv)
g_page_array = spdk_bit_array_create(PAGE_ARRAY_SIZE); g_page_array = spdk_bit_array_create(PAGE_ARRAY_SIZE);
/* Initialize the memory map */ /* Initialize the memory map */
if (spdk_mem_map_init(false) < 0) { if (mem_map_init(false) < 0) {
return CUE_NOMEMORY; return CUE_NOMEMORY;
} }