Page MenuHomeFreeBSD

Fix special case in ip_fragment() to produce a more sensible chain of packets
AbandonedPublic

Authored by • hselasky on Feb 18 2015, 10:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 17, 7:49 PM
Unknown Object (File)
Thu, Sep 17, 4:12 PM
Unknown Object (File)
Thu, Sep 17, 4:06 PM
Unknown Object (File)
Thu, Sep 17, 4:06 PM
Unknown Object (File)
Thu, Sep 17, 4:02 PM
Unknown Object (File)
Wed, Sep 16, 5:04 PM
Unknown Object (File)
Wed, Sep 16, 2:38 PM
Unknown Object (File)
Sun, Sep 13, 3:23 AM
Subscribers

Details

Reviewers
ken
glebius
Group Reviewers
network
Summary

When the MTU on a network adapter is greater than PAGE_SIZE a special case in ip_fragment() can kick in to optimise the payloads.

Setup:
MTU = 5K
PAGE_SIZE = 4K

Send a ping packet of 7K.
The receive of the network adapter can use multiple MBUFs to receive a 7K payload, for example:
2k + 4k + 1k
When the packet gets echoed back, we end up in ip_fragment() which the split the packets oddly, because it assumes that each MBUF in the m_next chain ends on an MTU, which is not a requirement?!
This patch fixes the computation, so that the resulting transmitted packet chain will look like:
4k + 3k

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

• hselasky updated this revision to Diff 3838.
• hselasky retitled this revision from to Fix special case in ip_fragment() to produce a more sensible chain of packets.
• hselasky updated this object.
• hselasky edited the test plan for this revision. (Show Details)
• hselasky set the repository for this revision to rS FreeBSD src repository - subversion.
• hselasky added reviewers: network, glebius.
• hselasky set the repository for this revision to rS FreeBSD src repository - subversion.
• hselasky added a subscriber: Unknown Object (MLST).

Add full context.

This is Ken's code, we probably want him to look at. Looks like a remnant from zero copy era.

It looks okay to me. The surrounding code has changed a good bit since that was committed in 2002. By the way, I think Drew Gallatin originally wrote that chunk of code, but I can't remember for sure.

Committed to FreeBSD-head in r279281.