2016-10-04 17:58:05 -07:00
|
|
|
/*
|
2016-10-04 17:58:05 -07:00
|
|
|
* Copyright (c) 2014, 2015, 2016 Nicira, Inc.
|
2016-10-04 17:58:05 -07:00
|
|
|
* Copyright (c) 2016 Red Hat, 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.
|
|
|
|
*/
|
|
|
|
|
2016-04-29 13:44:01 -04:00
|
|
|
#include <config.h>
|
2016-10-04 17:58:05 -07:00
|
|
|
#include "dpdk.h"
|
|
|
|
|
2016-04-29 13:44:01 -04:00
|
|
|
#include "smap.h"
|
|
|
|
#include "ovs-thread.h"
|
|
|
|
#include "openvswitch/vlog.h"
|
2018-05-03 15:08:01 -04:00
|
|
|
#include "vswitch-idl.h"
|
2016-04-29 13:44:01 -04:00
|
|
|
|
|
|
|
VLOG_DEFINE_THIS_MODULE(dpdk);
|
|
|
|
|
|
|
|
void
|
|
|
|
dpdk_init(const struct smap *ovs_other_config)
|
|
|
|
{
|
2016-10-04 17:58:05 -07:00
|
|
|
if (smap_get_bool(ovs_other_config, "dpdk-init", false)) {
|
|
|
|
static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
|
2016-04-29 13:44:01 -04:00
|
|
|
|
2016-10-04 17:58:05 -07:00
|
|
|
if (ovsthread_once_start(&once)) {
|
2016-04-29 13:44:01 -04:00
|
|
|
VLOG_ERR("DPDK not supported in this copy of Open vSwitch.");
|
2016-10-04 17:58:05 -07:00
|
|
|
ovsthread_once_done(&once);
|
2016-04-29 13:44:01 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-10-04 17:58:05 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
dpdk_set_lcore_id(unsigned cpu OVS_UNUSED)
|
|
|
|
{
|
|
|
|
/* Nothing */
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *
|
|
|
|
dpdk_get_vhost_sock_dir(void)
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
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
|
|
|
|
|
|
|
bool
|
|
|
|
dpdk_vhost_iommu_enabled(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
2018-01-15 19:21:12 +01:00
|
|
|
|
2019-05-14 16:08:43 +03:00
|
|
|
bool
|
|
|
|
dpdk_vhost_postcopy_enabled(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-06-27 14:58:31 +01:00
|
|
|
bool
|
|
|
|
dpdk_per_port_memory(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-07-05 08:43:15 -04:00
|
|
|
bool
|
|
|
|
dpdk_available(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
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 *cfg)
|
|
|
|
{
|
|
|
|
if (cfg) {
|
|
|
|
ovsrec_open_vswitch_set_dpdk_initialized(cfg, false);
|
|
|
|
ovsrec_open_vswitch_set_dpdk_version(cfg, "none");
|
|
|
|
}
|
|
|
|
}
|