Skip to content

Commit

Permalink
include/ofi_xpmem: change cap into bool
Browse files Browse the repository at this point in the history
xpmem capability can only have 2 settings - on or off. Turn into bool
for simplicity

Signed-off-by: Alexia Ingerson <alexia.ingerson@intel.com>
  • Loading branch information
aingerson committed Feb 21, 2025
1 parent 63ba87b commit 2f5e6d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/ofi_xpmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef int64_t xpmem_segid_t;
#endif /* HAVE_XPMEM */

struct ofi_xpmem_client {
uint8_t cap;
bool avail;
xpmem_apid_t apid;
uintptr_t addr_max;
};
Expand Down
8 changes: 4 additions & 4 deletions prov/shm/src/smr_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ int smr_create(const struct fi_provider *prov, struct smr_map *map,
smr_peer_data(*smr)[i].addr.id = -1;
smr_peer_data(*smr)[i].sar_status = 0;
smr_peer_data(*smr)[i].name_sent = 0;
smr_peer_data(*smr)[i].xpmem.cap = SMR_VMA_CAP_OFF;
smr_peer_data(*smr)[i].xpmem.avail = false;
}

strncpy((char *) smr_name(*smr), attr->name, total_size - name_offset);
Expand Down Expand Up @@ -444,14 +444,14 @@ void smr_map_to_endpoint(struct smr_region *region, int64_t id)
ret = ofi_xpmem_enable(&peer_smr->xpmem_self,
&local_peers[id].xpmem);
if (ret) {
local_peers[id].xpmem.cap = SMR_VMA_CAP_OFF;
local_peers[id].xpmem.avail = false;
region->xpmem_cap_self = SMR_VMA_CAP_OFF;
return;
}
local_peers[id].xpmem.cap = SMR_VMA_CAP_ON;
local_peers[id].xpmem.avail = true;
local_peers[id].xpmem.addr_max = peer_smr->xpmem_self.address_max;
} else {
local_peers[id].xpmem.cap = SMR_VMA_CAP_OFF;
local_peers[id].xpmem.avail = false;
}

smr_set_ipc_valid(region, id);
Expand Down

0 comments on commit 2f5e6d4

Please sign in to comment.