Re: [B.A.T.M.A.N.] [RFC 18/23] batman-adv: ELP - use phydev to determine link characteristics

Antonio Quartulli
2014-02-14T19:18:06Z

[-- Attachment #1: Type: text/plain, Size: 1914 bytes --]

On 14/02/14 19:18, Andrew Lunn wrote:
>> Are you 100% sure that the NETDEV_UP event was sent within those 3
>> seconds and not after?
>> If you use a serial console you should see the kernel output mixed with
>> your test. (just to be 100% sure..)
>
> http://lxr.free-electrons.com/source/net/core/dev.c#L1286
>
> 1286 int dev_open(struct net_device *dev)
> 1287 {
> 1288 int ret;
> 1289
> 1290 if (dev->flags & IFF_UP)
> 1291 return 0;
> 1292
> 1293 ret = __dev_open(dev);
> 1294 if (ret < 0)
> 1295 return ret;
> 1296
> 1297 rtmsg_ifinfo(RTM_NEWLINK, dev, IFF_UP|IFF_RUNNING, GFP_KERNEL);
> 1298 call_netdevice_notifiers(NETDEV_UP, dev);
> 1299
> 1300 return ret;
> 1301 }
>
>
> So the NETDEV_UP is sent as soon as __dev_open() returns,
> i.e. ndo_open().

Yeah, I hoped that the negotiation was performed within dev_open() :-(

>
> What i do see is:
>
> half
> 1000
> half
> 1000
> half
> 1000
> half
> 1000
> half
> 1000
> half
> 1000
> mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flowd
> full
> 1000
>
> The link up is from:
>
> http://lxr.free-electrons.com/source/drivers/net/ethernet/marvell/mv643xx_eth.c#L1990
>
> There is no sign of a call_netdevice_notifiers() here, but i think a
> netlink message will be sent to userspace because of the
> netif_carrier_on() call.

I tried to follow netif_carrier_on() but I couldn't find any particular
function firing any event.

Maybe I should simply make it simple and read the Ethernet card
properties inside get_throughput() upon ELP sending (like I do for the
wifi throughput)?

I did put it in iface_activate() because I expected this values to be
rather static, but now you convinced me that this is not the case :-)

Cheers,

--
Antonio Quartulli

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]