mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
dpdk: New module with some code from netdev-dpdk.
There's a lot of code in netdev-dpdk which is not at all related to the netdev interface, mostly the library initialization code. This commit moves it to a new 'dpdk' module, to simplify 'netdev-dpdk'. Also a new module 'dpdk-stub' is introduced to implement some functions when DPDK is not available. This replaces the old 'netdev-nodpdk' module. Some redundant includes are removed or reorganized as a consequence. No functional change. CC: Aaron Conole <aconole@redhat.com> Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Aaron Conole <aconole@redhat.com>
This commit is contained in:
@@ -19,56 +19,28 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "openvswitch/compiler.h"
|
||||
|
||||
struct dp_packet;
|
||||
struct smap;
|
||||
|
||||
#ifdef DPDK_NETDEV
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_eal.h>
|
||||
#include <rte_debug.h>
|
||||
#include <rte_ethdev.h>
|
||||
#include <rte_eth_ring.h>
|
||||
#include <rte_errno.h>
|
||||
#include <rte_memzone.h>
|
||||
#include <rte_memcpy.h>
|
||||
#include <rte_cycles.h>
|
||||
#include <rte_spinlock.h>
|
||||
#include <rte_launch.h>
|
||||
#include <rte_malloc.h>
|
||||
|
||||
#define NON_PMD_CORE_ID LCORE_ID_ANY
|
||||
|
||||
void netdev_dpdk_register(void);
|
||||
void free_dpdk_buf(struct dp_packet *);
|
||||
void dpdk_set_lcore_id(unsigned cpu);
|
||||
|
||||
#else
|
||||
|
||||
#define NON_PMD_CORE_ID UINT32_MAX
|
||||
|
||||
#include "util.h"
|
||||
|
||||
static inline void
|
||||
netdev_dpdk_register(void)
|
||||
{
|
||||
/* Nothing */
|
||||
}
|
||||
|
||||
static inline void
|
||||
free_dpdk_buf(struct dp_packet *buf OVS_UNUSED)
|
||||
{
|
||||
/* Nothing */
|
||||
}
|
||||
|
||||
static inline void
|
||||
dpdk_set_lcore_id(unsigned cpu OVS_UNUSED)
|
||||
{
|
||||
/* Nothing */
|
||||
}
|
||||
|
||||
#endif /* DPDK_NETDEV */
|
||||
|
||||
void dpdk_init(const struct smap *ovs_other_config);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* netdev-dpdk.h */
|
||||
|
Reference in New Issue
Block a user