|
From: Tantilov, E. S <emi...@in...> - 2013-03-26 17:10:25
|
>-----Original Message-----
>From: Anand Raj Manickam [mailto:an...@gm...]
>Sent: Tuesday, March 26, 2013 9:25 AM
>To: Tantilov, Emil S
>Cc: Waskiewicz Jr, Peter P; e10...@li...
>Subject: Re: [E1000-devel] False ethtool report on Link Detection
>
>On Tue, Mar 26, 2013 at 8:34 PM, Tantilov, Emil S
><emi...@in...> wrote:
>>>-----Original Message-----
>>>From: Anand Raj Manickam [mailto:an...@gm...]
>>>Sent: Tuesday, March 26, 2013 5:04 AM
>>>To: Waskiewicz Jr, Peter P
>>>Cc: e10...@li...
>>>Subject: Re: [E1000-devel] False ethtool report on Link Detection
>>>
>>>On Tue, Mar 26, 2013 at 12:09 PM, Waskiewicz Jr, Peter P
>>><pet...@in...> wrote:
>>>> On 3/25/2013 10:56 PM, Anand Raj Manickam wrote:
>>>>>
>>>>> I m using the e1000e driver for Intel 82574L chipset .
>>>>> When the cable is plugged in and Auto Negotiated , It reports as Link
>>>>> Detected as NO. I need to do a ifconfig up eth3 to get the Link
>>>>> Detected as YES .
>>
>> This is the correct behavior. The Link status in this case is reported by
>ethtool, not the driver:
>>
>> Look in net/core/ethtool.c in your kernel source:
>>
>> u32 ethtool_op_get_link(struct net_device *dev)
>> {
>> return netif_carrier_ok(dev) ? 1 : 0;
>>
>> This behavior should be consistent across all drivers that provide this
>info. From what I can see struct ethtool_cmd which carries this information
>does not have a link member.
>>
>> Thanks,
>> Emil
>
>As per my debug , it seems to pick from netdev.c in driver
>e1000_mii_ioctl()
Unless you are using a different driver, e1000_mii_ioctl() is not called by ethtool, from what I can see in the code. You can check this if you put a printk in it and call ethtool ethX. This function would be called by mii-tool which should report the link as you expect.
>But realtek reports it right .. When the Link is plugged - ethtool
>reports Link Detected YES. even though the ifconfig eth3 down is set.
As I mentioned earlier in the case of ethtool we use the report from ethtool. If you want to detect the state of the link when the interface is down, don't use the "Link detected" field, look at the Speed/Duplex,that would give you a better idea about the state of the link.
Thanks,
Emil
|