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)
Fri, Mar 7, 5:23 PM
Unknown Object (File)
Mon, Mar 3, 7:24 AM
Unknown Object (File)
Mon, Mar 3, 7:11 AM
Unknown Object (File)
Jan 23 2025, 5:33 AM
Unknown Object (File)
Jan 23 2025, 5:02 AM
Unknown Object (File)
Jan 14 2025, 1:11 AM
Unknown Object (File)
Jan 9 2025, 12:50 AM
Unknown Object (File)
Dec 8 2024, 3:55 PM
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.