On Wed, 9 Nov 2016 16:10:33 +0530 Soubhagya wrote:
SP> Yes, we have used mib2c compiler to generate the code and which
SP> I feel it's same to MFD template.
SP> 
SP> Apart from "Which method would you like to use to gather data
SP> about available rows?" option all other option we choosed is
SP> DEFAULT. For this option alone we have choosed second one which
SP> nothing but as follows.
SP> 
SP>   2) container-cached : This access method uses a
SP> netsnmp_container to keep track of the indexes (and data,
SP> usually) for each row. This method is best for:
SP>          - External data (maintained by another process/the
SP> kernel)
SP>          - Access speed is important
SP>          - Sufficient memory exists to contain all indexes
SP> 
SP> yes I agreed, Each route has its own row in the table. so
SP> obviously we need a rowreq_ctx for each.
SP> You need to release both (at the appropriate time). here do you
SP> mean I need to clear the container as well as release memory
SP> for rowreq_ctx ???

You shouldn't need to clear the container. The interface code
should do if for you.

When mib2c generated code for the cache, it created created the
following functions:

- *Table_container_load(): This function should allocate a
  rowreq_ctx for each row and add it to the container. This
  function will be called when the first request for the table is
  received, and again later after the cache has expired.

- *Table_container_free(): This function is called when the cache
  expires and the container is about to be released. You do not
  need to do anything here unless you need to perform some action
  before the cache is freed.

- *Table_rowreq_ctx_cleanup(): This function cleans up mib data
  allocated for the rowreq_ctx. You shouldn't need to do anything
  here either, if you haven't added to or modified the rowreq_ctx
  or *Table_data structures. After calling this function, the
  interface code will will call *Table_release_rowreq_ctx() for the
  row.

SP> But my concern is related to add_ipv6_route_entries() which we
SP> manually implemented. where again we are using a *rowreq_ctx
SP> and for each entry we are allocating memory and inserting to
SP> container (through a loop)using CONTAINER_INSERT(). 

If you are allocating memory yourself (not just creating the
rowreq_ctx), then that additional memory should be freed in
*Table_rowreq_ctx_cleanup(), which will be called when the
container is being cleared in preparation for the next
container_load call.

Robert

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to