Skip to content

Commit 209d950

Browse files
authored
networkd: Remove usage of ovs-vlan-bug-workaround (#6684)
networkd had code to call ovs-vlan-bug-workaround, but this has been made obsolete as the bug in question only applies to kernels before 2.6.37, which is long out of support. We can safely remove the functionality associated with applying the workaround.
2 parents 39b166a + 53d23bb commit 209d950

File tree

2 files changed

+2
-68
lines changed

2 files changed

+2
-68
lines changed

ocaml/networkd/bin/network_server.ml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -933,12 +933,6 @@ module Bridge = struct
933933
"standalone"
934934
)
935935
in
936-
let vlan_bug_workaround =
937-
if List.mem_assoc "vlan-bug-workaround" other_config then
938-
Some (List.assoc "vlan-bug-workaround" other_config = "true")
939-
else
940-
None
941-
in
942936
let external_id =
943937
if List.mem_assoc "network-uuids" other_config then
944938
Some
@@ -966,7 +960,7 @@ module Bridge = struct
966960
Option.iter (destroy_existing_vlan_ovs_bridge dbg name) vlan ;
967961
ignore
968962
(Ovs.create_bridge ?mac ~fail_mode ?external_id ?disable_in_band
969-
?igmp_snooping vlan vlan_bug_workaround name
963+
?igmp_snooping vlan name
970964
) ;
971965
if igmp_snooping = Some true && not old_igmp_snooping then
972966
Ovs.inject_igmp_query ~name

ocaml/networkd/lib/network_utils.ml

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ let ovs_ofctl = "/usr/bin/ovs-ofctl"
5151

5252
let ovs_appctl = "/usr/bin/ovs-appctl"
5353

54-
let ovs_vlan_bug_workaround = "/usr/sbin/ovs-vlan-bug-workaround"
55-
5654
let brctl = ref "/sbin/brctl"
5755

5856
let modprobe = "/sbin/modprobe"
@@ -274,25 +272,6 @@ module Sysfs = struct
274272
Result.Error
275273
(Fail_to_get_driver_name, "Failed to get driver name for: " ^ dev)
276274

277-
(** Returns the features bitmap for the driver for [dev]. The features bitmap
278-
is a set of NETIF_F_ flags supported by its driver. *)
279-
let get_features dev =
280-
try Some (int_of_string (read_one_line (getpath dev "features")))
281-
with _ -> None
282-
283-
(** Returns [true] if [dev] supports VLAN acceleration, [false] otherwise. *)
284-
let has_vlan_accel dev =
285-
let flag_NETIF_F_HW_VLAN_TX = 128 in
286-
let flag_NETIF_F_HW_VLAN_RX = 256 in
287-
let flag_NETIF_F_VLAN =
288-
flag_NETIF_F_HW_VLAN_TX lor flag_NETIF_F_HW_VLAN_RX
289-
in
290-
match get_features dev with
291-
| None ->
292-
false
293-
| Some features ->
294-
features land flag_NETIF_F_VLAN <> 0
295-
296275
let set_multicast_snooping bridge value =
297276
try
298277
let path = getpath bridge "bridge/multicast_snooping" in
@@ -1352,44 +1331,6 @@ module Ovs = struct
13521331
)
13531332
with _ -> warn "Failed to set max-idle=%d on OVS" t
13541333

1355-
let handle_vlan_bug_workaround override bridge =
1356-
(* This is a list of drivers that do support VLAN tx or rx acceleration,
1357-
but to which the VLAN bug workaround should not be applied. This could
1358-
be because these are known-good drivers (that is, they do not have any
1359-
of the bugs that the workaround avoids) or because the VLAN bug
1360-
workaround will not work for them and may cause other problems.
1361-
1362-
This is a very short list because few drivers have been tested. *)
1363-
let no_vlan_workaround_drivers = ["bonding"] in
1364-
let phy_interfaces =
1365-
try
1366-
let interfaces = bridge_to_interfaces bridge in
1367-
List.filter Sysfs.is_physical interfaces
1368-
with _ -> []
1369-
in
1370-
List.iter
1371-
(fun interface ->
1372-
let do_workaround =
1373-
match override with
1374-
| Some value ->
1375-
value
1376-
| None -> (
1377-
match Sysfs.get_driver_name interface with
1378-
| None ->
1379-
Sysfs.has_vlan_accel interface
1380-
| Some driver ->
1381-
if List.mem driver no_vlan_workaround_drivers then
1382-
false
1383-
else
1384-
Sysfs.has_vlan_accel interface
1385-
)
1386-
in
1387-
let setting = if do_workaround then "on" else "off" in
1388-
try ignore (call_script ovs_vlan_bug_workaround [interface; setting])
1389-
with _ -> ()
1390-
)
1391-
phy_interfaces
1392-
13931334
let get_vlans name =
13941335
try
13951336
let vlans_with_uuid =
@@ -1486,13 +1427,12 @@ module Ovs = struct
14861427
["--"; "--may-exist"; "add-port"; bridge; name] @ type_args
14871428

14881429
let create_bridge ?mac ?external_id ?disable_in_band ?igmp_snooping
1489-
~fail_mode vlan vlan_bug_workaround name =
1430+
~fail_mode vlan name =
14901431
let vlan_arg =
14911432
match vlan with
14921433
| None ->
14931434
[]
14941435
| Some (parent, tag) ->
1495-
handle_vlan_bug_workaround vlan_bug_workaround parent ;
14961436
[parent; string_of_int tag]
14971437
in
14981438
let mac_arg =

0 commit comments

Comments
 (0)