From owner-freebsd-net@FreeBSD.ORG Thu Apr 30 11:57:04 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 ED7E1106566B for ; Thu, 30 Apr 2009 11:57:04 +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 929D98FC12 for ; Thu, 30 Apr 2009 11:57:04 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: by qyk3 with SMTP id 3so3602752qyk.3 for ; Thu, 30 Apr 2009 04:57:03 -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=C4RtAM6CMDMthKheqUzlLXIXFb8LTC0tr3o40lAeu5I=; b=YDvZjxN5ykWI77iRTVC0QZMpvn1LMlDcSmQuCG/1ydY1uJHPdiC0M7kCbZm8YpPent 7jcC1Qu3JAWFVYDWMwtED2HHh7cYcCabqHbw1fjKbLo0Z3lnamlb3pfV48FOyljm+Uzm fy/hkiQT/MioqUsExXwgDQ5ClhC26CbPj4/hI= 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=MoQvDYKQFuWYYEKEz9CW/Se7pXn8asbVTgmNVgEkBE+nC89awM80ImI33dF4msvZh1 nDVEEG2dj5nXC+b9Mk4EQoUbFeQkPof8Op5xk+amstMG498fypaWqGU7k2zOOEDiUmjT MqawWHYj+rVrfcKSnE+WUmwQWIzWXpOYhSvNc= Received: by 10.224.67.203 with SMTP id s11mr1657228qai.290.1241092623728; Thu, 30 Apr 2009 04:57:03 -0700 (PDT) Received: from ndenev.cmotd.com (blah.sun-fish.com [217.18.249.150]) by mx.google.com with ESMTPS id 4sm6682569yxd.29.2009.04.30.04.57.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 30 Apr 2009 04:57:02 -0700 (PDT) Message-Id: 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-491-792384474" Mime-Version: 1.0 (Apple Message framework v930.3) Date: Thu, 30 Apr 2009 14:56:29 +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: Re: 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 11:57:05 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-491-792384474 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit 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 --Apple-Mail-491-792384474 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) iEYEARECAAYFAkn5kfAACgkQHNAJ/fLbfrnF6QCcDXOXdWvfpqBIrCIa1ToQjfQy JeoAn0dtODtxQeKczU7rHoFOiENO7Tfj =kIvo -----END PGP SIGNATURE----- --Apple-Mail-491-792384474--