Hi Allan, Thanks for the information. My question is after setting speed =-1, if the control unit executes either the if or the else blocks ( where speed is modified). Then the next ethtool_cmd_speed_set(ecmd, speed) is called which sets the ethool->speed and ethtool->speed_hi values . Is there a possible scenario where neither the if nor the else block gets executed, and the function ethtool_cmd_speed_set() sets the speed_hi and speed fields to 65535. Please do let me know if you need any other details.
Thanks and Regards Shashidhara -----Original Message----- From: Allan, Bruce W [mailto:[email protected]] Sent: Thursday, May 24, 2012 6:47 AM To: Shashidhara Shamaiah; [email protected] Subject: RE: [E1000-devel] speed and speed_hi setting in ethtool_cmd > -----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? Information transmitted by this e-mail is proprietary to MphasiS, its associated companies and/ or its customers and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at [email protected] and delete this mail from your records. ------------------------------------------------------------------------------ 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
