Hacker News new | ask | show | jobs
by kazarov 3480 days ago
Makes sense, but it doesn't have to be mutually exclusive. It is possible to have a fixed network driver interface, and some common helpers orthogonal to it. This way driver developers could chose whether to benefit from common code or not. I guess if linux developer want to enforce code sharing, this wouldn't work, but I wonder why they would do it. Seems like it just makes life harder for both parties.
2 comments

Many network drivers in Linux do opt out of the common frameworks, and changes like BQL [0] and some of the recent WiFi restructuring [1] that require driver-level modifications are usually not introduced as a mandatory compatibility break that requires modifying every driver at once.

Sometimes drivers opt out because the hardware is odd enough that it needs to do things differently, or because it offloads to hardware (or proprietary firmware) functionality that is usually done in software. But often, it's just because a driver was written in isolation by the manufacturer and then dumped on the community. (See [2], from the comments in [1], about the work required to clean up some Realtek WiFi drivers enough to be merged to the kernel staging area.) If a driver unnecessarily opts out of common frameworks and does things internally and differently, it can be hard to even evaluate whether problems fixed in the standard frameworks exist in the special snowflake drivers. Even after identifying a problem, the recipes that worked to fix the standard drivers won't apply.

[0] https://lwn.net/Articles/454390/

[1] https://lwn.net/Articles/705884/

[2] https://www.linuxplumbersconf.org/2016/ocw//system/presentat...

Linux very intentionally and explicitly do not guarantee a stable interface for drivers. If you want to maintain your driver out of tree, then that's your right, but you have to be prepared for Linux kernel maintainers to break your driver regularly. The point is they are not interested in sacrificing ability to improve the kernel just in order to make it easier for people to maintain proprietary drivers.

Proprietary drivers are tolerated, not liked, and people aren't interested in making it easier for them.

Except that this is in no way specific to proprietary drivers. Lack of a stable interface makes maintaining ALL drivers harder.
These interfaces aren't broken gratuitously. They change to accommodate new features or to allow for better code reuse within the kernel. In the long term it's only a significant maintenance burden compared to letting the driver stagnate and never gain new functionality or optimization after initial release. Manufacturers might prefer that development model since it helps sell more chips of the next generation, but it's really not what should be used as the baseline.
You only have to fix your driver if it's outside the kernel tree. Drivers in the tree get fixed by whoever's making the breaking change (which is why it's important that certain hackers be able to read and understand all related drivers).