From: SourceForge.net <no...@so...> - 2011-11-22 15:21:46
|
Bugs item #3440752, was opened at 2011-11-21 07:21 Message generated for change (Comment added) made by iamasmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=3440752&group_id=12694 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: agent Group: linux Status: Open Resolution: None Priority: 5 Private: No Submitted By: Andrew Smith (iamasmith) Assigned to: Nobody/Anonymous (nobody) Summary: eth-tool speed detection fails for flexible speed envs. Initial Comment: eth-tool speed detection for interfaces fails for speeds that aren't one of the predefined heather values from linux/ethtool.h and falls back to MII detectionn which reports the interface speed incorrectly net-snmp-5.7.1/agent/mibgroup/if-mib/data_access/interface_linux.c if (edata.speed != SPEED_10 && edata.speed != SPEED_100 #ifdef SPEED_10000 && edata.speed != SPEED_10000 #endif #ifdef SPEED_2500 && edata.speed != SPEED_2500 #endif && edata.speed != SPEED_1000 ) { DEBUGMSGTL(("mibII/interfaces", "fallback to mii for %s\n", ifr.ifr_name)); /* try MII */ return netsnmp_linux_interface_get_if_speed_mii(fd,name,defaultspeed); } alternative mechanism actually used by ethtool (from ethtool-copy.h) static __inline__ __u32 ethtool_cmd_speed(struct ethtool_cmd *ep) { return (ep->speed_hi << 16) | ep->speed; } Note that the speed is simply read directly from the structure and either shifted for a high speed value or reported directly for the standard value. Example of system effected.. [root@zzzzzz ~]# ethtool eth0 Settings for eth0: Supported ports: [ AUI ] Supported link modes: 10000baseT/Full Supports auto-negotiation: No Advertised link modes: Not reported Advertised auto-negotiation: No Speed: 5000Mb/s Duplex: Full Port: AUI PHYAD: 0 Transceiver: internal Auto-negotiation: off Supports Wake-on: g Wake-on: d Link detected: no Note the 5Gb/s speed available on this blade enclosure using the.. Ethernet controller: ServerEngines Corp. Emulex OneConnect 10Gb NIC (rev 02) ..controller. snmpwalk of this host reports this NIC as follows.. IF-MIB::ifName.2 = STRING: eth0 IF-MIB::ifSpeed.2 = Gauge32: 10000000 IF-MIB::ifHighSpeed.2 = Gauge32: 10 Whereas another one of our (identical SW revision) hosts with an uncapped speed (10Gb) reports the correct values. This host initially manifest with 290% NIC utilisation in Zenoss and the problem was tracked down as follows. The problem is clearly related to the use of fixed constant matches from linux/ethtool.h which have no meaning in a gigabit network environment with variable speed allocation. Examining the fixed constants from linux/ethtool.h we find.. /* The following are all involved in forcing a particular link * mode for the device for setting things. When getting the * devices settings, these indicate the current mode and whether * it was foced up into this mode or autonegotiated. */ /* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */ #define SPEED_10 10 #define SPEED_100 100 #define SPEED_1000 1000 #define SPEED_2500 2500 #define SPEED_10000 10000 It seems these speeds are useful as arbitrary increments only when attempting to select rather than retrieve the interface speed from the host. It would seem to make more sense on the face of it to simply read and utilise the value when retrieving speed rather than confine the selections to the values present in the header. ---------------------------------------------------------------------- >Comment By: Andrew Smith (iamasmith) Date: 2011-11-22 07:21 Message: Patch tested... snmpwalk results snmpwalk results... before... IF-MIB::ifDescr.2 = STRING: eth0 IF-MIB::ifSpeed.2 = Gauge32: 10000000 IF-MIB::ifHighSpeed.2 = Gauge32: 10 and with patched version of SNMP module.. IF-MIB::ifDescr.2 = STRING: eth0 IF-MIB::ifSpeed.2 = Gauge32: 4294967295 IF-MIB::ifHighSpeed.2 = Gauge32: 5000 This correctly reports the 5GBit/s allocated via the blade enclosure. ---------------------------------------------------------------------- Comment By: Andrew Smith (iamasmith) Date: 2011-11-22 06:36 Message: Have patch, will upload following tests for comment. Just awaiting approval to test on one of the problem hosts. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112694&aid=3440752&group_id=12694 |