From owner-freebsd-drivers@FreeBSD.ORG Fri Feb 7 16:41:29 2014 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A4FD625 for ; Fri, 7 Feb 2014 16:41:29 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1BFD2113E for ; Fri, 7 Feb 2014 16:41:28 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s17GfNSi075282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Feb 2014 08:41:23 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s17GfMYf075281; Fri, 7 Feb 2014 08:41:22 -0800 (PST) (envelope-from jmg) Date: Fri, 7 Feb 2014 08:41:22 -0800 From: John-Mark Gurney To: Viktor Subject: Re: Receiving jumbo frames Message-ID: <20140207164122.GE89104@funkthat.com> Mail-Followup-To: Viktor , freebsd-drivers@freebsd.org References: <52F49D36.8000103@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52F49D36.8000103@gmail.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 07 Feb 2014 08:41:23 -0800 (PST) Cc: freebsd-drivers@freebsd.org X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 16:41:29 -0000 Viktor wrote this message on Fri, Feb 07, 2014 at 10:45 +0200: > Hi, folks! I'm writing an extension functionality to not-yet published > network driver. > I'm receiving the typical ethernet frames without problems. Considering > the datasheet of the device, > I'm capable of receiving jumbo frames. When I try to do that, e.g. to > send jumbo frame of 8000 bytes, I'm receiving only a limited count of > them - 105, then the kernel crashes with the following message: > "panic: vm_fault: fault on nofault entry, addr: cfcec000". This happens when you access an address in kmem (kernel space) that no longer has a page mapped... This is probably due to a pointer that was previously valid, but then you aren't suppose to have and the kernel unmapped the page because the subsystem free'd it... > I have inspected a kernel dump with kgdb and the problem occurs at the > function bus_dmamap_sync. What part of this? It could be that you are trying to _sync a buffer that doesn't belong to you anymore... Are you making sure that you allocate new frames to replace them in the receive buffer? > Some background information: > To enable the jumbo frame, one must set the appropriate register. > At the software level, a ring buffer with the descriptors is implemented. > The device, under which the driver runs, is arm-based. > The freebsd version is 8.0. The device uses SerialDMA queues for > transmitting and receiving. > To receive packets, the CPU must perform the following: > 1. Prepare a linked list of descriptors > 2. Configure a given queue with the address of the first descriptor > in the list, > 3. enable SerialDMA; > > With the transmission - I don't have any problems. The logic is the same > as by the reception of packets - ring buffer with descriptors. > > Any ideas what can cause this type of crashes? With out better idea of what the driver is doing, or a line on which the panic happens, the above is about all I can think of... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."