Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Broadly the dynamic AV implementation replaces the existing statically allocated arrays used for mapping addresses in rxd_av and the peers array in rxd_ep with a bufpool based implementation which has inbuilt mechanism to grow when it is required. Additionally to ensure uniqueness of the address mappings and bufpool entries the hashtables based off of the UT hash library have been used. As a result the mappings between theaddresses that the rxd uses internally has undergone some changes. In the struct rxd_av(rxd.h) - The rxd_av->dg_av is unchanged -used to store the endpoint address (addr) and maps it to the dg_addr. - The rxd_av->util_av which was unsused earlier is now used to create a mapping between the fi_addrs to the dg_addrs. The fi_addrs are returned to the application as before. This was chosen since this is already implemented using a bufpool. (effectivley util_av.pool[fi_addr] = dg_addr) - The rxd_av->ep_dgaddr_hash is used to ensure that the addr-->dg_addr entries in the dg_av are unique. - rxd_av->ofi_rbmap is not used anymore. In the struct rxd_ep(rxd.h) - The rxd_ep->peers array is replaced by rxd_ep->peer_pool which is an indexed bufpool. - The rxd_ep->ep_rxdaddr_hash is used to create a unique mapping between the endpoint address (addr) and the peer_entry index(rxd_addr) in the peer_pool (addr-->rxd_addr) to prevent duplicate insertions in the peer_pool. - The rxd_ep->fi_rxdaddr_hash is used to create a unique mapping between the fi_addr-->rxd_addr for fi_addr from the util_av This is used mainly during transfer operations to fetch a peer when a fi_addr is provided. (This hashtable is stored in the rxd_ep because the peer entry can be created both when an RTS happens as well as when an application tries to insert the endpoint address. This can result in unique rxd_addr values for different endpoints for the same fi_addr depending on when the peer_entry was created in the peer pool). Address Insertioni/Peer Creation(rxd_av.c/rxd_ep.c/rxd_cq.c) (rxd_av.c: rxd_av_insert) The address insertion from the app is handled in rxd_av_insert. Here, for each addr which is inserted in the dg_av/util_av a peer_entry and a mapping fi_addr-->rxd_addr (index of the peer_entry) is created for every endpoint in the rxd_av->util_av.ep_list. (rxd_ep.c:rxd_ep_bind) If however, the av was populated before the ep_bind call by the app, the eplist would be empty. In this case the peer entries and the ep->fi_rxdaddr_hash mappings are created during the rxd_ep_bind call for each addr that was inserted in the av->dg_av/av->util_av during rxd_av_insert. (rxd_cq.c:rxd_handle_rts) The peer_entry creation can also happen during an RTS in rxd_handle_rts. However,the ep->fi_rxdaddr_hash (fi_addr-->rxd_addr) mapping is not created during an RTS. This mapping is created only when an app wants to insert an address, i.e. when a fi_addr is created. Initializations/Deletion/close rxd_ep intialization changes(rxd_ep.c) -The ep->peer_pool initilization is done when the rxd_endpoint gets called. The rxd_init_peer is removed and that code is merged in the newly created rxd_peer_init_fn which is used in the new rxd_peer_pool_create function. The RXD_PEER_POOL_CHUNK_CNT is set at 1024, so the peer_pool grows in by this count whenever the expnsion is needed. -The rxd_ep_init_res and rxd_ep_free_res are modified to incorporate peer_pool initialization and free-up. -free up of hashtable entries in rxd_ep_close -The rxd_env.max_peers is removed from the code. rxd_av Initializations/removal/close(rxd_av.c) rxd_av_create : Removed initializations of statically allocated tables and the use of rxd_env_max_peers. rxd_av_remove: The fi_addr-->rxd_addr hashtable entries are removed and free-ed. However, the peer_pool entries are not removed in order to ensure that any pending transfers are not affected. rxd_av_close: added call to rxd_av_delete_hashtable used to delete entries in rxd_av->ep_dgaddr_hash. (addr-->dg_addr) Newly added support functions in rxd. (declarations in rxd.h) rxd_ep.c: rxd_get_peer_by_epaddr : to get a peer from the peer_pool for a given ep addr rxd_get_peer_by_fiaddr : to get a peer from the peer_pool for a given fi_addr. rxd_epaddr_hash_insert : create addr-->rxd_addr mapping rxd_fiaddr_hash_insert : create fi_addr-->rxd_addr mapping. rxd_fiaddr_hash_lookup : return rxd_addr for a given fi_addr. rxd_map_av_to_ep : to associate addresses inserted in the av to an ep. rxd_ep_delete_hashtables: to delete hashtables stored in the ep. rxd_av.c: rxd_av_delete_hashtable : to delete hashtbale stored in the av. send/recv/inject functions modified in rxd_msg.c, rxd_rma.c, rxd_atomic.c to use ep->peer_pool and ep->fi_rxdaddr_hash for transfer operations. struct rxd_dgaddr_entry, rxd_fiaddr_entry and rxd_epname_entry are supporting data structures which describe the entries stored in the hashtables. Signed-off-by: Nikhil Nanal <[email protected]>
- Loading branch information