From: Chris Friesen <cfriesen@nortelnetworks.com>
To: Donald Becker <becker@scyld.com>
Cc: netdev@oss.sgi.com
Subject: Re: how to report network device errors to userspace?
Date: Wed, 19 Jun 2002 17:19:14 -0400 [thread overview]
Message-ID: <3D10F552.C05ADD53@nortelnetworks.com> (raw)
In-Reply-To: Pine.LNX.4.33.0206191616060.1669-100000@presario
Donald Becker wrote:
>
> On Wed, 19 Jun 2002, Chris Friesen wrote:
>
> > I'm curious about the proper way for a network device driver to report
> > faults to userspace.
>
> What type of fault?
I'm looking for asynchronous notification of events such as loss of ethernet
carrier or SONET LOS/LOF/LCD/RDI/AIS. When the driver figures out (whether
interrupt or poll-based) that it's lost connectivity it then somehow notifies a
userspace app that something has happened, so the userspace app can deal with
it.
Currently the way we are doing it for ethernet is that the userspace app calls a
device ioctl() with SIOCGMIIREG multiple times per second, but it would be nice
to have the driver notify us asynchronously.
> People very much care. There are sufficient reporting mechanisms for
> most errors -- it's much more consistent, orthogonal and thorough than
> other device types. Compare /proc/net/dev with the errors reported for
> disks, serial, USB, keyboard...
Is it possible to select() on an entry in /proc/net becoming readable? Is
reading from /proc/net and converting from ASCII faster than doing an ioctl() to
the driver and getting binary data?
Basically, I want a userspace app to be notified somehow by the kernel that a
link that I've expressed interest in has lost physical connectivity, and I want
to get that information as fast as possible after the event.
I've hacked a SONET driver to allow a userspace app to register its pid, which
then gets sent SIGUSR1 on critical events to tell it to use ioctl() to get the
actual information, but this is not very clean nor is it scalable.
Thanks,
Chris
--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com
next prev parent reply other threads:[~2002-06-19 21:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-19 18:39 how to report network device errors to userspace? Chris Friesen
2002-06-19 20:21 ` Donald Becker
2002-06-19 21:19 ` Chris Friesen [this message]
2002-06-19 21:36 ` Andi Kleen
2002-06-19 21:44 ` Chris Friesen
2002-06-19 21:54 ` Andi Kleen
2002-06-20 2:44 ` James Morris
2002-06-20 2:50 ` jamal
2002-06-19 21:45 ` Jes Sorensen
2002-06-19 21:50 ` Chris Friesen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3D10F552.C05ADD53@nortelnetworks.com \
--to=cfriesen@nortelnetworks.com \
--cc=becker@scyld.com \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).