From owner-freebsd-questions@FreeBSD.ORG Tue Apr 29 10:02:37 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41ABD1065672 for ; Tue, 29 Apr 2008 10:02:37 +0000 (UTC) (envelope-from yoniy@mellanox.co.il) Received: from mellanox.co.il (mail.mellanox.co.il [194.90.237.43]) by mx1.freebsd.org (Postfix) with ESMTP id 1FDB18FC14 for ; Tue, 29 Apr 2008 10:02:35 +0000 (UTC) (envelope-from yoniy@mellanox.co.il) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yoniy@mellanox.co.il) with SMTP; 29 Apr 2008 12:35:52 +0300 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Tue, 29 Apr 2008 12:35:51 +0300 Message-ID: <6C2C79E72C305246B504CBA17B5500C903E6C3B1@mtlexch01.mtl.com> In-Reply-To: <48160770.2080509@tomjudge.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: OS throws away large packets Thread-Index: AcipVDsANurcsXo+RzKO3aKAgW4uUgAelKmA From: "Yehonatan Yossef" To: "Tom Judge" , "Mr Y" Cc: freebsd-net@freebsd.org, freebsd-questions@freebsd.org, Liran Liss Subject: RE: OS throws away large packets X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2008 10:02:37 -0000 =20 > -----Original Message----- > From: Tom Judge [mailto:tom@tomjudge.com]=20 > Sent: Monday, April 28, 2008 8:21 PM > To: Mr Y > Cc: freebsd-questions@freebsd.org; freebsd-net@freebsd.org > Subject: Re: OS throws away large packets >=20 > Mr Y wrote: > > Hi all, > >=20 > > I'm trying to implement Large Recieve Offload for an=20 > Ethernet driver=20 > > on FreeBSD 6.3, but all my >MTU packets are being thrown by the OS. > > I'm using mbuf chains in this imlpementation, each mbuf is=20 > a cluster=20 > > of MCLBYTES bytes. They are linked by the m_next pointer. > > The first packet being thrown away is 2945 bytes long.=20 > Wireshark shows=20 > > the packet that is being passed to the OS is correct. > >=20 > > Do I need to set some OS parameter to make it recieve mbuf chains? > >=20 > > Please help. > >=20 >=20 > Hi Yony, >=20 > I seem to remember some discussion about this list last year=20 > see the following threads: >=20 > http://lists.freebsd.org/pipermail/freebsd-net/2007-September/015250.htm l > http://lists.freebsd.org/pipermail/freebsd-net/2007-September/015350.htm l > >From my limited reading of these threads just now and possibly bad memory. It would seem that the MRU to MTU relationship is defined in the nic driver rather than=20 > enforced further up the stack or at least that seamed to be the case with the bce driver. > >Hope this is helpful, >=20 > Tom Hi Tom, >From what I understand these threads are referring to the bce hardware configuration (bus configuration) and driver mbuf allocation size. Am I correct? In my case I'm not trying to receive packets >MTU from the HW, but to chain mbuf clusters, each is MCLBYTES long, and pass the mbuf chain to the OS. Since tcpdump (analyzed by wireshark) catches the packets above the driver and reports a good packet (and 2945 bytes long), I assume my driver functionality is ok. From what I know tcpdump is supposed to immitate the way the stack sees the packet, yet it is discarded. My logic says there is an OS parameter handled by the driver (at net device init time for example) that will set the OS to receive large mbuf chains, or a kernel tcp parameter. Is the tcp stack submitted to the mtu somehow? Yony