From owner-freebsd-net@FreeBSD.ORG Thu Apr 30 12:04: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 C72B410656CE for ; Thu, 30 Apr 2009 12:04:25 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-qy0-f105.google.com (mail-qy0-f105.google.com [209.85.221.105]) by mx1.freebsd.org (Postfix) with ESMTP id 687A58FC13 for ; Thu, 30 Apr 2009 12:04:25 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: by qyk3 with SMTP id 3so3609020qyk.3 for ; Thu, 30 Apr 2009 05:04: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=diUw8M4GrFPazPM+ylLNdaFDVpSeZfYQvcE0/TKZKOE=; b=PxzgyGwIhCWTNk0fGQseYswT1F+BIbM3VBd7f5As68QGmeWVUPt7hy70cJIdoKXWQ4 wRbbAWgiqYNFyF/J9jiyWfmL6h17taNd7GApJv/fTV7Cs+Y955oFpzCLC5HydzHR9sOj 1F1kgpnS+UHYs7oLpZzTfqF5ApwLLUmqXO6DQ= 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=PvXz7pEHPP+wZhcXRvC7ZC9uaM+zsvqywXp2ahBkVxZ/6shZF7ajj+HU7jyslKiirw btL4Ipbk0Zl6AhLygQF1ay4Dq3P26f4gfQSqLwvlp+7Jc7SJbN2cb2osgTcriaGQXPuF RsE9qyOdluaJpD7owxITV3l/UB7whPcJC4Ge4= Received: by 10.224.47.16 with SMTP id l16mr1681475qaf.109.1241093064854; Thu, 30 Apr 2009 05:04:24 -0700 (PDT) Received: from ndenev.cmotd.com (blah.sun-fish.com [217.18.249.150]) by mx.google.com with ESMTPS id 30sm6608450yxk.6.2009.04.30.05.04.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 30 Apr 2009 05:04:24 -0700 (PDT) Message-Id: <5FD800FE-23E5-482E-8491-564FE52D91D5@gmail.com> From: Nikolay Denev To: freebsd-net@freebsd.org In-Reply-To: Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-495-792854591" Mime-Version: 1.0 (Apple Message framework v930.3) Date: Thu, 30 Apr 2009 15:04:19 +0300 References: <5E915E92-2B82-4331-9493-739568CC6E8C@gmail.com> <2e77fc10904290733m4858172ayd96654f3a9a3a8a@mail.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: 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:04:28 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-495-792854591 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Apr 30, 2009, at 2:56 PM, Nikolay Denev wrote: > On Apr 29, 2009, at 7:04 PM, pluknet wrote: > >> 2009/4/29 Niki Denev : >> >>> bce1: mem >>> 0xf8000000-0xf9ffffff irq 16 at device 0.0 on pci3 >>> bce1: Ethernet address: 00:22:19:xx:xx:xx >>> bce1: [ITHREAD] >>> bce1: ASIC (0x57081020); Rev (B2); Bus (PCI-X, 64-bit, 133MHz); B/C >>> (0x04040105); Flags( MFW MSI ) >>> >>> bce1: flags=8843 metric 0 >>> mtu 1500 >>> >>> options >>> = >>> 1bb >>> >>> ether 00:22:19:xx:xx:xx >>> inet 10.18.2.1 netmask 0xffffff00 broadcast 10.18.2.255 >>> media: Ethernet autoselect (1000baseTX ) >>> status: active >>> >>> And here is a tcpdump that shows the problem : >>> >>> 16:27:32.593808 00:22:19:yy:yy:yy > 00:22:19:xx:xx:xx, ethertype >>> IPv4 >>> (0x0800), length 2026: (tos 0x0, ttl 64, id 45347, offset 0, flags >>> [none], proto ICMP (1), length 84) 10.18.2.2 > 10.18.2.1: ICMP echo >>> request, id 13578, seq 36, length 64 >>> 16:27:32.593817 00:22:19:xx:xx:xx > 00:22:19:yy:yy:yy, ethertype >>> IPv4 >>> (0x0800), length 98: (tos 0x0, ttl 64, id 18415, offset 0, flags >>> [none], proto ICMP (1), length 84) 10.18.2.1 > 10.18.2.2: ICMP echo >>> reply, id 13578, seq 36, length 64 >> >> Ok, now I see. A link level length is 2026 for me too for some sort >> of packets >> (in opposite to proto's len where all is ok). >> >> Mine nic is >> (same as yours). >> >> Looks like a regression. >> I just also tested 7.1-R and it shows expected LL-length. >> >> >> -- >> wbr, >> pluknet > > > 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. Regards, Niki Denev --Apple-Mail-495-792854591 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) iEYEARECAAYFAkn5k8MACgkQHNAJ/fLbfrkOjgCeJr2oVcHvgZPcyJ+O+M+rlRj1 nEkAnAnZke4evdELE8LNUvnZFN0b2W2G =iMjj -----END PGP SIGNATURE----- --Apple-Mail-495-792854591--