17
17
# CLI. See https://vyos.dev/T3619#102254 for all the details.
18
18
# T3787: Remove deprecated UDP fragmentation offloading option
19
19
# T6006: add to activation-scripts: migration-scripts/interfaces/20-to-21
20
+ # T6716: Honor the configured offload settings and don't automatically add
21
+ # them to the config if the kernel has them set (unless its a live boot)
20
22
21
23
from vyos .ethtool import Ethtool
22
24
from vyos .configtree import ConfigTree
25
+ from vyos .system .image import is_live_boot
23
26
24
27
def activate (config : ConfigTree ):
25
28
base = ['interfaces' , 'ethernet' ]
@@ -36,7 +39,7 @@ def activate(config: ConfigTree):
36
39
enabled , fixed = eth .get_generic_receive_offload ()
37
40
if configured and fixed :
38
41
config .delete (base + [ifname , 'offload' , 'gro' ])
39
- elif enabled and not fixed :
42
+ elif is_live_boot () and enabled and not fixed :
40
43
config .set (base + [ifname , 'offload' , 'gro' ])
41
44
42
45
# If GSO is enabled by the Kernel - we reflect this on the CLI. If GSO is
@@ -45,7 +48,7 @@ def activate(config: ConfigTree):
45
48
enabled , fixed = eth .get_generic_segmentation_offload ()
46
49
if configured and fixed :
47
50
config .delete (base + [ifname , 'offload' , 'gso' ])
48
- elif enabled and not fixed :
51
+ elif is_live_boot () and enabled and not fixed :
49
52
config .set (base + [ifname , 'offload' , 'gso' ])
50
53
51
54
# If LRO is enabled by the Kernel - we reflect this on the CLI. If LRO is
@@ -54,7 +57,7 @@ def activate(config: ConfigTree):
54
57
enabled , fixed = eth .get_large_receive_offload ()
55
58
if configured and fixed :
56
59
config .delete (base + [ifname , 'offload' , 'lro' ])
57
- elif enabled and not fixed :
60
+ elif is_live_boot () and enabled and not fixed :
58
61
config .set (base + [ifname , 'offload' , 'lro' ])
59
62
60
63
# If SG is enabled by the Kernel - we reflect this on the CLI. If SG is
@@ -63,7 +66,7 @@ def activate(config: ConfigTree):
63
66
enabled , fixed = eth .get_scatter_gather ()
64
67
if configured and fixed :
65
68
config .delete (base + [ifname , 'offload' , 'sg' ])
66
- elif enabled and not fixed :
69
+ elif is_live_boot () and enabled and not fixed :
67
70
config .set (base + [ifname , 'offload' , 'sg' ])
68
71
69
72
# If TSO is enabled by the Kernel - we reflect this on the CLI. If TSO is
@@ -72,7 +75,7 @@ def activate(config: ConfigTree):
72
75
enabled , fixed = eth .get_tcp_segmentation_offload ()
73
76
if configured and fixed :
74
77
config .delete (base + [ifname , 'offload' , 'tso' ])
75
- elif enabled and not fixed :
78
+ elif is_live_boot () and enabled and not fixed :
76
79
config .set (base + [ifname , 'offload' , 'tso' ])
77
80
78
81
# Remove deprecated UDP fragmentation offloading option
0 commit comments