2016-10-04 17:58:05 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2014, 2015, 2016 Nicira, Inc.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at:
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2014-03-24 19:23:08 -07:00
|
|
|
#ifndef NETDEV_DPDK_H
|
|
|
|
#define NETDEV_DPDK_H
|
|
|
|
|
|
|
|
#include <config.h>
|
2014-03-24 21:10:39 -07:00
|
|
|
|
2015-02-25 12:01:53 -08:00
|
|
|
struct dp_packet;
|
2016-04-29 13:44:01 -04:00
|
|
|
struct smap;
|
2014-06-23 11:43:57 -07:00
|
|
|
|
2014-03-24 21:10:39 -07:00
|
|
|
#ifdef DPDK_NETDEV
|
2014-03-24 19:23:08 -07:00
|
|
|
|
|
|
|
#include <rte_config.h>
|
|
|
|
#include <rte_eal.h>
|
|
|
|
#include <rte_debug.h>
|
|
|
|
#include <rte_ethdev.h>
|
2014-07-11 13:37:11 +01:00
|
|
|
#include <rte_eth_ring.h>
|
2014-03-24 19:23:08 -07:00
|
|
|
#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>
|
|
|
|
|
2015-05-22 17:14:20 +01:00
|
|
|
#define NON_PMD_CORE_ID LCORE_ID_ANY
|
|
|
|
|
2014-03-24 19:23:08 -07:00
|
|
|
void netdev_dpdk_register(void);
|
2015-02-25 12:01:53 -08:00
|
|
|
void free_dpdk_buf(struct dp_packet *);
|
2016-06-06 17:05:49 -07:00
|
|
|
void dpdk_set_lcore_id(unsigned cpu);
|
2014-03-24 19:23:08 -07:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
2015-05-22 17:14:20 +01:00
|
|
|
#define NON_PMD_CORE_ID UINT32_MAX
|
|
|
|
|
2014-09-30 09:57:08 -07:00
|
|
|
#include "util.h"
|
|
|
|
|
2014-03-24 21:10:39 -07:00
|
|
|
static inline void
|
|
|
|
netdev_dpdk_register(void)
|
|
|
|
{
|
|
|
|
/* Nothing */
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
2015-02-25 12:01:53 -08:00
|
|
|
free_dpdk_buf(struct dp_packet *buf OVS_UNUSED)
|
2014-03-24 21:10:39 -07:00
|
|
|
{
|
|
|
|
/* Nothing */
|
|
|
|
}
|
|
|
|
|
2016-06-06 17:05:49 -07:00
|
|
|
static inline void
|
|
|
|
dpdk_set_lcore_id(unsigned cpu OVS_UNUSED)
|
2014-03-24 21:10:39 -07:00
|
|
|
{
|
2016-06-06 17:05:49 -07:00
|
|
|
/* Nothing */
|
2014-03-24 21:10:39 -07:00
|
|
|
}
|
2014-03-24 19:23:08 -07:00
|
|
|
|
|
|
|
#endif /* DPDK_NETDEV */
|
2016-04-29 13:44:01 -04:00
|
|
|
|
|
|
|
void dpdk_init(const struct smap *ovs_other_config);
|
|
|
|
|
2014-03-24 19:23:08 -07:00
|
|
|
#endif
|