From owner-cvs-all@FreeBSD.ORG Sat Jun 12 18:48:00 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D16116A520; Sat, 12 Jun 2004 18:48:00 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5516443D2D; Sat, 12 Jun 2004 18:48:00 +0000 (GMT) (envelope-from mlaier@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i5CIlPWV066138; Sat, 12 Jun 2004 18:47:25 GMT (envelope-from mlaier@repoman.freebsd.org) Received: (from mlaier@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i5CIlPVt066137; Sat, 12 Jun 2004 18:47:25 GMT (envelope-from mlaier) Message-Id: <200406121847.i5CIlPVt066137@repoman.freebsd.org> From: Max Laier Date: Sat, 12 Jun 2004 18:47:25 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/contrib/altq/altq if_altq.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2004 18:48:01 -0000 mlaier 2004-06-12 18:47:25 UTC FreeBSD src repository Modified files: sys/contrib/altq/altq if_altq.h Log: Add an additional queue which will be "owned by the driver". This allows to rig a PREPEND macro for ALTQ as the POLL/DEQUEUE semantic is very bad in terms of locking. We make this a full functional queue to allow "bulk dequeue" which will further reduce the locking overhead (for non-altq enabled devices). Drivers will access this via the following macros, which will show up in once we expose ALTQ to the build: IFQ_DRV_DEQUEUE(ifq, m) - takes a mbuf off the queue (driver queue first) IFQ_DRV_PREPEND(ifq, m) - pushes a mbuf back to the driver queue IFQ_DRV_PURGE(ifq) - drops all packets in both queues IFQ_DRV_IS_EMPTY(ifq) - checks for pending mbufs in either queue One has to make sure that the first three are protected by a driver mutex. At the moment most network drivers still require Giant, so this is not an issue. Even those that have thier own mutex usually hold it in if_start and the like, so this requirement is almost always satisfied. This evolved from a discussion with Andrew Gallatin. Revision Changes Path 1.2 +7 -0 src/sys/contrib/altq/altq/if_altq.h