Hi all,
I'm happy to tell you that I got a big improvement on
performance when applying NETSNMP_ITERATOR_FLAG_SORTED to table_iterator
, but I need confirmation that I'm in the correct way correctly,
because right now it is working partially - only when getting the first
column in table - (maybe I missed something that you'll be able to point
me).
My experiment is based on the fact that when using
NETSNMP_ITERATOR_FLAG_SORTED, table_iterator handler sends as a hint the
netsnmp_table_request_info param (in my_loop_context) when calling
*_get_first_data_point function. In *_get_first_data_point I extract the
OID from netsnmp_table_request_info and then I find the next OID+data
(if OID is empty I give the first element in table). When using this
code I saw that *_get_next_data_point was NOT called at all (so, I
obtained performance of 1 access per line, of course that my table is
sorted according to SNMP needs). However regular SNMP GET does not work
(because I'm providing next data only), so I've realized that if I know
which kind of SNMP request I'm handling in *_get_first_data_point, I
would be able to handle this situation also. I applied on my net-snmp
package a small change in table_iterator.c (line 624):
/* if sorted, pass in a hint */
if (hintok && (iinfo->flags & NETSNMP_ITERATOR_FLAG_SORTED))
{
callback_loop_context = table_info;
callback_data_context = reqinfo; //
<======================added line
}
After this small change I check in *_get_first_data_point if
I'm handling GET_NEXT/GET_BULK or SNMP GET.
As a generalized way, *_get_first_data_point would be:
XXX_get_first_data_point(...)
{
...
netsnmp_table_request_info *table_info = *my_loop_context;
netsnmp_agent_request_info *reqinfo = *my_data_context;
// get first
if (!reqinfo || table_info->index_oid_len == 0)
{
... get first OID + data
}
else
{
if (table_info->index_oid_len > 0)
{
... extract OID from request
}
// if get next
if (reqinfo->mode == MODE_GETNEXT || reqinfo->mode ==
MODE_GETBULK)
{
... Fill next OID + data
}
else
{
... get current OID + data
}
}
Apparently XXX_get_next_data_point is not called.
I think I got better performance even from
_cache_load/_cache_free schemes used for example with tcp.c and
others... but as I mentioned previously it still has some small details
missing.
Do you think that this scheme will work for all SNMP
requests (GET/GET_NEXT/GET_BULK/SET)?
Thanks in advance,
Ivo
NOTICE: This email and any files transmitted with it are Enablence and
Teledata-Networks confidential and intended solely for the use of the
individual or entity to whom they are addressed. If you have received this
email in error please notify the sender. This message contains Enablence and
Teledata-Networks confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. If you are not the intended recipient you are
notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.
------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users