> -----Original Message----- > From: Shashidhara Shamaiah [mailto:[email protected]] > Sent: Tuesday, May 22, 2012 4:26 AM > To: [email protected] > Subject: [E1000-devel] speed and speed_hi setting in ethtool_cmd > > Hi, > > > > There is a doubt with the working of e1000e driver - > 1.9.5-NAPI-intel-2012-02-29 version. We are seeing a non-zero value of > 65355 being returned for speed_hi for the ethtool_cmd structure for > the > ioctl ETHTOOL_GSET. when the interface is up it returns zero for > speed_hi. For setting the Ethernet speed/duplex we first query the > driver with the ioctl ETHTOOL_GSET and change only the speed and > duplex > values in the ethtool_cmd structure and leave the rest(speed_hi) as is > and invoke the ioctl ETHTOOL_SSET. We don't see this issue with the > older driver version - 1.0.2-k2 . I have looked at the function > e1000_get_settings in the newer driver version, where the following > code > seems to cause the problem. > > > > speed = -1; > > ecmd->duplex = -1; > > > > if (netif_running(netdev)) { > > if (netif_carrier_ok(netdev)) { > > speed = adapter->link_speed; > > ecmd->duplex = adapter->link_duplex - 1; > > } > > } else { > > u32 status = er32(STATUS); > > if (status & E1000_STATUS_LU) { > > if (status & E1000_STATUS_SPEED_1000) > > speed = SPEED_1000; > > else if (status & E1000_STATUS_SPEED_100) > > speed = SPEED_100; > > else > > speed = SPEED_10; > > > > if (status & E1000_STATUS_FD) > > ecmd->duplex = DUPLEX_FULL; > > else > > ecmd->duplex = DUPLEX_HALF; > > } > > } > > > > ethtool_cmd_speed_set(ecmd, speed); > > > > In the above code fragment speed is defined as u32 and set to -1 which > means 4294967295. When the control doesn't enter the either of above > if-else branch. speed will be 4294967295. So when > ethtool_cmd_speed_set() gets called, speed and hi_speed both gets set > to > 65535. > > In the driver version 1.0.2-k2, the code is different and > ethtool_cmd_speed_set() is not used to set the speed values. > > Can you please let me know if this behavior is right and if not should > I > raise a bug to get it fixed. > > > Regards > > Shashidhara
The upstream commits that introduced these code changes were provided by David Decotigny <[email protected]> and are believed to be correct. Are you having any issues with the operation of the driver? ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ E1000-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/e1000-devel To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired
