From owner-freebsd-hackers Fri Dec 4 13:05:01 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA20580 for freebsd-hackers-outgoing; Fri, 4 Dec 1998 13:05:01 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from alpo.whistle.com (alpo.whistle.com [207.76.204.38]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA20566 for ; Fri, 4 Dec 1998 13:04:55 -0800 (PST) (envelope-from julian@whistle.com) Received: (from daemon@localhost) by alpo.whistle.com (8.8.5/8.8.5) id NAA28267; Fri, 4 Dec 1998 13:03:58 -0800 (PST) Received: from current1.whistle.com(207.76.205.22) via SMTP by alpo.whistle.com, id smtpdz28263; Fri Dec 4 21:03:56 1998 Date: Fri, 4 Dec 1998 13:03:29 -0800 (PST) From: Julian Elischer To: Archie Cobbs cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Help with clist_alloc_cblocks() In-Reply-To: <199812042028.MAA06497@bubba.whistle.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG check kern/tty_subr.c around line 150 on. values of 0 for the last 2 args will allocate exactly 1 cblock (the way I read it) that is 128 - 16 - 4 == 108 bytes of storage. the arguments are ccmax (above which the list will not be grown) and ccreserve, ( below which the allocated cblocks will not be freed) a value of 0 sets each to 1 cblock. you probably want to use values of 1000, 300 or something. On Fri, 4 Dec 1998, Archie Cobbs wrote: > Hello, > I'm trying to write a line discipline, roughly similar to the PPP > line discipline. My question is, what are the correct parameters to > give to clist_alloc_cblocks()? > > /* > * Pre-allocate cblocks to the an appropriate amount. > */ > > ttyflush(tp, FREAD | FWRITE); > clist_alloc_cblocks(&tp->t_canq, 0, 0); > clist_alloc_cblocks(&tp->t_rawq, 0, 0); /* XXX probably wrong! */ > clist_alloc_cblocks(&tp->t_outq, MLEN + NGT_HIWATER, MLEN + NGT_HIWATER); > > I'm not sure how to determine what the correct values to call > clist_alloc_cblocks() should be. The values I'm using now cause a > bunch of "interrupt-level buffer overflows" reported from the sio > driver. It looks like I can simply increase the values for tp->t_rawq > but I'd like to understand exactly what they mean first. > > Thanks, > -Archie > > ___________________________________________________________________________ > Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message