Page MenuHomeFreeBSD

iflib: update rs_pending based on descriptors consumed by isc_txd_encap
ClosedPublic

Authored by gallatin on Wed, Sep 2, 1:01 PM.
Tags
None
Referenced Files
F170861825: D59321.diff
Mon, Sep 7, 2:49 AM
F170841473: D59321.id185620.diff
Sun, Sep 6, 11:38 PM
F170835037: D59321.diff
Sun, Sep 6, 10:38 PM
Unknown Object (File)
Sun, Sep 6, 12:28 PM
Unknown Object (File)
Sun, Sep 6, 5:44 AM
Unknown Object (File)
Sun, Sep 6, 5:31 AM
Unknown Object (File)
Sun, Sep 6, 4:07 AM
Unknown Object (File)
Sat, Sep 5, 9:36 PM

Details

Summary

The new watchdog code is triggering spurious watchdog resets on my out-of-tree NICs using ktls.

The issue is that rs_pending is updated using the descriptors for the current packet, based on what bus_dma produced.
However, NICs which support ktls offload may do extra DMAs (and consume extra segs) to derive crypto state when re-transmitting
TLS segments. This is the reason for allowing drivers to control ift_pad. When this happens, rs_pending may
be undercounted. This was harmless before, but is causing spurious watchdog resets now.

Fix this by using the actual segments consumed by the NICs isc_txd_encap.

Note this removes this historical overcount by one.

This patch has been stable on my test hardware (in combination with https://reviews.freebsd.org/D59204)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I think this is a strict accounting improvement. e1000 manufactures some descriptors in a couple situations to work around hw errata, although I'm not sure that direct RS wb would've faulted.

This revision is now accepted and ready to land.Wed, Sep 2, 4:38 PM
kgalazka added inline comments.
sys/net/iflib.c
2462

nit: extra dot

3771–3775

@kbowling Fixed honoring IPI_TX_INTR in IAVF and IXL, but ICE still ignores it. I'll take care of that. Do you think this can cause any issues until ICE is fixed?

sys/net/iflib.c
3771–3775

See D58910. Without D58910 ice does RS wb for every packet, and the watchdog is a little less sensitive, but no false watchdog risk and these can land in any order.