]> git.proxmox.com Git - mirror_ovs.git/blob - lib/userspace-tso.c
ovsdb-idl: Fix iteration over tracked rows with no actual data.
[mirror_ovs.git] / lib / userspace-tso.c
1 /*
2 * Copyright (c) 2020 Red Hat, Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include <config.h>
18
19 #include "smap.h"
20 #include "ovs-thread.h"
21 #include "openvswitch/vlog.h"
22 #include "dpdk.h"
23 #include "userspace-tso.h"
24 #include "vswitch-idl.h"
25
26 VLOG_DEFINE_THIS_MODULE(userspace_tso);
27
28 static bool userspace_tso = false;
29
30 void
31 userspace_tso_init(const struct smap *ovs_other_config)
32 {
33 if (smap_get_bool(ovs_other_config, "userspace-tso-enable", false)) {
34 static struct ovsthread_once once = OVSTHREAD_ONCE_INITIALIZER;
35
36 if (ovsthread_once_start(&once)) {
37 VLOG_INFO("Userspace TCP Segmentation Offloading support enabled");
38 userspace_tso = true;
39 ovsthread_once_done(&once);
40 }
41 }
42 }
43
44 bool
45 userspace_tso_enabled(void)
46 {
47 return userspace_tso;
48 }