Page MenuHomeFreeBSD

Allow in_cksum_skip() to operate on unmapped mbufs
AbandonedPublic

Authored by markj on Nov 5 2021, 9:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 24, 5:38 PM
Unknown Object (File)
Sat, Jan 18, 5:52 PM
Unknown Object (File)
Dec 8 2024, 11:33 PM
Unknown Object (File)
Nov 16 2024, 8:15 PM
Unknown Object (File)
Nov 12 2024, 2:13 AM
Unknown Object (File)
Nov 12 2024, 1:35 AM
Unknown Object (File)
Oct 7 2024, 2:39 PM
Unknown Object (File)
Oct 2 2024, 10:11 AM
Subscribers

Details

Reviewers
None
Summary

We have a plethora of mb_unmapped_to_ext() calls in the network stack to
work around the fact that in_cksum() doesn't work with unmapped mbufs.
However, m_apply() now works on unmapped mbufs, so we can implement
in_cksum_skip() in a way that doesn't require the mbuf to be mapped.

TODO:

- Make in_cksum_skip() MI, there is nothing machine dependent about
  traversing an mbuf chain.
- Make m_apply() handle platforms without a direct map.  sendfile may
  use M_EXTPG mbufs even on such platforms.  We can make a CPU-private
  mapping using sfbufs.  Though, I wonder about the utility of using
  unmapped mbufs on such platforms, maybe it should just be disabled.
  Much like rpctls_getinfo() bails if PMAP_HAS_DMAP == 0.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42620
Build 39508: arc lint + arc unit

Event Timeline

markj requested review of this revision.Nov 5 2021, 9:49 PM

I think I agree with just disabling unmapped mbufs on platforms without a direct map.

In D32859#743898, @jhb wrote:

I think I agree with just disabling unmapped mbufs on platforms without a direct map.

Indeed, done in D32940, for posterity.

I have a more complete version of this patch almost ready. It consolidates most of the machdep in_cksum.cs into sys/netinet/in_cksum.c, and imports a new MI inet checksum implementation from NetBSD. (The existing one also came from NetBSD.)