Hunting a bug in the i40e Intel driver
blog.cri.epita.fr
blog.cri.epita.fr
Reminds me of the various i40e Tx freezes I debugged while at Joyent. Granted, this is the illumos driver, not Intel's, but basically there were issues with the programming guide that I had to figure out the hard way. The 700-series controllers have not been the easiest to work with.
https://smartos.org/bugview/OS-7492 [Tx freeze when b_cont chain exceeds 8 descriptors]
https://smartos.org/bugview/OS-7457 [i40e Tx freezes on zero descriptors]
They had a routine (ixl_tso_detect_sparse()) which was AFU. I wrote a userspace unit test that proved it was AFU, and then fixed it. I fed them back the routine & the unit test, and they hilariously left my commented debug prints in the routine.
https://github.com/freebsd/freebsd-src/blob/412b5e40a721430a...
And their 100GbE NIC has the same limit, which is just so sad. All these fancy features, and they cannot handle 8 segments per emitted packet on the wire.
Malicious Driver Detection
My reaction upon reading that line was "WTF." I haven't touched NIC drivers beyond the classic NE2000s, common Realteks, and the Intel 8254x, but it seems strange to have some sort of... antimalware feature in a NIC? Reminds me of the old BIOSes with "boot sector antivirus".
The bastards at VMware kept the buggy driver on their hardware compatibility list and kept shipping it for multiple versions probably a year later.
This commit in upstream ends up getting split in half:
https://github.com/torvalds/linux/commit/8ce29c679a6ecefb88d...
With only 3 lines of it getting pulled into i40e-2.13.10:
https://github.com/dmarion/i40e/blob/master/src/i40e_txrx.c#...
https://github.com/dmarion/i40e/blob/master/src/i40e_txrx.c#...
(Can't link git diff line for 2.13.10->2.14.13 because diff is too big, annoying!)
And the final line getting pulled into i40e-2.14.13:
https://github.com/dmarion/i40e/commit/135d6d885aa4704180e10...
--- if (unlikely(!pagecnt_bias)) {
+++ if (unlikely(pagecnt_bias == 1)) {
Best thing I can find in i40e_txrx.c where a single patch in Linux upstream got split across 2.13.10 and 2.14.13. Not a smoking gun exactly, still some exercise left for the reader.That's still a form of debugging. It's all a matter of perspective. If you had a hardware device that you were interacting directly with in an applicaiton, and you found that if you utilized in in a specific way it crashed, so you changed how the application used it so it wouldn't crash, that would be debugging the application, even if not really debugging the hardware.