2016-10-04 17:58:05 -07:00
|
|
|
/*
|
2016-10-04 17:58:05 -07:00
|
|
|
* Copyright (c) 2016 Nicira, Inc.
|
2016-10-04 17:58:05 -07:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2016-10-04 17:58:05 -07:00
|
|
|
#ifndef DPDK_H
|
|
|
|
#define DPDK_H
|
|
|
|
|
netdev-dpdk: vHost IOMMU support
DPDK v17.11 introduces support for the vHost IOMMU feature.
This is a security feature, which restricts the vhost memory
that a virtio device may access.
This feature also enables the vhost REPLY_ACK protocol, the
implementation of which is known to work in newer versions of
QEMU (i.e. v2.10.0), but is buggy in older versions (v2.7.0 -
v2.9.0, inclusive). As such, the feature is disabled by default
in (and should remain so), for the aforementioned older QEMU
verions. Starting with QEMU v2.9.1, vhost-iommu-support can
safely be enabled, even without having an IOMMU device, with
no performance penalty.
This patch adds a new global config option, vhost-iommu-support,
that controls enablement of the vhost IOMMU feature:
ovs-vsctl set Open_vSwitch . other_config:vhost-iommu-support=true
This value defaults to false; to enable IOMMU support, this field
should be set to true when setting other global parameters on init
(such as "dpdk-socket-mem", for example). Changing the value at
runtime is not supported, and requires restarting the vswitch daemon.
Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
2017-12-08 10:53:47 +00:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2016-10-04 17:58:05 -07:00
|
|
|
#ifdef DPDK_NETDEV
|
|
|
|
|
|
|
|
#include <rte_config.h>
|
|
|
|
#include <rte_lcore.h>
|
|
|
|
|
|
|
|
#define NON_PMD_CORE_ID LCORE_ID_ANY
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define NON_PMD_CORE_ID UINT32_MAX
|
|
|
|
|
|
|
|
#endif /* DPDK_NETDEV */
|
|
|
|
|
|
|
|
struct smap;
|
2018-05-03 15:08:01 -04:00
|
|
|
struct ovsrec_open_vswitch;
|
2016-10-04 17:58:05 -07:00
|
|
|
|
|
|
|
void dpdk_init(const struct smap *ovs_other_config);
|
dpdk: Support running PMD threads on any core.
Previously in OVS, a PMD thread running on cpu X used lcore X.
This assumption limited OVS to run PMD threads on physical cpu <
RTE_MAX_LCORE.
DPDK 20.08 introduced a new API that associates a non-EAL thread to a free
lcore. This new API does not change the thread characteristics (like CPU
affinity) and let OVS run its PMD threads on any cpu regardless of
RTE_MAX_LCORE.
The DPDK multiprocess feature is not compatible with this new API and is
disabled.
DPDK still limits the number of lcores to RTE_MAX_LCORE (128 on x86_64)
which should be enough for OVS pmd threads (hopefully).
DPDK lcore/OVS pmd threads mapping are logged at threads when trying to
attach a OVS PMD thread, and when detaching.
A new command is added to help get DPDK point of view of the DPDK lcores
at any time:
$ ovs-appctl dpdk/lcore-list
lcore 0, socket 0, role RTE, cpuset 0
lcore 1, socket 0, role NON_EAL, cpuset 1
lcore 2, socket 0, role NON_EAL, cpuset 15
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-11-10 17:53:41 +01:00
|
|
|
bool dpdk_attach_thread(unsigned cpu);
|
|
|
|
void dpdk_detach_thread(void);
|
2019-07-05 08:43:15 -04:00
|
|
|
bool dpdk_available(void);
|
2018-01-15 19:21:12 +01:00
|
|
|
void print_dpdk_version(void);
|
2018-05-03 15:08:01 -04:00
|
|
|
void dpdk_status(const struct ovsrec_open_vswitch *);
|
2020-07-13 13:42:13 +01:00
|
|
|
|
2016-10-04 17:58:05 -07:00
|
|
|
#endif /* dpdk.h */
|