From: SourceForge.net <no...@so...> - 2007-09-20 08:51:27
|
Patches item #1797111, was opened at 2007-09-18 23:49 Message generated for change (Comment added) made by mitsuru_chinen You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=1797111&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: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jan Safranek (jsafranek) Assigned to: Nobody/Anonymous (nobody) Summary: Better support for ipIfStatsTable Initial Comment: There is already patch #1727224, which adds ipIfStatsTable support for Linux, but it is copy-paste from ipSystemStatsTable. Linux implementation of ipIfStatsTable and ipSystemStatsTable is quite similar, so I have reworked them to share common code (ip-mib/data_access/systemstats*). The generated code is of course separate (ip-mib/ipIfStatsTable/* and ip-mib/ipSystemStatsTable/*). I also used idea from patch #1707384, which adds portability to the ipSystemStats table - it would be possible to support different columns of the table on different systems. My version allows to support different columns on different systems and different IP versions (e.g. we have ipSystemStatsOutBcastPkts for IPv4, but not for IPv6) In addition, the patch #1707384 introduced idea to compute missing statistics - Linux kernel does not provide value for e.g. ipSystemStatsHCOutTransmits, but it can be computed as OutRequests-OutNoRoutes+OutForwDatagrams-OutFragReqds+OutFragCreates-OutDiscards, that are provided by kernel. Unfortunately, on 32 bit systems, these values are 32-bit and we want 64 bit result -> these values must be tracked in 64 bits, using the same magic as ipSystemStatsHCInReceives (poll periodically the 32 bit value, detect overflow and reconstruct 64 bit value internally). It's quite huge patch modifying whole ipSystemStatsTable, but it provides more accurate results on 32 bit Linux and shares code among ipSystemStatsTable and ipIfStatsTable. The patch also obsoletes patches #1783438, #1783434 and 1783432. Tested on Linux, Fedora 7, x86_64 and i386, kernel 2.6.22.4-65.fc7. Applies to svn#16702. I had to compress the patch because of its size. ---------------------------------------------------------------------- Comment By: Mitsuru Chinen (mitsuru_chinen) Date: 2007-09-20 17:51 Message: Logged In: YES user_id=1725791 Originator: NO Thanks for your explanation! I got it. Now, I have no objection to drop my patches. ---------------------------------------------------------------------- Comment By: Jan Safranek (jsafranek) Date: 2007-09-20 16:41 Message: Logged In: YES user_id=1784238 Originator: YES In _calculate_entries() I need all necessary 32 bit counters to be already expanded to 64bits, which is done in netsnmp_access_systemstats_entry_update_stats and it's platform independent function. You can notice I calculate the entries only if the platform dependent part did not provide them and provides all the other values needed for calculation. So if the platform has the values, nothing will be calculated: if (!entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINFORWDATAGRAMS] && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFORWDATAGRAMS] && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINNOROUTES]) { ... calculate HCInForwDatagrams ---------------------------------------------------------------------- Comment By: Mitsuru Chinen (mitsuru_chinen) Date: 2007-09-20 10:38 Message: Logged In: YES user_id=1725791 Originator: NO Hi, I'm the author of patch #1727224(for ipIfStatsTable) and #1707384(for ipSystemStats) Table. Thank you for your input. I agree your patch is better than mine. One my concern in your patch is the position of the code to calculate missing statistics. Which statistics are missing would be different per OS. Therefore, _calculate_entries() should not be in systemstats_common.c. The code should be in the file only for Linux. I will agree to drop my patches if you fix this. Thank you, ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=1797111&group_id=12694 |