Page MenuHomeFreeBSD

iflib: handle transient errors from isc_txd_encap()
Needs ReviewPublic

Authored by gallatin on Fri, Jun 12, 3:38 PM.
Tags
None
Referenced Files
F159478192: D57550.diff
Sun, Jun 14, 4:35 PM
Unknown Object (File)
Sat, Jun 13, 4:25 PM

Details

Summary

Until we introduced support for nic ktls offload, all error returns from isc_txd_encap() indicated
a permanent failure. Iflib remapped all those failures to ENOMEM, which was treated by the
tcp stack as a permanent error and passed back to the caller. This was done to avoid creating
"infinite loops" where a packet couldn't be mapped for transmit, and kept being sent over and over.

Now that we have support for nic ktls offload, some ktls offload drivers may return ENOBUFS from
their encap function to indicate that, for example, the ktls context may not yet be fully initialized.
This needs to be treated as a transient error so that the TCP stack may re-try at a later time. To
achieve this, pass the raw error back to the caller when the encap routine returns an error aside
from EFBIG.

Note that I audited all in-tree iflib drivers. Only ice and ixl ran return anything other than 0 from
their encap, which is EFBIG. both of which are still treated as they were before.

Testing with an out-of-tree ktls offload nic using iflib showed ENOMEM errors from sendmsg() before
this change, and no more errors passed back to userspace after this change.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped