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 9, 9:40 AM
Unknown Object (File)
Mon, Sep 7, 2:01 PM
Unknown Object (File)
Sun, Sep 6, 1:40 PM
Unknown Object (File)
Sun, Sep 6, 1:05 PM
Unknown Object (File)
Sun, Sep 6, 12:04 PM
Unknown Object (File)
Sat, Sep 5, 7:27 PM
Unknown Object (File)
Sat, Sep 5, 1:10 PM
Unknown Object (File)
Thu, Sep 3, 7:59 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.)