From owner-svn-src-user@FreeBSD.ORG Mon Jan 18 12:52:42 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 856B51065670; Mon, 18 Jan 2010 12:52:42 +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 752A18FC08; Mon, 18 Jan 2010 12:52:42 +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 o0ICqgmw067066; Mon, 18 Jan 2010 12:52:42 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0ICqg04067064; Mon, 18 Jan 2010 12:52:42 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201001181252.o0ICqg04067064@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 18 Jan 2010 12:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202569 - user/luigi/ipfw3-head/sys/netinet/ipfw X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 12:52:42 -0000 Author: luigi Date: Mon Jan 18 12:52:42 2010 New Revision: 202569 URL: http://svn.freebsd.org/changeset/base/202569 Log: small indentation fixes. Also indicate where scheduler-specific info could go in the flowset. Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_private.h Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_private.h ============================================================================== --- user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_private.h Mon Jan 18 12:43:57 2010 (r202568) +++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_dn_private.h Mon Jan 18 12:52:42 2010 (r202569) @@ -74,7 +74,7 @@ struct dn_parms { /* timekeeping */ struct timeval prev_t; /* last time dummynet_tick ran */ - struct dn_heap evheap; /* scheduled events */ + struct dn_heap evheap; /* scheduled events */ /* counters of objects -- used for reporting space */ int schk_count; @@ -124,6 +124,9 @@ struct delay_line { * When we remove a flowset, mark as DN_DELETE so it can go away * when the hash table will be empty. * XXX refcnt is redundant, the info is already in qht->entries + * If we want to add scheduler-specific parameters, we need to + * put them in external storage because the scheduler may not be + * available when the fsk is created. */ struct new_fsk { /* kernel side of a flowset */ struct new_fs fs; @@ -131,10 +134,13 @@ struct new_fsk { /* kernel side of a flo int kflags; /* kernel-side flags */ int refcnt; /* entries in qht */ - /* hash table of queues, or just our queue if we have no mask */ + /* hash table of queues. XXX if we have no flow_mask we could + * avoid the hash table and just allocate one queue. + */ struct dn_ht *qht; struct new_schk *sched; /* Sched we are linked to */ SLIST_ENTRY(new_fsk) sch_chain; /* list of fsk attached to sched */ + void *sched_info; /* scheduler-specific info */ }; /* @@ -178,7 +184,6 @@ struct new_schk { /* Hash table of all instances (through sched_mask) */ struct dn_ht *siht; - }; @@ -191,25 +196,25 @@ struct new_sch_inst { struct new_inst ni; /* oid, id and stats */ SLIST_ENTRY(new_sch_inst) si_next; /* next item in the bucket */ struct delay_line dline; - struct new_schk *sched; /* the template */ + struct new_schk *sched; /* the template */ int kflags; /* DN_ACTIVE */ - int64_t credit; /* bits I can transmit (more or less). */ - dn_key sched_time ; /* time pipe was scheduled in ready_heap */ - dn_key idle_time; /* start of scheduler instance idle time */ + int64_t credit; /* bits I can transmit (more or less). */ + dn_key sched_time; /* time pipe was scheduled in ready_heap */ + dn_key idle_time; /* start of scheduler instance idle time */ }; /* kernel-side flags */ enum { - DN_DELETE = 0x0004, /* destroy when refcnt=0 */ - DN_ACTIVE = 0x0010, /* object is in evheap */ - DN_F_DLINE = 0x0020, /* object is a delay line */ - DN_F_SCHI = 0x0030, /* object is a sched.instance */ + DN_DELETE = 0x0004, /* destroy when refcnt=0 */ + DN_ACTIVE = 0x0010, /* object is in evheap */ + DN_F_DLINE = 0x0020, /* object is a delay line */ + DN_F_SCHI = 0x0030, /* object is a sched.instance */ }; extern struct dn_parms dn_cfg; -int dummynet_io(struct mbuf **, int , struct ip_fw_args *); +int dummynet_io(struct mbuf **, int , struct ip_fw_args *); void dummynet_task(void *context, int pending); void dn_reschedule(void);