#include "dirs.h"
#include "dpctl.h"
#include "dpif.h"
-#include "dpif-netdev.h"
#include "dynamic-string.h"
#include "flow.h"
#include "match.h"
#include "netdev.h"
+#include "netdev-dpdk.h"
#include "netlink.h"
#include "odp-util.h"
#include "ofp-parse.h"
VLOG_ERR("Thread affinity error %d",err);
return err;
}
- /* lcore_id 0 is reseved for use by non pmd threads. */
- ovs_assert(cpu);
+ /* NON_PMD_CORE_ID is reserved for use by non pmd threads. */
+ ovs_assert(cpu != NON_PMD_CORE_ID);
RTE_PER_LCORE(_lcore_id) = cpu;
return 0;
void
thread_set_nonpmd(void)
{
- /* We have to use 0 to allow non pmd threads to perform certain DPDK
- * operations, like rte_eth_dev_configure(). */
- RTE_PER_LCORE(_lcore_id) = 0;
+ /* We have to use NON_PMD_CORE_ID to allow non-pmd threads to perform
+ * certain DPDK operations, like rte_eth_dev_configure(). */
+ RTE_PER_LCORE(_lcore_id) = NON_PMD_CORE_ID;
}
static bool
thread_is_pmd(void)
{
- return rte_lcore_id() != 0;
+ return rte_lcore_id() != NON_PMD_CORE_ID;
}
struct dpif_packet;
+/* Reserves cpu core 0 for all non-pmd threads. Changing the value of this
+ * macro will allow pmd thread to be pinned on cpu core 0. This may not be
+ * ideal since the core may be non-isolated. */
+#define NON_PMD_CORE_ID 0
+
#ifdef DPDK_NETDEV
#include <rte_config.h>