Page MenuHomeFreeBSD

Optimize the TSO and copy paths to use the new tcp_m_copy routine
ClosedPublic

Authored by rrs on Jun 20 2018, 8:29 PM.

Details

Summary

The TCP stack currently runs through the list of mbufs sizing
for TSO and then again for the actual copy out to the new
mbuf chain being passed down to IP. This causes double the
number of cache hits as we walk the mbuf chains.

For Rack a new tcp_m_copy() module was introduced that
optimizes this so the copy does both copy and size limiting
for TSO at the same time.

This change brings the use of that function into the main stack. Note
that NF has been using this in both rack and the main stack for a couple
of years now. This also paves the way for Drew Gallatin's new mbufs and
the TLS sendfile feature that uses those.

Test Plan

Bring it all up, which I have, and do some tcp connections
and network activity to make sure the stack works.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

rrs created this revision.Jun 20 2018, 8:29 PM
gallatin accepted this revision.

I added Hans since it is mostly his code we are factoring out.

kbowling accepted this revision.Jun 20 2018, 8:50 PM
kbowling added a subscriber: kbowling.

I've deployed a variant of this widely at LLNW on the default stack as well. I think you can garbage collect sbsndptr() from the tree.

This revision is now accepted and ready to land.Jun 20 2018, 8:50 PM

I've deployed a variant of this widely at LLNW on the default stack as well. I think you can garbage collect sbsndptr() from the tree.

The cxgbe TOE stuff uses it

hselasky accepted this revision.Jun 21 2018, 7:28 AM

Looks good to me.

This revision was automatically updated to reflect the committed changes.