fw4: fix logic flaw in testing hw flow offloading support
authorJo-Philipp Wich <jo@mein.io>
Mon, 30 May 2022 18:44:17 +0000 (20:44 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 30 May 2022 18:44:17 +0000 (20:44 +0200)
The revised logic failed to account for cases where zero offload capable
devices where resolved, in this case the capability check was not performed
at all.

Fixes: #9935
Fixes: 57984e0 ("fw4: always resolve lower flowtable devices")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
root/usr/share/ucode/fw4.uc

index 02341cb5af68aaffeea6a6e09071a803447a7ba4..be347d7cf03060d62aec45e42368bb32d2ebf362 100644 (file)
@@ -462,17 +462,15 @@ return {
                                for (let device in zone.related_physdevs)
                                        push(devices, ...resolve_lower_devices(devstatus, device, true));
 
-                       if (length(devices)) {
-                               devices = sort(uniq(devices));
+                       devices = sort(uniq(devices));
 
-                               if (nft_try_hw_offload(devices))
-                                       return devices;
+                       if (length(devices) && nft_try_hw_offload(devices))
+                               return devices;
 
-                               this.warn('Hardware flow offloading unavailable, falling back to software offloading');
-                               this.state.defaults.flow_offloading_hw = false;
+                       this.warn('Hardware flow offloading unavailable, falling back to software offloading');
+                       this.state.defaults.flow_offloading_hw = false;
 
-                               devices = [];
-                       }
+                       devices = [];
                }
 
                for (let zone in this.zones())