From owner-freebsd-hackers Wed Nov 8 13:16:42 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.interware.hu (mail.interware.hu [195.70.32.130]) by hub.freebsd.org (Postfix) with ESMTP id F201237B479 for ; Wed, 8 Nov 2000 13:16:37 -0800 (PST) Received: from casablanca-51.budapest.interware.hu ([195.70.53.51] helo=elischer.org) by mail.interware.hu with esmtp (Exim 3.16 #1 (Debian)) id 13tca6-0005DI-00; Wed, 08 Nov 2000 22:16:31 +0100 Message-ID: <3A094107.624361F4@elischer.org> Date: Wed, 08 Nov 2000 04:03:19 -0800 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: Jacques Fourie Cc: freebsd-hackers@freebsd.org Subject: Re: kernel stack size? References: <20001107132009.23436.qmail@web3504.mail.yahoo.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Jacques Fourie wrote: > > Hi > > Please excuse any silly questions, but I am stuck with > a problem that I can't find the answer for. > > I wrote a KLD module that performs encryption on > network packets in the kernel. Packets are intercepted > for encryption on a ethernet level (in ether_input() > and ether_output_frame() respectively). This module is > implemented on 4.1.1-RELEASE. > > For input packets I added my own NETISR as well as > interrupt queue. In the ether_input() routine the > packets are queued and a software interrupt scheduled. > Further processing on the packet then happens at a > priority of splnet(). Why are you not using the netgraph system, which was specifically designed for this? it allows you to divert eherne packets through your own arbitrary processing modules and to even pass then to userland for processing if you want. you can do this without editing any other file in the kernel, since netgraph modules can be loaded, and there is already a netgraph tap point in the ethernet system. Netgraph will also aoutomatically do all the queueing you require. > > If I do bulk data transfers (encrypted) everything > works fine until I run a shell script that does a > 'ls -lR' in an infinite loop. A few "virtual time > alarm" messages appear and then a kernel panic. > Looking at the DDB output, it seems a lot like a > kernel stack overflow has resulted. Very strange > values for ebp and page faults on stack accesses is > making me think along these lines. Generally you have very little kernel stack. you should use MALLOC'd regions for workspace if you need it. in 4.x and earlier, the NETISR code will run on whatever stack is presently in use so if you are running something that uses a lot of stack already, it may find that there is not enough left. > > Does anyone know where I can find more information > about the kernel stack at interrupt time (such as the > maximum size)? > I'm also not quite sure what the "virtual time alarm" > messages mean, can anyone help me out? > > jacques > > __________________________________________________ > Do You Yahoo!? > Thousands of Stores. Millions of Products. All in one Place. > http://shopping.yahoo.com/ > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000 ---> X_.---._/ presently in: Budapest v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message