[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d8e83e50ed440ef46a7746ed7abdb9fffc4d7491.camel@infinera.com>
Date: Fri, 7 Dec 2018 17:01:11 +0000
From: Joakim Tjernlund <Joakim.Tjernlund@...inera.com>
To: "andrew@...n.ch" <andrew@...n.ch>
CC: "claudiu.manoil@....com" <claudiu.manoil@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH] gianfar: Add gfar_change_carrier()
On Fri, 2018-12-07 at 15:15 +0100, Andrew Lunn wrote:
>
>
> > Been a bit busy today but now I have played with dormant using ip link and got some odd results:
> > # > ifconfig eth0
> > eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
> > inet 172.20.0.246 netmask 255.255.0.0 broadcast 172.20.255.255
> > inet6 fe80::ad9c:b230:1da8:1821 prefixlen 64 scopeid 0x20<link>
> > ether 8c:16:45:89:cf:c6 txqueuelen 1000 (Ethernet)
> > RX packets 1848903 bytes 736764445 (702.6 MiB)
> > RX errors 0 dropped 0 overruns 0 frame 0
> > TX packets 627462 bytes 222453345 (212.1 MiB)
> > TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
> > device interrupt 16 memory 0xdc200000-dc220000
> > # > ip link set mode dormant dev eth0
> > ping sunet.se
> > PING sunet.se (192.36.171.231) 56(84) bytes of data.
> > 64 bytes from webc.sunet.se (192.36.171.231): icmp_seq=1 ttl=54 time=2.22 ms
> > 64 bytes from webc.sunet.se (192.36.171.231): icmp_seq=2 ttl=54 time=2.17 ms
> >
> > # > ifconfig eth0
> > eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
> > inet 172.20.0.246 netmask 255.255.0.0 broadcast 172.20.255.255
> > inet6 fe80::ad9c:b230:1da8:1821 prefixlen 64 scopeid 0x20<link>
> > ether 8c:16:45:89:cf:c6 txqueuelen 1000 (Ethernet)
> > RX packets 1905479 bytes 753549572 (718.6 MiB)
> > RX errors 0 dropped 0 overruns 0 frame 0
> > TX packets 648266 bytes 224421617 (214.0 MiB)
> > TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
> > device interrupt 16 memory 0xdc200000-dc220000
> > still RUNNING ..
> >
> > #> ip link show eth0
> > 5: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DORMANT group default qlen
> >
> > state is still UP ?
> >
> > # > ip link set state dormant dev eth0
> > # > ip link show eth0
> > 5: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state DORMANT mode DORMANT group default qlen 1000
> > # > ifconfig eth0
> > eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
> > ...
> >
> > Now both state and not RUNNING :)
> > but ...
> > # ping sunet.se
> > PING sunet.se (192.36.171.231) 56(84) bytes of data.
> > 64 bytes from webc.sunet.se (192.36.171.231): icmp_seq=1 ttl=54 time=2.43 ms
> > 64 bytes from webc.sunet.se (192.36.171.231): icmp_seq=2 ttl=54 time=2.31 ms
> >
> > I can still ping though. Is this how it is supposed to work ? No sure how state and mode relate to each other either.
>
> I don't actually know. I know some things are supposed to work while
> dormant. You should be able to perform 802.1x negotiation, etc.
>
> You might find the people on the wireless list know more. I think it
> is used by wpa_supplicant and hostapd during device authentication.
I am not sure why .ndo_change_carrier() is a no go in real drivers. Consider PHY less (aka Fixed PHYs)
devices. Here it makes sense to be able to control carrier from /sys I think.
Would you be happier if .ndo_change_carrier() only acted on Fixed PHYs?
I could also rework ndo_change_carrier to only use netif_carrier_on/off like team and dummy do.
Jocke
Powered by blists - more mailing lists