From owner-svn-src-head@FreeBSD.ORG Sun Mar 21 15:52:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38EA71065672; Sun, 21 Mar 2010 15:52:56 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E3FC8FC18; Sun, 21 Mar 2010 15:52:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o2LFqt9U046582; Sun, 21 Mar 2010 15:52:55 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2LFqtpA046580; Sun, 21 Mar 2010 15:52:55 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201003211552.o2LFqtpA046580@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 21 Mar 2010 15:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r205414 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Mar 2010 15:52:56 -0000 Author: luigi Date: Sun Mar 21 15:52:55 2010 New Revision: 205414 URL: http://svn.freebsd.org/changeset/base/205414 Log: revise documentation Modified: head/sys/netinet/ipfw/dn_sched.h Modified: head/sys/netinet/ipfw/dn_sched.h ============================================================================== --- head/sys/netinet/ipfw/dn_sched.h Sun Mar 21 15:14:21 2010 (r205413) +++ head/sys/netinet/ipfw/dn_sched.h Sun Mar 21 15:52:55 2010 (r205414) @@ -68,6 +68,18 @@ struct dn_alg { * enqueue enqueue packet 'm' on scheduler 's', queue 'q'. * q is NULL for !MULTIQUEUE. * Return 0 on success, 1 on drop (packet consumed anyways). + * Note that q should be interpreted only as a hint + * on the flow that the mbuf belongs to: while a + * scheduler will normally enqueue m into q, it is ok + * to leave q alone and put the mbuf elsewhere. + * This function is called in two cases: + * - when a new packet arrives to the scheduler; + * - when a scheduler is reconfigured. In this case the + * call is issued by the new_queue callback, with a + * non empty queue (q) and m pointing to the first + * mbuf in the queue. For this reason, the function + * should internally check for (m != q->mq.head) + * before calling dn_enqueue(). * * dequeue Called when scheduler instance 's' can * dequeue a packet. Return NULL if none are available. @@ -94,8 +106,15 @@ struct dn_alg { * * new_queue called to set the per-queue parameters, * e.g. S and F, adjust sum of weights in the parent, etc. - * If the queue has packets in it, add them to the scheduler - * as well. + * + * The new_queue callback is normally called from when + * creating a new queue. In some cases (such as a + * scheduler change or reconfiguration) it can be called + * with a non empty queue. In this case, the queue + * In case of non empty queue, the new_queue callback could + * need to call the enqueue function. In this case, + * the callback should eventually call enqueue() passing + * as m the first element in the queue. * * free_queue actions related to a queue removal, e.g. undo * all the above. If the queue has data in it, also remove