From owner-freebsd-hackers Fri Mar 19 6: 9:39 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from skynet.ctr.columbia.edu (skynet.ctr.columbia.edu [128.59.64.70]) by hub.freebsd.org (Postfix) with SMTP id CF3F0155EE for ; Fri, 19 Mar 1999 06:09:34 -0800 (PST) (envelope-from wpaul@skynet.ctr.columbia.edu) Received: (from wpaul@localhost) by skynet.ctr.columbia.edu (8.6.12/8.6.9) id JAA03718; Fri, 19 Mar 1999 09:15:54 -0500 From: Bill Paul Message-Id: <199903191415.JAA03718@skynet.ctr.columbia.edu> Subject: Re: Gigabit ethernet revisited To: dillon@apollo.backplane.com (Matthew Dillon) Date: Fri, 19 Mar 1999 09:15:53 -0500 (EST) Cc: hackers@freebsd.org In-Reply-To: <199903190525.VAA44097@apollo.backplane.com> from "Matthew Dillon" at Mar 18, 99 09:25:12 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 3429 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Of all the gin joints in all the towns in all the world, Matthew Dillon had to walk into mine and say: > :it's about half what I think it should be. The nic stats counters > :show quite a few nicDmaWriteRingFull and nicNoMoreWrDMADescriptors > :errors, which means that the NIC is receiving the frames but the > :bus isn't transfering them to the host fast enough. > : > :The machines I'm using now are Dell Precision 410 workstations, each > :with one 450Mhz Pentium II CPU, 128MB of RAM and Intel 82443BX PCI > :chipsets. > > It sounds like the DMA is working fine, but the host computer > is not able to drain the receive ring ( which I presume is the > 'write ring' ) quickly enough. No, I don't think that's it. I think the DMA isn't going fast enough. The 'WriteRing' in question is a ring of DMA descriptors inside the NIC, which the firmware is supposed to be managing. There's also a DmaReadRing for the transmit side. > Your current code appears to allocate a sufficient number of buffers, > but your ti_refill_rx_rings() optimization is suspect... you do not > call it until you have *COMPLETELY* drained the RX ring of packets. > What happens if new packets are streaming in faster then you can drain > them? You will completely exhaust your RX ring before you reallocate > it's buffers. There are a couple of tuning parameters that control when the NIC will interrupt the host to check the receive ring: ti_rx_coal_ticks and ti_rx_max_coal_bds. The former is the number of microseconds that can elapse before the NIC will be forced to interrupt, and the latter is the number of descriptors to wait to be accumulated before generating an interrupt. Right now, I set things for 500 microseconds and 64 buffer descriptors, and in my tests this usually results in buffers being DMAed in chunks of 16 or so. (I addedm some instrumentation to check this.) So I don't think the RX ring is getting anywhere near drained. For giggles, I cranked thinks up so that it DMA'ed a couple hundred a shot before interrupting and it was still too slow, and that was with all 512 entries in the receive ring filled up. > I would also suggest figuring out *exactly* why you are getting the > error message... i.e. is the RX ring actually completely used up as of > the time the error occurs? The firmware source code is somewhat... opaque. But basically it means that the NIC has received frames and wants to queue them onto the DMA write ring, but that ring is already full. In other words, the MAC part of the NIC is getting the all the frames and wants to get them into the host, but the DMA is proceeding so slowly that it can't move them all and has to drop some. I'm not discounting the possibility that the receive handler is botching things somehow, but I don't think the problem is lack of space in the receive ring. -Bill -- ============================================================================= -Bill Paul (212) 854-6020 | System Manager, Master of Unix-Fu Work: wpaul@ctr.columbia.edu | Center for Telecommunications Research Home: wpaul@skynet.ctr.columbia.edu | Columbia University, New York City ============================================================================= "It is not I who am crazy; it is I who am mad!" - Ren Hoek, "Space Madness" ============================================================================= To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message