[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090312.055235.56926675.davem@davemloft.net>
Date: Thu, 12 Mar 2009 05:52:35 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: pktoss@...il.com
Cc: dcbw@...hat.com, rusty@...tcorp.com.au, netdev@...r.kernel.org
Subject: Re: [PATCH] Make virtio_net support carrier detection
From: Pantelis Koukousoulas <pktoss@...il.com>
Date: Thu, 12 Mar 2009 14:47:09 +0200
> > The problem is that there's no "my carrier detection is accurate" flag
> > for drivers. Drivers that don't support carrier detection (say, my
> > Belkin PCMCIA NE2k card) always report "carrier on", but of course don't
> > support carrier detection. So when NetworkManager looks at the device
> > and sees "hey, there's a carrier!" it will activate it, because a
> > carrier means the cable is plugged in or the PHY *thinks* a cable is
> > plugged in.
> >
> > So NetworkManager checks whether the device supports ethtool get_link or
> > MII register carrier status in lieu of a general kernel driver flag for
> > "I support carrier detection".
> >
> > Carrier is not on/off, it needs to be tristate, like on/off/unknown. If
> > it was unknown, NM could make an intelligent decision about this without
> > resorting to ethtool/MII checks. But we don't have that.
>
> This looks like an independent problem imho, one of kernel<->userspace
> API. The current 'defacto' way of finding out if detection is supported or
> not (ethtool) seems to give the needed information even if somewhat ugly.
>
> The issue discussed here as I understand it is whether virtio should or
> should not support carrier status reporting. IMHO it should, since
> it is useful functionality and doesn't cost much.
>
> Dan, What is your opinion on that?
I think Dan is right.
If the driver doesn't provide an explicit carrier, there is no way to
know for sure that it is on of off. If NetworkManager decides that
this means on, and it's really off, that isn't so nice.
And lots of very old drivers in the tree don't have a link indication
handler, so this is a very real issue.
Not adding a link state handler to virtio_net for pompous reasons like
some theoretical "clean design" claim is idiotic, and in the end bad
for users who are using existing versions of NetworkManager.
I also think the NetworkManager change is wrong, lack of link
indication support does not mean the link is always on, not by a
country mile. Tell that to all the ancient ethernet drivers in
our tree.
If the link is always on, you should make that explicit by providing
a link state handler, and making sure it always returns true.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists