Re: [patch net-next-2.6 1/2] net: allow to change carrier via sysfs
flat view
From: Ben Hutchings <hidden>
Date: 2011-08-31 20:44:44
On Wed, 2011-08-31 at 22:31 +0200, Nicolas de Pesloüan wrote:
Le 31/08/2011 22:12, Ben Hutchings a écrit :quoted
On Wed, 2011-08-31 at 22:03 +0200, Nicolas de Pesloüan wrote:quoted
Le 31/08/2011 10:45, Jiri Pirko a écrit :quoted
quoted
quoted
quoted
Do you expect drivers using implementation different than just calling netif_carrier_on/off? Or is it supposed to also e.g. power down PHYs?Yes, generally it can be used also for en/disable phy, for testing purposes if hw and driver would support it.I'd like to see this working for GRE tunnel devices (for keepalive daemon to be able to indicate to routing daemons whether tunnel is really working) - implementation would be identical to dummy's case. Should I prepare a patch or can I leave it to you?Ok, I can include it to this patchset (I'm going to repost first patch anyway)Can't we assume that the dummy's case is the default behavior and register this default ndo_change_carrier callback for every device ?You have got to be joking. No device driver that has real link monitoring should use this implementation.Well, why not? Arguably, this is probably not the feature one would use every day, but... Testing a cluster reaction to a link down event would be easier if one doesn't need to unplug the cable for the test. I understand that one can turn off the switch port (physical or virtual), but echo 0 > /sys/class/net/eth0/carrier would be nice too. Of course, I assume that netif_carrier_on and netif_carrier_off are only called on real link status change. So the value written into /sys/class/net/eth0/carrier would stay until the link revert it, due to a double status change (up-down-up or down-up-down). But I may miss totally this point.
Think what happens if the user sets carrier on, when the link is actually down. Ben. -- Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.