From owner-freebsd-net@FreeBSD.ORG Tue Apr 29 16:17:19 2008 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 AB2EC1065686; Tue, 29 Apr 2008 16:17:19 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 5AD478FC19; Tue, 29 Apr 2008 16:17:19 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m3TGHHLE048179 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 29 Apr 2008 09:17:18 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <48174A0D.1090302@freebsd.org> Date: Tue, 29 Apr 2008 09:17:17 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: Yehonatan Yossef References: <6C2C79E72C305246B504CBA17B5500C903E6C3B1@mtlexch01.mtl.com> In-Reply-To: <6C2C79E72C305246B504CBA17B5500C903E6C3B1@mtlexch01.mtl.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC--Metrics: ebb.errno.com; whitelist Cc: Tom Judge , freebsd-net@freebsd.org, Liran Liss , freebsd-questions@freebsd.org, Mr Y Subject: Re: OS throws away large packets 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: Tue, 29 Apr 2008 16:17:19 -0000 Yehonatan Yossef wrote: > > > >> -----Original Message----- >> From: Tom Judge [mailto:tom@tomjudge.com] >> 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 >> >> Mr Y wrote: >> >>> Hi all, >>> >>> I'm trying to implement Large Recieve Offload for an >>> >> Ethernet driver >> >>> 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 >>> >> a cluster >> >>> of MCLBYTES bytes. They are linked by the m_next pointer. >>> The first packet being thrown away is 2945 bytes long. >>> >> Wireshark shows >> >>> the packet that is being passed to the OS is correct. >>> >>> Do I need to set some OS parameter to make it recieve mbuf chains? >>> >>> Please help. >>> >>> >> Hi Yony, >> >> I seem to remember some discussion about this list last year >> see the following threads: >> >> >> > 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 > >> enforced further up the stack or at least that seamed to be the case >> > with the bce driver. > >> Hope this is helpful, >> >> 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? > > I don't see where you've identified what version of the os you're working with. There's a check in the 802.3 input path on earlier systems to discard frames >mtu. This was removed not too long ago with LRO in mind; check the history of sys/net/if_ethersubr.c. Sam