bce(4) and lagg(4) fix [was: bce(4) sees all incoming frames as
2026 bytes in length]
ndenev at gmail.com
Thu Apr 30 12:38:25 UTC 2009
On Apr 30, 2009, at 3:04 PM, Nikolay Denev wrote:
>> 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.
>> 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 @@
+ /* Adjust the packet length to match the received data. */
+ m0->m_pkthdr.len = m0->m_len = pkt_len;
/* Send the packet to the appropriate interface. */
m0->m_pkthdr.rcvif = ifp;
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20090430/d5b4dd78/PGP.pgp
More information about the freebsd-net