Skip to content

Commit debabb9

Browse files
committed
include/ofi_xpmem: change cap into bool
xpmem capability can only have 2 settings - on or off. Turn into bool for simplicity Signed-off-by: Alexia Ingerson <[email protected]>
1 parent 24c9f4e commit debabb9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

include/ofi_xpmem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ typedef int64_t xpmem_segid_t;
4848
#endif /* HAVE_XPMEM */
4949

5050
struct ofi_xpmem_client {
51-
uint8_t cap;
51+
bool avail;
5252
xpmem_apid_t apid;
5353
uintptr_t addr_max;
5454
};

prov/shm/src/smr_util.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ int smr_create(const struct fi_provider *prov, struct smr_map *map,
291291
smr_peer_data(*smr)[i].addr.id = -1;
292292
smr_peer_data(*smr)[i].sar_status = 0;
293293
smr_peer_data(*smr)[i].name_sent = 0;
294-
smr_peer_data(*smr)[i].xpmem.cap = SMR_VMA_CAP_OFF;
294+
smr_peer_data(*smr)[i].xpmem.avail = false;
295295
}
296296

297297
strncpy((char *) smr_name(*smr), attr->name, total_size - name_offset);
@@ -444,14 +444,14 @@ void smr_map_to_endpoint(struct smr_region *region, int64_t id)
444444
ret = ofi_xpmem_enable(&peer_smr->xpmem_self,
445445
&local_peers[id].xpmem);
446446
if (ret) {
447-
local_peers[id].xpmem.cap = SMR_VMA_CAP_OFF;
447+
local_peers[id].xpmem.avail = false;
448448
region->xpmem_cap_self = SMR_VMA_CAP_OFF;
449449
return;
450450
}
451-
local_peers[id].xpmem.cap = SMR_VMA_CAP_ON;
451+
local_peers[id].xpmem.avail = true;
452452
local_peers[id].xpmem.addr_max = peer_smr->xpmem_self.address_max;
453453
} else {
454-
local_peers[id].xpmem.cap = SMR_VMA_CAP_OFF;
454+
local_peers[id].xpmem.avail = false;
455455
}
456456

457457
smr_set_ipc_valid(region, id);

0 commit comments

Comments
 (0)