From owner-freebsd-net@FreeBSD.ORG Thu Apr 30 12:38:25 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D1021065670 for ; Thu, 30 Apr 2009 12:38:25 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by mx1.freebsd.org (Postfix) with ESMTP id 104308FC17 for ; Thu, 30 Apr 2009 12:38:24 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: by qw-out-2122.google.com with SMTP id 3so1330595qwe.7 for ; Thu, 30 Apr 2009 05:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:mime-version:subject:date:references :x-pgp-agent:content-transfer-encoding:x-mailer; bh=27nyhyxZ/H1VWJQvR22JRsws6ivJgbqUIuYJA95tyZg=; b=B7jph9t98xa7H9djyK3cfJT+Zs1ier8m7CwO1loboWGcQ0D1lYK6VxUVisoPF/Fx2S b9JbBg65GedOQSOHSLS9NE/qIyss3SgS12/oYw8QC+MxDfstnXXywwOaDEFCvb+tSMdu OG6oqwxNPWDD6Kd0i3/Ob0YNmKK8/icP7Kv2A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-pgp-agent:content-transfer-encoding:x-mailer; b=hq87q+MUXCxv765HRUg1RgqqmTtDP/pQK41PwvIpFqIKfwzZCI1KjSQUelGdT9knpH vaaLbOFXXP4OU2ZrQp5JktnbO+886BIJzzCIwHKxMfixkEQzWAk2gHmcixAuEIwLYGpT ZNfgz06OurlCawP3nthG+vESgUnd/Jv7eiIJg= Received: by 10.229.84.213 with SMTP id k21mr1132908qcl.19.1241095104396; Thu, 30 Apr 2009 05:38:24 -0700 (PDT) Received: from ndenev.cmotd.com (blah.sun-fish.com [217.18.249.150]) by mx.google.com with ESMTPS id 9sm6776785yxs.3.2009.04.30.05.38.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 30 Apr 2009 05:38:21 -0700 (PDT) Message-Id: From: Nikolay Denev To: freebsd-net@freebsd.org In-Reply-To: <5FD800FE-23E5-482E-8491-564FE52D91D5@gmail.com> Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-499-794893110" Mime-Version: 1.0 (Apple Message framework v930.3) Date: Thu, 30 Apr 2009 15:38:17 +0300 References: <5E915E92-2B82-4331-9493-739568CC6E8C@gmail.com> <2e77fc10904290733m4858172ayd96654f3a9a3a8a@mail.gmail.com> <5FD800FE-23E5-482E-8491-564FE52D91D5@gmail.com> X-Pgp-Agent: GPGMail 1.2.0 (v56) Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.930.3) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Re: bce(4) and lagg(4) fix [was: bce(4) sees all incoming frames as 2026 bytes in length] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2009 12:38:25 -0000 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--