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
-
20
+ # T6716: Honor the configured offload settings and don't automacially add
21
+ # them to the config if the kernel has them set.
21
22
from vyos .ethtool import Ethtool
22
23
from vyos .configtree import ConfigTree
23
24
@@ -36,44 +37,34 @@ def activate(config: ConfigTree):
36
37
enabled , fixed = eth .get_generic_receive_offload ()
37
38
if configured and fixed :
38
39
config .delete (base + [ifname , 'offload' , 'gro' ])
39
- elif enabled and not fixed :
40
- config .set (base + [ifname , 'offload' , 'gro' ])
41
40
42
41
# If GSO is enabled by the Kernel - we reflect this on the CLI. If GSO is
43
42
# enabled via CLI but not supported by the NIC - we remove it from the CLI
44
43
configured = config .exists (base + [ifname , 'offload' , 'gso' ])
45
44
enabled , fixed = eth .get_generic_segmentation_offload ()
46
45
if configured and fixed :
47
46
config .delete (base + [ifname , 'offload' , 'gso' ])
48
- elif enabled and not fixed :
49
- config .set (base + [ifname , 'offload' , 'gso' ])
50
47
51
48
# If LRO is enabled by the Kernel - we reflect this on the CLI. If LRO is
52
49
# enabled via CLI but not supported by the NIC - we remove it from the CLI
53
50
configured = config .exists (base + [ifname , 'offload' , 'lro' ])
54
51
enabled , fixed = eth .get_large_receive_offload ()
55
52
if configured and fixed :
56
53
config .delete (base + [ifname , 'offload' , 'lro' ])
57
- elif enabled and not fixed :
58
- config .set (base + [ifname , 'offload' , 'lro' ])
59
54
60
55
# If SG is enabled by the Kernel - we reflect this on the CLI. If SG is
61
56
# enabled via CLI but not supported by the NIC - we remove it from the CLI
62
57
configured = config .exists (base + [ifname , 'offload' , 'sg' ])
63
58
enabled , fixed = eth .get_scatter_gather ()
64
59
if configured and fixed :
65
60
config .delete (base + [ifname , 'offload' , 'sg' ])
66
- elif enabled and not fixed :
67
- config .set (base + [ifname , 'offload' , 'sg' ])
68
61
69
62
# If TSO is enabled by the Kernel - we reflect this on the CLI. If TSO is
70
63
# enabled via CLI but not supported by the NIC - we remove it from the CLI
71
64
configured = config .exists (base + [ifname , 'offload' , 'tso' ])
72
65
enabled , fixed = eth .get_tcp_segmentation_offload ()
73
66
if configured and fixed :
74
67
config .delete (base + [ifname , 'offload' , 'tso' ])
75
- elif enabled and not fixed :
76
- config .set (base + [ifname , 'offload' , 'tso' ])
77
68
78
69
# Remove deprecated UDP fragmentation offloading option
79
70
if config .exists (base + [ifname , 'offload' , 'ufo' ]):
0 commit comments