From owner-freebsd-hackers Sun Aug 17 01:35:11 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id BAA16848 for hackers-outgoing; Sun, 17 Aug 1997 01:35:11 -0700 (PDT) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id BAA16843 for ; Sun, 17 Aug 1997 01:35:09 -0700 (PDT) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id BAA08684; Sun, 17 Aug 1997 01:36:44 -0700 (PDT) Message-Id: <199708170836.BAA08684@implode.root.com> To: Vinay Bannai cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Device drivers and DMA details?? In-reply-to: Your message of "Sun, 17 Aug 1997 01:09:46 PDT." <199708170809.BAA25936@agni.nuko.com> From: David Greenman Reply-To: dg@root.com Date: Sun, 17 Aug 1997 01:36:44 -0700 Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Ah!! I see that the interface's if_start() routine is called when the >network is not busy (IFF_OACTIVE). This means that IFF_OACTIVE is set for >the interface while receiving the packet or when the controller is >busy. Uh, no, IFF_OACTIVE indicates that the interface is busy transmitting one or more packets and that it can't handle any additional packets for xmit right now. > In fact it appears that the fxp driver never has the need to set the >IFF_OACTIVE, so the fxp_start() gets called everytime a packet is queued >on the interface queue Yes, IFF_OACTIVE is optional and is meant as a sort of optimization to avoid calling the driver start routine. It doesn't make sense for if_fxp because the fxp card supports dynamic chaining; in other words, a DMA chain that is currently being transmitted can be extended with additional packets. The only limit to how much the chain can be extend is an arbitrary one having to do with the available DMA descriptors. I could actually set IFF_OACTIVE when all transmit descriptors are exhausted, but the extra overhead to deal with this wasn't worth it - it's a very rare condition and the check at the top of fxp_start() will handle this case and return immediately. > unless it is running at a priority of the hardware >interrupt from the network controller. In that case since the hardware >interrupt from the network controller being higher than splimp() will make >it possible for the IF queues to be flushed before the priority drops back >to splimp or whatever. Huh? "network controller being higher than splimp()"? Huh? None of the above makes any sense. > Is that a correct assesment? Yes, except for the last part. spl* protection is for protecting certain critical regions from modification by interrupt routines. While the code has an spl* level set, interrupts in that class will be blocked. splimp blocks network device interrupts. splnet blocks network (input) packet processing that would normally occur when the system returns to spl0. Received packets are processed at spl0 in order to avoid certain driver reentrancy problems when packets are being forwarded. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project