/src/openvswitch/lib/dpdk-stub.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2014, 2015, 2016 Nicira, Inc. |
3 | | * Copyright (c) 2016 Red Hat, Inc. |
4 | | * |
5 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
6 | | * you may not use this file except in compliance with the License. |
7 | | * You may obtain a copy of the License at: |
8 | | * |
9 | | * http://www.apache.org/licenses/LICENSE-2.0 |
10 | | * |
11 | | * Unless required by applicable law or agreed to in writing, software |
12 | | * distributed under the License is distributed on an "AS IS" BASIS, |
13 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 | | * See the License for the specific language governing permissions and |
15 | | * limitations under the License. |
16 | | */ |
17 | | |
18 | | #include <config.h> |
19 | | #include "dpdk.h" |
20 | | |
21 | | #include "smap.h" |
22 | | #include "ovs-thread.h" |
23 | | #include "openvswitch/vlog.h" |
24 | | #include "vswitch-idl.h" |
25 | | |
26 | | VLOG_DEFINE_THIS_MODULE(dpdk); |
27 | | |
28 | | void |
29 | | dpdk_init(const struct smap *ovs_other_config) |
30 | 0 | { |
31 | 0 | if (smap_get_bool(ovs_other_config, "dpdk-init", false)) { |
32 | 0 | static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER; |
33 | |
|
34 | 0 | if (ovsthread_once_start(&once)) { |
35 | 0 | VLOG_ERR("DPDK not supported in this copy of Open vSwitch."); |
36 | 0 | ovsthread_once_done(&once); |
37 | 0 | } |
38 | 0 | } |
39 | 0 | } |
40 | | |
41 | | bool |
42 | | dpdk_attach_thread(unsigned cpu OVS_UNUSED) |
43 | 0 | { |
44 | 0 | return false; |
45 | 0 | } |
46 | | |
47 | | void |
48 | | dpdk_detach_thread(void) |
49 | 0 | { |
50 | 0 | } |
51 | | |
52 | | bool |
53 | | dpdk_available(void) |
54 | 0 | { |
55 | 0 | return false; |
56 | 0 | } |
57 | | |
58 | | void |
59 | | print_dpdk_version(void) |
60 | 0 | { |
61 | 0 | } |
62 | | |
63 | | void |
64 | | dpdk_status(const struct ovsrec_open_vswitch *cfg) |
65 | 0 | { |
66 | 0 | if (cfg) { |
67 | 0 | ovsrec_open_vswitch_set_dpdk_initialized(cfg, false); |
68 | 0 | ovsrec_open_vswitch_set_dpdk_version(cfg, "none"); |
69 | 0 | } |
70 | 0 | } |