[PATCH 00/11] New Caching mechanism for ib_core

Goldwyn Rodrigues
2011-11-07T08:47:54Z

Hi,

This series of patches introduces caching as a library in the ib_core
as compared to the previous of implementation as a part of the
ib_device calls. Each driver can make use of this by including
the ib_cache data structure in the individual device structure.
The updation of the cache is the responsibility of the driver, and
is best incorporated in the pkey/gid query functions. However, the
driver may choose to pre-populate the cache on initialization.

The main motivations are:

1. Greater degree of control by individual drivers. Drivers have a
choice to use it or not.
2. The library functions do not sleep, and can be called from any context.

In the bargain we lose the lmc cache. However, if we move it to the device
structure like the pkey_tbl_len, it can be accessed directly (TODO).
Let me know what you think about it.

I have changed only the mthca driver for now to use this API of the
cache. If I get positive comments, I will incorporate it in the
rest of the drivers as well. Let me know what you think.

TODO:
Use finer granuality of locking for pkey and gid tables.

Suggestions welcome.