[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Netgraph, usleep, and moving to Kernel
- To: "freebsd-hackers_(_at_)_freebsd_(_dot_)_org" <freebsd-hackers_(_at_)_freebsd_(_dot_)_org>
- Subject: Netgraph, usleep, and moving to Kernel
- From: "Len Gross" <sandiegobiker_(_at_)_gmail_(_dot_)_com>
- Date: Sun, 3 Feb 2008 13:42:01 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=qOXawWEj+w5q8vLjfteCM1W4qvhUzeZAksX7JVW8BL0=; b=B2QlJxflvp2eVso8yjNtMYGfSK5f4srgWlc89fxnC/8WACU1IJeerdC75i24/LRh26MhLK0c60ajCPoZZ0OF6LDm9Z1JBJ7Hn2H9KdMaKprC/F7msA4sq4C2B+6nUJeCSuH9+xPdJfIG4WYc5GG8YYRTPxuhmCs20Ps/sE4mB10=
I've had some good success with implementing a custom MAC protocol using
Netgraph. The current implementation runs in userland, connects to the
Kernel iface and kernel ethernet nodes. It uses a polling loop with
usleep, All very cool. This is just background as the question really has
to do with usleeop in userland or kernel mode.
In testing with nothing else running on the box. it seems to reveal that if
I ask for 100 usec of "sleep time," I get about 1000 usec (1 msec). I have
set hz to 10,000 in kern.clockrate and Ticks is at 100.
If I set hz to 20,000 there is no improvement and Ticks seems to "reset
itsefl" to 50. Box is an old Pentium with about 500 Mhz clock. I also get
this behaviour on "test programs" that just call usleep.
1) Is there a way to get finer timing with usleep or an equivalent call?
2) When I move the userland into a "true" Netgraph Kernel node will I see
Thanks in advance.
freebsd-hackers_(_at_)_freebsd_(_dot_)_org mailing list
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe_(_at_)_freebsd_(_dot_)_org"
Visit your host, monkey.org