Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Oct 2012 12:25:59 -0600
From:      Sebastian Kuzminsky <seb@lineratesystems.com>
To:        freebsd-net@freebsd.org
Subject:   fragmentation problem in FreeBSD 7
Message-ID:  <CAN=597Rb-ToBQuJ%2BYet9e25Hbt-QmLJPKUXGf1pFEbVsRvFONg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--047d7b1605050ef51d04ccbe1a2c
Content-Type: text/plain; charset=ISO-8859-1

Hi folks, this is my first post to freebsd-net, and my first bug-fix
submission...  I hope this is the right mailing list for this issue, and
the right format for sending in patches....

I'm working on a derivative of FreeBSD 7.

I've run into a problem with IP header checksums when fragmenting to an
e1000 (em) interface, and I've narrowed it down to a very simple test.  The
test setup is like this:

    [computer A]---(network 1)---[computer B]---(network 2)---[computer C]

That gorgeous drawing shows computer A connected to computer B via network
1, and computer B connected to computer C via network 2.  Computer B is set
up to forward packets between networks 1 and 2.  A can see B but not C.  C
can see B but not A.  B forwards between A and C.  Pretty simple.

One of B's NICs is a Broadcom, handled by the bce driver; this one works
fine in all my testing.

B's other NIC is an Intel PRO/1000 handled by the em driver.  This is the
one giving me trouble.

The test disables PMTUD on all three hosts.  It then sets the MTU of the
bce and em interfaces to the unrealistically low value of 72 bytes, and
tries to pass TCP packets back and forth using nc on computers A and C
(with computer B acting as a gateway).  This is to force the B gateway to
fragment the TCP frames it forwards.

Receiving on the em and sending on the bce works just fine (as noted
above).  Small TCP frames that fit in the MTU, big TCP frames that get
fragmented, no problems.

Receiving on the bce and sending on the em interface works fine for small
TCP frames that don't need fragmentation, but when B has to fragment the IP
packets before sending them out the em, the IP header checksums in the IP
packets that appear on the em's wires are wrong.  I came to this conclusion
by packet capture and by watching the 'bad header checksums' counter of
'netstat -s -p ip', both running on the computer receiving the fragments.


Ok, those are all my observations, next comes thoughts about the cause & a
proposed fix.


The root of the problem is two-fold:

1.  ip_output.c:ip_fragment() does not clear the CSUM_IP flag in the mbuf
when it does software IP checksum computation, so the mbuf still looks like
it needs IP checksumming.

2. The em driver does not advertise IP checksum offloading, but still
checks the CSUM_IP flag in the mbuf and modifies the packet when that flag
is set (this is in em_transmit_checksum_setup(), called by em_xmit()).
 Unfortunately the em driver gets the checksum wrong in this case, i guess
that's why it doesn't advertise this capability in its if_hwassist!

So the fragments that ip_fastfwd.c:ip_fastforward() gets from
ip_output.c:ip_fragment() have ip->ip_sum set correctly, but the
mbuf->m_pkthdr.csum_flags incorrectly has CSUM_IP still set, and this
causes the em driver to emit incorrect packets.

There are some other callers of ip_fragment(), notably ip_output().
 ip_output() clears CSUM_IP in the mbuf csum_flags itself if it's not in
if_hwassist, so avoids this problem.

So, the fix is simple: clear the mbuf's CSUM_IP when computing ip->ip_sum
in ip_fragment().  The first attached patch (against
gitorious/svn_stable_7) does this.

In looking at this issue, I noticed that ip_output()'s use of sw_csum is
inconsistent.  ip_output() splits the mbuf's csum_flags into two parts: the
stuff that hardware will assist with (these flags get left in the mbuf) and
the stuff that software needs to do (these get moved to sw_csum).  But
later ip_output() calls functions that don't get sw_csum, or that don't
know to look in it and look in the mbuf instead.  My second patch fixes
these kinds of issues and (IMO) simplifies the code by leaving all the
packet's checksumming needs in the mbuf, getting rid of sw_csum entirely.


-- 
Sebastian Kuzminsky
Linerate Systems

--047d7b1605050ef51d04ccbe1a2c
Content-Type: application/octet-stream; 
	name="0001-Update-the-mbuf-csum_flags-of-IP-fragments-when-comp.patch"
Content-Disposition: attachment; 
	filename="0001-Update-the-mbuf-csum_flags-of-IP-fragments-when-comp.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_h8nbm4sn0

RnJvbSBjMDRhN2E5NTg5MGVmNWQwMzJlNjk5ODY3NTQ5NmJiNDM4YzNhMTRiIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBTZWJhc3RpYW4gS3V6bWluc2t5IDxzZWJAbGluZXJhdGVzeXN0
ZW1zLmNvbT4KRGF0ZTogTW9uLCAyMiBPY3QgMjAxM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YgPSBodG9ucyhtaGlwLT5pcF9vZmYpOwogCQltaGlwLT5p
cF9zdW0gPSAwOwotCQlpZiAoc3dfY3N1bSAmIENTVU1fREVMQVlfSVApCisJCWlmIChzd19jc3Vt
ICYgQ1NVTV9ERUxBWV9JUCkgewogCQkJbWhpcC0+aXBfc3VtID0gaW5fY2tzdW0obSwgbWhsZW4p
OworCQkJbS0+bV9wa3RoZHIuY3N1bV9mbGFncyAmPSB+Q1NVTV9ERUxBWV9JUDsKKwkJfQogCQkq
bW5leHQgPSBtOwogCQltbmV4dCA9ICZtLT5tX25leHRwa3Q7CiAJfQpAQCAtNzY0LDggKzc4OCwx
MCBAQCBzbWFydF9mcmFnX2ZhaWx1cmU6CiAJaXAtPmlwX29mZiB8PSBJUF9NRjsKIAlpcC0+aXBf
b2ZmID0gaHRvbnMoaXAtPmlwX29mZik7CiAJaXAtPmlwX3N1bSA9IDA7Ci0JaWYgKHN3X2NzdW0g
JiBDU1VNX0RFTEFZX0lQKQorCWlmIChzd19jc3VtICYgQ1NVTV9ERUxBWV9JUCkgewogCQlpcC0+
aXBfc3VtID0gaW5fY2tzdW0obTAsIGhsZW4pOworCQltMC0+bV9wa3RoZHIuY3N1bV9mbGFncyAm
PSB+Q1NVTV9ERUxBWV9JUDsKKwl9CiAKIGRvbmU6CiAJKm1fZnJhZyA9IG0wOwotLSAKMS43Ljgu
MwoK
--047d7b1605050ef51d04ccbe1a2c
Content-Type: application/octet-stream; 
	name="0002-Simplify-the-tracking-of-mbuf-checksumming-needs.patch"
Content-Disposition: attachment; 
	filename="0002-Simplify-the-tracking-of-mbuf-checksumming-needs.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_h8nbm4ss1

RnJvbSBlYmJiZDdhZDY0YTFjYWZkOWE0YjExODJlZGUxODJmYmMzNzNiNTI5IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBTZWJhc3RpYW4gS3V6bWluc2t5IDxzZWJAbGluZXJhdGVzeXN0
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i0JICAgIHVfbG9uZyBpZl9od2Fzc2lzdF9mbGFncywgaW50
IHN3X2NzdW0pOworCSAgICB1X2xvbmcgaWZfaHdhc3Npc3RfZmxhZ3MpOwogdm9pZAlpcF9mb3J3
YXJkKHN0cnVjdCBtYnVmICptLCBpbnQgc3JjcnQpOwogdm9pZAlpcF9pbml0KHZvaWQpOwogZXh0
ZXJuIGludAotLSAKMS43LjguMwoK
--047d7b1605050ef51d04ccbe1a2c--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAN=597Rb-ToBQuJ%2BYet9e25Hbt-QmLJPKUXGf1pFEbVsRvFONg>