iflib: support for transmit side nic KTLS offload
This change adds support to iflib for drivers that want to do
transmit-side NIC ktls offload. This change does 2 things:
- Extends the pkt info to include an optional mbuf pointer.
This gives drivers the ability to find the start of a TLS record if
they need to re-DMA part of the record to re-construct TLS state on
the NIC. This mbuf pointer is only passed when CSUM_SND_TAG is
present on the pkthdr. Note that I don't bother to inspect the send
tag on purpose; this will only be present for TLS offloaded or paced
connections
- Allows the driver to specify how much ring padding is needed before the ring is considered to be full using the new isc_tx_pad field in if_softc_ctx.
This re-uses a field that was marked spare in 2019 via d49e83eac3baf.
Iflib initializes this to the previous value of 2 slots and allows the
driver to override it. The TXQ_AVAIL() macro has been adjusted to
subtract this padding, and uses of the macro have removed +2 from the
other side of the comparison. To avoid potential cache misses from
looking at the ifc_softc_ctx in TXQ_AVAIL(), the value is mirrored in
the txq (in an alignment hole).
Reviewed by: kbowling, kgalazka, sumit.saxena_broadcom.com, shurd
Sponsored by: Netflix
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D54274
(cherry picked from commit 43d7ee540efe0df1def80ce24255b32f9f9396ba)