Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2009 15:38:17 +0300
From:      Nikolay Denev <ndenev@gmail.com>
To:        freebsd-net@freebsd.org
Subject:   Re: bce(4) and lagg(4) fix [was: bce(4) sees all incoming frames as 2026 bytes in length]
Message-ID:  <DE46D03C-2996-42EB-A92D-2DA35F2E1FD3@gmail.com>
In-Reply-To: <5FD800FE-23E5-482E-8491-564FE52D91D5@gmail.com>
References:  <5E915E92-2B82-4331-9493-739568CC6E8C@gmail.com> <a31046fc0904290659h3c831abcy14318b73c1462068@mail.gmail.com> <2e77fc10904290733m4858172ayd96654f3a9a3a8a@mail.gmail.com> <a31046fc0904290904x796a7d44ne66514f777d2237f@mail.gmail.com> <FAC395EB-BEE6-4981-85D2-82ADFC2DF441@gmail.com> <5FD800FE-23E5-482E-8491-564FE52D91D5@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--Apple-Mail-499-794893110
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed;
	delsp=yes
Content-Transfer-Encoding: 7bit

On Apr 30, 2009, at 3:04 PM, Nikolay Denev wrote:
[snip]
>>
>> I think I got it.
>>
>> It seems that the mbuf fields m_pkthdr.len and m_len are not  
>> updated to the real packet size pkt_len.
>> Well, actually they are updated, but only if we have  
>> ZERO_COPY_SOCKETS defined.
>>
>> After I added this :
>>
>>    m0->m_pkthdr.len = m0->m_len = pkt_len;
>>
>> at about line 5930 in if_bce.c, the frame length reported by  
>> tcpdump seems correct.
>>
>> P.S.: I guess this could be the cause for the lagg(4) over bce(4)  
>> problems too?
>>
>> P.S.2: This fix will probably break the ZERO_COPY_SOCKETS case, but  
>> should be fairly easy to make it a "proper" fix.
>>
>> Regards,
>> Niki Denev
>>
>
> I can confirm that with this fix I was able to create lagg(4)  
> interface in "failover" mode with only one member, a  bce(4)  
> interface, and it seems to work OK.
>
>

Here is the patch :

--- sys/dev/bce/if_bce.c.orig	2009-04-30 14:06:54.000000000 +0200
+++ sys/dev/bce/if_bce.c	2009-04-30 14:11:32.000000000 +0200
@@ -5926,6 +5926,11 @@
			goto bce_rx_int_next_rx;
		}

+#ifndef ZERO_COPY_SOCKETS
+		/* Adjust the packet length to match the received data. */
+		m0->m_pkthdr.len = m0->m_len = pkt_len;
+#endif
+
		/* Send the packet to the appropriate interface. */
		m0->m_pkthdr.rcvif = ifp;

Regards,
Niki Denev


--Apple-Mail-499-794893110
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (Darwin)

iEYEARECAAYFAkn5m7oACgkQHNAJ/fLbfrn2MgCgokM3YUnI+Bf4p5AUgzppwaP7
nzYAn1sJ6C4PLxNrFvTaM6xcnNZ2/COv
=SuNk
-----END PGP SIGNATURE-----

--Apple-Mail-499-794893110--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DE46D03C-2996-42EB-A92D-2DA35F2E1FD3>