[dpdk-dev] [PATCH] hash: move rte_hash structure to C file and make it internal

Bruce Richardson bruce.richardson at intel.com
Thu Jul 9 10:12:23 CEST 2015


On Wed, Jul 08, 2015 at 09:57:03AM -0700, Matthew Hall wrote:
> On Wed, Jul 08, 2015 at 02:21:42PM +0100, Bruce Richardson wrote:
> > Irrespective of whether or not we change the underlying hash table implementation
> > this looks a good change to me. The rte_hash structure should not be used directly
> > by any applications - the APIs all take pointers to the structure,
> > so there should be no ABI breakage from this, I think.
> > 
> > Therefore:
> > 
> > Acked-by: Bruce Richardson <bruce.richardson at intel.com>
> 
> Hi guys,
> 
> There are places where this will be annoying on the app side.
> 
> A lot of rte_hash, rte_lpm*, rte_table, etc. don't provide methods to iterate 
> whole structures with a callback function that includes the current structure 
> node, and a user-data pointer.
> 
> This can make it real unpleasant when you want to walk through the structure 
> and free a bunch of items it points to and so forth.
> 
> So if you're going to obfuscate things by censoring the structure contents 
> then we'd really like to be sure they have a full set of CRUD operations and 
> iteration support so one could manage the nodes individually and in bulk.
> 
> Matthew.

Thanks for the feedback Matthew. Can you suggest a function prototype for such
a walk operation that would make it useful for you. While we can keep the
hash structure public, I'd prefer if we could avoid it, as it makes making changes
hard due to ABI issues.

/Bruce


More information about the dev mailing list