Skip to content

Commit e9ed495

Browse files
committed
prov/psm3: Add missing ifdefs for rv module
Signed-off-by: Goldman, Adam <adam.goldman@intel.com>
1 parent 3d4d28f commit e9ed495

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

prov/psm3/psm3/psm_ep.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,15 +991,27 @@ __psm2_ep_open_internal(psm2_uuid_t const unique_job_key, int *devid_enabled,
991991
// mode 2 (user space MR w/cache) is purposely not documented
992992
psmi_getenv("PSM3_MR_CACHE_MODE",
993993
"Enable MR caching 0=user space MR no cache"
994+
#ifdef RNDV_MOD_MR
994995
", 1=kernel MR w/cache [1]",
996+
#else
997+
"[0]",
998+
#endif
995999
PSMI_ENVVAR_LEVEL_USER,
9961000
PSMI_ENVVAR_TYPE_UINT,
1001+
#ifdef RNDV_MOD_MR
9971002
(union psmi_envvar_val)MR_CACHE_MODE_KERNEL,
1003+
#else
1004+
(union psmi_envvar_val)MR_CACHE_MODE_NONE,
1005+
#endif
9981006
&env_mr_cache_mode);
9991007
if (! MR_CACHE_MODE_VALID(env_mr_cache_mode.e_uint)
10001008
|| env_mr_cache_mode.e_uint == MR_CACHE_MODE_RV)
10011009
env_mr_cache_mode.e_uint = MR_CACHE_MODE_NONE;
10021010
}
1011+
#ifndef RNDV_MOD_MR
1012+
if (env_mr_cache_mode.e_uint == MR_CACHE_MODE_KERNEL)
1013+
env_mr_cache_mode.e_uint = MR_CACHE_MODE_NONE;
1014+
#endif
10031015
ep->mr_cache_mode = env_mr_cache_mode.e_uint;
10041016
}
10051017

prov/psm3/psm3/psm_hal_gen1/psm_gdrcpy.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ gdr_convert_gpu_to_host_addr(int gdr_fd, unsigned long buf,
9494

9595
_HFI_VDBG("buf=%p size=%zu pageaddr=%p pagelen=%u flags=0x%x proto=%p\n",
9696
(void *)buf, size, (void *)pageaddr, pagelen, flags, proto);
97-
97+
#ifdef RNDV_MOD_MR
9898
host_addr_buf = __psm2_rv_pin_and_mmap(proto->ep->verbs_ep.rv, pageaddr, pagelen);
9999
if (! host_addr_buf) {
100100
if (errno == ENOMEM || errno == EINVAL) {
@@ -110,6 +110,10 @@ gdr_convert_gpu_to_host_addr(int gdr_fd, unsigned long buf,
110110
return NULL;
111111
}
112112
}
113+
#else
114+
psmi_assert_always(0); // unimplemented, should not get here
115+
host_addr_buf = NULL;
116+
#endif /* RNDV_MOD_MR */
113117
return host_addr_buf + (buf & GPU_PAGE_OFFSET_MASK);
114118
}
115119

@@ -118,6 +122,7 @@ int
118122
gdr_unmap_gpu_host_addr(int gdr_fd, const void *buf,
119123
size_t size, struct ips_proto* proto)
120124
{
125+
#ifdef RNDV_MOD_MR
121126
// TBD - will we need to round size up to pagelen?
122127
if (0 != __psm2_rv_munmap_and_unpin(proto->ep->verbs_ep.rv, buf, size)) {
123128
/* Fatal error */
@@ -127,6 +132,11 @@ gdr_unmap_gpu_host_addr(int gdr_fd, const void *buf,
127132
return -1;
128133
}
129134
return 0;
135+
#else
136+
psmi_assert_always(0); // unimplemented, should not get here
137+
errno = EINVAL;
138+
return -1;
139+
#endif
130140
}
131141

132142

prov/psm3/psm3/ptl_ips/ips_expected_proto.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,14 @@ struct ips_tid_send_desc {
201201

202202

203203
uint8_t is_complete:1; // all packets for send queued, waiting CQE/response
204+
#ifdef RNDV_MOD_MR
204205
uint8_t rv_need_err_chk_rdma:1; // need to determine if a retry is required
205206
uint8_t reserved:6;
206207
uint8_t rv_sconn_index; // sconn in rv we issued RDMA write on
207208
uint32_t rv_conn_count;// Count of sconn completed conn establishments
209+
#else
210+
uint8_t reserved:7;
211+
#endif
208212

209213
#ifdef PSM_CUDA
210214
/* As size of cuda_hostbuf is less than equal to window size,

0 commit comments

Comments
 (0)