From owner-p4-projects@FreeBSD.ORG Fri Oct 3 04:27:45 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 313F6106568F; Fri, 3 Oct 2008 04:27:45 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9A6C106568B for ; Fri, 3 Oct 2008 04:27:44 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id D789F8FC14 for ; Fri, 3 Oct 2008 04:27:44 +0000 (UTC) (envelope-from thompsa@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id m934RiFn028625 for ; Fri, 3 Oct 2008 04:27:44 GMT (envelope-from thompsa@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id m934Rifq028623 for perforce@freebsd.org; Fri, 3 Oct 2008 04:27:44 GMT (envelope-from thompsa@freebsd.org) Date: Fri, 3 Oct 2008 04:27:44 GMT Message-Id: <200810030427.m934Rifq028623@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to thompsa@freebsd.org using -f From: Andrew Thompson To: Perforce Change Reviews Cc: Subject: PERFORCE change 150829 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2008 04:27:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=150829 Change 150829 by thompsa@thompsa_burger on 2008/10/03 04:26:56 Update comment on ng_tty and set the outq to a reasonable size. Affected files ... .. //depot/projects/mpsafetty/sys/netgraph/ng_tty.c#8 edit Differences ... ==== //depot/projects/mpsafetty/sys/netgraph/ng_tty.c#8 (text+ko) ==== @@ -42,16 +42,19 @@ */ /* - * This file implements a terminal line discipline that is also a - * netgraph node. Installing this line discipline on a terminal device - * instantiates a new netgraph node of this type, which allows access - * to the device via the "hook" hook of the node. + * This file implements TTY hooks to link in to the netgraph system. The node + * is created and then passed the callers opened TTY file descriptor number to + * NGM_TTY_SET_TTY, this will hook the tty via ttyhook_register(). + * + * Incoming data is delivered directly to ng_tty via the TTY bypass hook as a + * buffer pointer and length, this is converted to a mbuf and passed to the + * peer. * - * Incoming characters are delievered to the hook one at a time, each - * in its own mbuf. You may optionally define a ``hotchar,'' which causes - * incoming characters to be buffered up until either the hotchar is - * seen or the mbuf is full (MHLEN bytes). Then all buffered characters - * are immediately delivered. + * If the TTY device does not support bypass then incoming characters are + * delivered to the hook one at a time, each in its own mbuf. You may + * optionally define a ``hotchar,'' which causes incoming characters to be + * buffered up until either the hotchar is seen or the mbuf is full (MHLEN + * bytes). Then all buffered characters are immediately delivered. */ #include @@ -76,10 +79,6 @@ #include #include -/* Misc defs */ -#define MAX_MBUFQ 3 /* Max number of queued mbufs */ -#define NGT_HIWATER 400 /* High water mark on output */ - /* Per-node private info */ struct ngt_softc { struct tty *tp; /* Terminal device */ @@ -167,7 +166,7 @@ sc->node = node; mtx_init(&sc->outq.ifq_mtx, "ng_tty node+queue", NULL, MTX_DEF); - IFQ_SET_MAXLEN(&sc->outq, MAX_MBUFQ); + IFQ_SET_MAXLEN(&sc->outq, IFQ_MAXLEN); atomic_add_int(&ngt_unit, 1); snprintf(name, sizeof(name), "%s%d", typestruct.name, ngt_unit);