HomeFreeBSD

ktls: Fix accounting for TLS 1.0 empty fragments.

Description

ktls: Fix accounting for TLS 1.0 empty fragments.

TLS 1.0 empty fragment mbufs have no payload and thus m_epg_npgs is
zero. However, these mbufs need to occupy a "unit" of space for the
purposes of M_NOTREADY tracking similar to regular mbufs. Previously
this was done for the page count returned from ktls_frame() and passed
to ktls_enqueue() as well as the page count passed to pru_ready().

However, sbready() and mb_free_notready() only use m_epg_nrdy to
determine the number of "units" of space in an M_EXT mbuf, so when a
TLS 1.0 fragment was marked ready it would mark one unit of the next
mbuf in the socket buffer as ready as well. To fix, set m_epg_nrdy to
1 for empty fragments. This actually simplifies the code as now only
ktls_frame() has to handle TLS 1.0 fragments explicitly and the rest
of the KTLS functions can just use m_epg_nrdy.

Reviewed by: gallatin
MFC after: 2 weeks
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D31536

Details

Provenance
jhbAuthored on Aug 16 2021, 5:42 PM
Reviewer
gallatin
Differential Revision
D31536: ktls: Fix accounting for TLS 1.0 empty fragments.
Parents
rG69e8e8ea3d4b: e1000: always enable PCSD when RSS hashing
Branches
Unknown
Tags
Unknown