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)
Wed, Sep 18, 2:44 PM
Unknown Object (File)
Mon, Sep 16, 4:00 PM
Unknown Object (File)
Mon, Sep 16, 8:17 AM
Unknown Object (File)
Thu, Sep 5, 6:14 AM
Unknown Object (File)
Mon, Sep 2, 3:51 AM
Unknown Object (File)
Mon, Sep 2, 3:18 AM
Unknown Object (File)
Aug 16 2024, 11:27 PM
Unknown Object (File)
Aug 10 2024, 10:10 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.)