Page MenuHomeFreeBSD

loopback: set MTU to IF_MAXMTU
AcceptedPublic

Authored by glebius on Sat, Sep 5, 5:22 PM.
Tags
None
Referenced Files
F171044254: D59450.diff
Tue, Sep 8, 9:08 AM
F170964057: D59450.id185970.diff
Mon, Sep 7, 9:45 PM
F170895454: D59450.id185970.diff
Mon, Sep 7, 9:45 AM
F170894532: D59450.diff
Mon, Sep 7, 9:34 AM
F170893720: D59450.id185970.diff
Mon, Sep 7, 9:24 AM
F170893460: D59450.id185970.diff
Mon, Sep 7, 9:21 AM
Unknown Object (File)
Mon, Sep 7, 9:00 AM
Unknown Object (File)
Sun, Sep 6, 1:02 AM

Details

Reviewers
tuexen
Group Reviewers
network
transport
Summary

It was temporarily reduced in af78195e0024 in 1994 to hide some bugs with
signed short overflow. We believe all these bugs were sorted out by
today. :)

Note that earlier ba582a82b0e36 reduced the MTU be rounded to a longword
with a reference "NFS likes it to be rounded". We have had several
refactors of the NFS code since that.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 76589
Build 73472: arc lint + arc unit

Event Timeline

I like the idea of increasing the MTU. Is there a reason why you select 0xffff? This is the maximum size of an IPv4 packet, but an IPv6 packet can have a size of 0xffff + 40. Why not use that value? Would it make sense to use a multiple of 4?

I like the idea of increasing the MTU. Is there a reason why you select 0xffff? This is the maximum size of an IPv4 packet, but an IPv6 packet can have a size of 0xffff + 40. Why not use that value? Would it make sense to use a multiple of 4?

I didn't measure, but speculatively I decided that it would be better to have it a multiple of PAGE_SIZE rather than multiple + tiny. In the second case a bulk transfer would allocate an extra page (or an mbuf, if optimized) that would be underutilized.

I like the idea of increasing the MTU. Is there a reason why you select 0xffff? This is the maximum size of an IPv4 packet, but an IPv6 packet can have a size of 0xffff + 40. Why not use that value? Would it make sense to use a multiple of 4?

I didn't measure, but speculatively I decided that it would be better to have it a multiple of PAGE_SIZE rather than multiple + tiny. In the second case a bulk transfer would allocate an extra page (or an mbuf, if optimized) that would be underutilized.

That makes sense. But don't you reserve always some additional space at the beginning of the mbuf chain for the link layer header? I also tried to set the MTU to a value larger than 65535 using ifconfig and it failed. This is because in if.c there is a check that the MTU does not exceed IF_MAXMTU.

So I suggest to use IF_MAXMTU as the default MTU instead of IP_MAXPACKET.

sys/net/if_loop.c
60

This is not needed, if you use IF_MAXMTU instead of IP_MAXPACKET.

118

Wouldn't IF_MAXMTU make more sense here?

glebius retitled this revision from loopback: set MTU to IP_MAXPACKET to loopback: set MTU to IF_MAXMTU.Sat, Sep 5, 10:22 PM
This revision is now accepted and ready to land.Sat, Sep 5, 10:50 PM