Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2009 17:33:00 +0400
From:      pluknet <pluknet@gmail.com>
To:        Nikolay Denev <ndenev@gmail.com>
Cc:        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:  <a31046fc0904300633n5e983d34l10d7e6daa723df41@mail.gmail.com>
In-Reply-To: <DE46D03C-2996-42EB-A92D-2DA35F2E1FD3@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> <DE46D03C-2996-42EB-A92D-2DA35F2E1FD3@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

2009/4/30 Nikolay Denev <ndenev@gmail.com>:
> 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;
>

Ha-ha, you was fast! The only note: I think the comment part should be
consistent
with ZERO_COPY_SOCKETS case.

Thank you.

-- 
wbr,
pluknet



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a31046fc0904300633n5e983d34l10d7e6daa723df41>