From owner-freebsd-hackers Wed Jan 13 11:23:23 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA07449 for freebsd-hackers-outgoing; Wed, 13 Jan 1999 11:23:23 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from awfulhak.org (awfulhak.force9.co.uk [195.166.136.63]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA07292 for ; Wed, 13 Jan 1999 11:22:49 -0800 (PST) (envelope-from brian@Awfulhak.org) Received: from keep.lan.Awfulhak.org (brian@keep.lan.Awfulhak.org [172.16.0.8]) by awfulhak.org (8.8.8/8.8.8) with ESMTP id TAA09730; Wed, 13 Jan 1999 19:21:38 GMT (envelope-from brian@Awfulhak.org) Received: from keep.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by keep.lan.Awfulhak.org (8.9.1/8.9.1) with ESMTP id IAA74669; Wed, 13 Jan 1999 08:58:47 GMT (envelope-from brian@keep.lan.Awfulhak.org) Message-Id: <199901130858.IAA74669@keep.lan.Awfulhak.org> X-Mailer: exmh version 2.0.2 2/24/98 To: Doug White cc: Bill Fenner , hackers@FreeBSD.ORG Subject: Re: using raw sockets In-reply-to: Your message of "Tue, 12 Jan 1999 15:43:47 PST." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 13 Jan 1999 08:58:46 +0000 From: Brian Somers Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > On Tue, 12 Jan 1999, Bill Fenner wrote: > > > What OS version, and what kind of ethernet card, are you using when you > > see the BPF symptoms that you mention? I've never seen either of the > > problems you describe. It seems to me that fixing bpf is a much better > > target than creating a whole new mechanism. > > I'm on 2.2.7-RELEASE with a 3Com 3c509 (ep0). I'm using a program I wrote > that's derived from ppp(8), which operates in a select() loop. I don't > know exactly where the holdup is, but from my debugging output I don't > think it's my code (it reads the packets I send out immediately, just not > any inbound packets). [.....] I don't know if it'll help, but if you enable the (rather verbose) ``timer'' diagnostics going to the screen of an interactive session, you may be able to determine if something's holding up the select(). Normal logs are probably useless as you've got the syslogd latency added in. Something like ``set log local timer'' will show you what descriptors are being added to what fd_set's. It may give you a "feel" for whether the select() is being done as required. Also, I'm not sure if you've merged version 1.32 of timer.c from the HEAD branch into your current sources. If you have, you might try backing that out and seeing if that improves things. The change reduces ppps interrupt overheads, but exposes any small latency problems, making them into more serious errors. This sounds quite plausible given your latency timings (just over a second). There are a number of other timers that are set at one second (the modem carrier timer and the throughput timers spring to mind) which will break ppp out of the select() and cause another batch of *_UpdateSet() calls. The danger here (or the thing to be wary of) is that if you return from your local *_UpdateSet() function without updating any of the passed fd_set's, you won't be called again for an arbitrary amount of time. This means that you sometimes need to recurse in *_UpdateSet() - take a look at datalink.c for an example. There are a few places in datalink_UpdateSet() that ``return datalink_UpdateSet()'' after altering the datalink::state. If recursing isn't appropriate (you really have nothing else to do at the moment, but would like to be called again pretty soon), you need to implement a ``timer'' (which doesn't actually need to do anything). That'll drop ppp out of the select() and cause a new call to all the *_UpdateSet() functions too. > Doug White | Pacific Crest Networks > Internet: dwhite@pond.net | http://www.pond.net/ -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message