From owner-freebsd-net@FreeBSD.ORG Mon Jul 31 17:08:30 2006 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9482316A4DE; Mon, 31 Jul 2006 17:08:30 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4FA943D5C; Mon, 31 Jul 2006 17:08:27 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id A8C8346B9B; Mon, 31 Jul 2006 13:08:24 -0400 (EDT) Date: Mon, 31 Jul 2006 18:08:24 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: John Polstra In-Reply-To: Message-ID: <20060731180643.E71432@fledge.watson.org> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@freebsd.org, net@freebsd.org Subject: RE: Changes in the network interface queueing handoff model 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: Mon, 31 Jul 2006 17:08:30 -0000 On Mon, 31 Jul 2006, John Polstra wrote: >> Attached is a patch that maintains the current if_start, but adds >> if_startmbuf. If a device driver implements if_startmbuf and the global >> sysctl net.startmbuf_enabled is set to 1, then the if_startmbuf path in the >> driver will be used. Otherwise, if_start is used. I have modified the >> if_em driver to implement if_startmbuf also. If there is no packet backlog >> in the if_snd queue, it directly places the packet in the transmit >> descriptor ring. If there is a backlog, it uses the if_snd queue protected >> by driver mutex, rather than a separate ifq mutex. > > I question whether you need a fallback software if_snd queue at all for > modern devices such as the Intel and Broadcom gigabit chips. The hardware > transmit descriptor rings typically have sizes of the order of 256 > descriptors. I think if the ring fills up, you could simply drop the packet > with ENOBUFS. That's what happens if the if_snd queue fills up, and its > maximum size is comparable to the sizes of modern descriptor rings. It > would simplify things quite a bit to eliminate the if_snd queue entirely for > such devices. I tend to agree, but implemented full queueing support for if_em to make sure I understood to complexity implications of completely removing queueing from the ifnet side dispatch. I guess an interesting question for us is how we decide what the right threshold is to implement software queuing. Do any if_em cards need software queueing, or do they all have adequate in-hardware queues as is? Entirely cutting the queue code would significantly simplify em_startmbuf. Robert N M Watson Computer Laboratory University of Cambridge