@@ -251,7 +251,7 @@ struct efa_ah *efa_ah_alloc(struct efa_domain *domain, const uint8_t *gid)
251251 return efa_ah ;
252252 }
253253
254- efa_ah = malloc ( sizeof (struct efa_ah ));
254+ ofi_memalign (( void * * ) & efa_ah , EFA_MEM_ALIGNMENT , sizeof (struct efa_ah ));
255255 if (!efa_ah ) {
256256 errno = FI_ENOMEM ;
257257 EFA_WARN (FI_LOG_AV , "cannot allocate memory for efa_ah\n" );
@@ -469,7 +469,7 @@ int efa_av_reverse_av_add(struct efa_av *av,
469469
470470 HASH_FIND (hh , * cur_reverse_av , & cur_key , sizeof (cur_key ), cur_entry );
471471 if (!cur_entry ) {
472- cur_entry = malloc ( sizeof (* cur_entry ));
472+ ofi_memalign (( void * * ) & cur_entry , EFA_MEM_ALIGNMENT , sizeof (* cur_entry ));
473473 if (!cur_entry ) {
474474 EFA_WARN (FI_LOG_AV , "Cannot allocate memory for cur_reverse_av entry\n" );
475475 return - FI_ENOMEM ;
@@ -487,7 +487,7 @@ int efa_av_reverse_av_add(struct efa_av *av,
487487 * and only RDM endpoint can reach here. hence the following assertion
488488 */
489489 assert (av -> domain -> info_type == EFA_INFO_RDM );
490- prv_entry = malloc ( sizeof (* prv_entry ));
490+ ofi_memalign (( void * * ) & prv_entry , 64 , sizeof (* prv_entry ));
491491 if (!prv_entry ) {
492492 EFA_WARN (FI_LOG_AV , "Cannot allocate memory for prv_reverse_av entry\n" );
493493 return - FI_ENOMEM ;
@@ -1315,9 +1315,10 @@ int efa_av_open(struct fid_domain *domain_fid, struct fi_av_attr *attr,
13151315 else
13161316 attr -> count = MAX (attr -> count , EFA_MIN_AV_SIZE );
13171317
1318- av = calloc ( 1 , sizeof (* av ));
1318+ ofi_memalign (( void * * ) & av , EFA_MEM_ALIGNMENT , sizeof (* av ));
13191319 if (!av )
13201320 return - FI_ENOMEM ;
1321+ memset (av , 0x0 , sizeof (* av ));
13211322
13221323 if (attr -> type == FI_AV_MAP ) {
13231324 EFA_INFO (FI_LOG_AV , "FI_AV_MAP is deprecated in Libfabric 2.x. Please use FI_AV_TABLE. "
0 commit comments