Skip to content

Commit 0becf4c

Browse files
authored
Merge pull request #155 from robhoes/master
CA-310413: Unconditionally apply enic workaround (again)
2 parents 74f6649 + cd5df52 commit 0becf4c

File tree

3 files changed

+1
-28
lines changed

3 files changed

+1
-28
lines changed

lib/network_utils.ml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,6 @@ module Sysfs = struct
123123
warn "Failed to obtain list of drivers from sysfs";
124124
[]
125125

126-
let get_driver_version driver () =
127-
try
128-
Some (String.trim (Xapi_stdext_unix.Unixext.string_of_file ("/sys/bus/pci/drivers/" ^ driver ^ "/module/version")))
129-
with _ ->
130-
warn "Failed to obtain driver version from sysfs";
131-
None
132-
133126
let getpath dev attr =
134127
Printf.sprintf "/sys/class/net/%s/%s" dev attr
135128

networkd/network_server.ml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ type context = unit
2525
let network_conf = ref "/etc/xcp/network.conf"
2626
let config : config_t ref = ref Network_config.empty_config
2727
let backend_kind = ref Openvswitch
28-
let enic_workaround_until_version = ref "2.3.0.30"
2928

3029
let legacy_management_interface_start () =
3130
try
@@ -95,30 +94,12 @@ let set_dns_interface _dbg name =
9594
debug "Setting DNS interface to %s" name;
9695
config := {!config with dns_interface = Some name}
9796

98-
(* Returns `true` if vs1 is older than vs2 *)
99-
let is_older_version vs1 vs2 () =
100-
try
101-
let list_of_version vs = List.map int_of_string (Astring.String.cuts ~empty:false ~sep:"." vs) in
102-
let rec loop vs1' vs2' =
103-
match vs1', vs2' with
104-
| [], _ | _, [] -> false
105-
| a :: _, b :: _ when a < b -> true
106-
| _ :: tl1, _ :: tl2 -> loop tl1 tl2
107-
in
108-
loop (list_of_version vs1) (list_of_version vs2)
109-
with _ ->
110-
warn "Failed to compare driver version.";
111-
false
112-
11397
(* The enic driver is for Cisco UCS devices. The current driver adds VLAN0 headers
11498
* to all incoming packets, which confuses certain guests OSes. The workaround
11599
* constitutes adding a VLAN0 Linux device to strip those headers again.
116100
*)
117101
let need_enic_workaround () =
118-
!backend_kind = Bridge && List.mem "enic" (Sysfs.list_drivers ()) && (!enic_workaround_until_version <> "") && (
119-
match Sysfs.get_driver_version "enic" () with
120-
| Some vs -> (is_older_version vs !enic_workaround_until_version ())
121-
| None -> false )
102+
!backend_kind = Bridge && List.mem "enic" (Sysfs.list_drivers ())
122103

123104
module Sriov = struct
124105
open S.Sriov

networkd/networkd.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ let resources = [
5050
let options = [
5151
"monitor_whitelist", Arg.String (fun x -> Network_monitor_thread.monitor_whitelist := Astring.String.cuts ~empty:false ~sep:"," x), (fun () -> String.concat "," !Network_monitor_thread.monitor_whitelist), "List of prefixes of interface names that are to be monitored";
5252
"mac-table-size", Arg.Set_int Network_utils.mac_table_size, (fun () -> string_of_int !Network_utils.mac_table_size), "Default value for the mac-table-size openvswitch parameter (see ovs-vswitchd.conf.db.5)";
53-
"enic-workaround-until-version", Arg.Set_string Network_server.enic_workaround_until_version, (fun () -> !Network_server.enic_workaround_until_version), "The version till enic driver workaround will be applied or the version set to an empty string for not applying the workaround.";
5453
"pvs-proxy-socket", Arg.Set_string Network_server.PVS_proxy.path, (fun () -> !Network_server.PVS_proxy.path), "Path to the Unix domain socket for the PVS-proxy daemon";
5554
"igmp-query-maxresp-time", Arg.Set_string Network_utils.igmp_query_maxresp_time, (fun () -> !Network_utils.igmp_query_maxresp_time), "Maximum Response Time in IGMP Query message to send";
5655
"enable-ipv6-mcast-snooping", Arg.Bool (fun x -> Network_utils.enable_ipv6_mcast_snooping := x), (fun () -> string_of_bool !Network_utils.enable_ipv6_mcast_snooping), "IPv6 multicast snooping toggle";

0 commit comments

Comments
 (0)