New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 810916 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

preload-network.conf is racy

Project Member Reported by briannorris@chromium.org, Feb 9 2018

Issue description

/etc/init/preload-network.conf tries to save which network drivers have been in use on this system previously, and preloads those manually. It starts on 'starting boot-services', to give it a chance to load drivers very early (if we stashed anything in /var/lib/...), and it stops on 'stopped udev-trigger', to try and collect (and stash) info about any loaded network drivers after udev has finished loading network drivers.

That, however, assumes that when udev has finished, that we have all our /sys/class/net/ devices available. This doesn't work, though, since most Wifi drivers don't have their net device ready by the time they finish probing -- they fork off an asynchronous task to load any Wifi firmware, and create the net device only after that has succeeded.

IOW, the 'post-stop script' in preload-network.conf races with the completion of Wifi driver initialization.

This means that on many devices, /var/lib/preload-network-drivers is empty or only contains an ethernet driver. e.g., on my systems with QCA Wifi, I only see the USB ethernet driver there:

# cat /var/lib/preload-network-drivers                                                                                         
r8152

and same on my Marvell Wifi systems:

# cat /var/lib/preload-network-drivers
r8152


If I go back and rerun this well after booting, only *then* does it pick up my Wifi driver:

# start preload-network                                                                                                        
preload-network start/running
# stop preload-network                                                                                                         
preload-network stop/waiting
# cat /var/lib/preload-network-drivers                                                                                         
ath10k_pci r8152


We could probably replace the 'post-stop' stuff with a udev rule or something, couldn't we? That would then work to cache network drivers no matter when they load.
 

Comment 1 by grundler@google.com, Feb 10 2018

Status: Available (was: Untriaged)
Yes - good observation - and it doesn't matter when we record which NICs are in use. I think you proposal for a udev rule could work assuming we only record when "net" devices are added.

How to handle removal isn't clear to me right now. Seems the script would have to know if the removal was intentional (unplugging a usb device) or "incidental" (WIFI FW hangs and we have to remove/reload the driver to reset the device.)
Labels: Enterprise-Triaged

Sign in to add a comment