Skip to content

Commit

Permalink
prov/shm: cleanup op flags
Browse files Browse the repository at this point in the history
The util srx/peer srx should return the entry with the op flags
(FI_MSG/FI_TAGGED + FI_RECV) already set. Remove from the shm code

Signed-off-by: Alexia Ingerson <alexia.ingerson@intel.com>
  • Loading branch information
aingerson committed Nov 13, 2024
1 parent f077d78 commit fc24cad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 25 deletions.
4 changes: 1 addition & 3 deletions prov/shm/src/smr.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,8 @@ int smr_complete_rx(struct smr_ep *ep, void *context, uint32_t op,
uint64_t flags, size_t len, void *buf, int64_t id,
uint64_t tag, uint64_t data);

static inline uint64_t smr_rx_cq_flags(uint32_t op, uint64_t rx_flags,
uint16_t op_flags)
static inline uint64_t smr_rx_cq_flags(uint64_t rx_flags, uint16_t op_flags)
{
rx_flags |= ofi_rx_cq_flags(op);
if (op_flags & SMR_REMOTE_CQ_DATA)
rx_flags |= FI_REMOTE_CQ_DATA;
return rx_flags;
Expand Down
41 changes: 19 additions & 22 deletions prov/shm/src/smr_progress.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,8 @@ static int smr_start_common(struct smr_ep *ep, struct smr_cmd *cmd,

if (!pend) {
comp_buf = rx_entry->iov[0].iov_base;
comp_flags = smr_rx_cq_flags(cmd->msg.hdr.op, rx_entry->flags,
cmd->msg.hdr.op_flags);
comp_flags = smr_rx_cq_flags(rx_entry->flags,
cmd->msg.hdr.op_flags);
if (err) {
FI_WARN(&smr_prov, FI_LOG_EP_CTRL,
"error processing op\n");
Expand Down Expand Up @@ -822,8 +822,8 @@ static int smr_copy_saved(struct smr_cmd_ctx *cmd_ctx,
}
assert(!cmd_ctx->sar_entry);

comp_flags = smr_rx_cq_flags(cmd_ctx->cmd.msg.hdr.op,
rx_entry->flags, cmd_ctx->cmd.msg.hdr.op_flags);
comp_flags = smr_rx_cq_flags(rx_entry->flags,
cmd_ctx->cmd.msg.hdr.op_flags);

ret = smr_complete_rx(cmd_ctx->ep, rx_entry->context,
cmd_ctx->cmd.msg.hdr.op, comp_flags,
Expand Down Expand Up @@ -1106,14 +1106,14 @@ static int smr_progress_cmd_rma(struct smr_ep *ep, struct smr_cmd *cmd,
FI_WARN(&smr_prov, FI_LOG_EP_CTRL,
"error processing rma op\n");
ret = smr_write_err_comp(ep->util_ep.rx_cq, NULL,
smr_rx_cq_flags(cmd->msg.hdr.op, 0,
cmd->msg.hdr.op_flags), 0, -err);
smr_rx_cq_flags(0, cmd->msg.hdr.op_flags),
0, -err);
} else {
ret = smr_complete_rx(ep, (void *) cmd->msg.hdr.msg_id,
cmd->msg.hdr.op, smr_rx_cq_flags(cmd->msg.hdr.op,
0, cmd->msg.hdr.op_flags), total_len,
iov_count ? iov[0].iov_base : NULL,
cmd->msg.hdr.id, 0, cmd->msg.hdr.data);
cmd->msg.hdr.op, smr_rx_cq_flags(0,
cmd->msg.hdr.op_flags), total_len,
iov_count ? iov[0].iov_base : NULL,
cmd->msg.hdr.id, 0, cmd->msg.hdr.data);
}
if (ret) {
FI_WARN(&smr_prov, FI_LOG_EP_CTRL,
Expand Down Expand Up @@ -1191,13 +1191,12 @@ static int smr_progress_cmd_atomic(struct smr_ep *ep, struct smr_cmd *cmd,
FI_WARN(&smr_prov, FI_LOG_EP_CTRL,
"error processing atomic op\n");
ret = smr_write_err_comp(ep->util_ep.rx_cq, NULL,
smr_rx_cq_flags(cmd->msg.hdr.op, 0,
cmd->msg.hdr.op_flags), 0, err);
smr_rx_cq_flags(0, cmd->msg.hdr.op_flags),
0, err);
} else {
ret = smr_complete_rx(ep, NULL, cmd->msg.hdr.op,
smr_rx_cq_flags(cmd->msg.hdr.op, 0,
cmd->msg.hdr.op_flags), total_len,
ioc_count ? ioc[0].addr : NULL,
smr_rx_cq_flags(0, cmd->msg.hdr.op_flags),
total_len, ioc_count ? ioc[0].addr : NULL,
cmd->msg.hdr.id, 0, cmd->msg.hdr.data);
}
if (ret) {
Expand Down Expand Up @@ -1304,13 +1303,11 @@ void smr_progress_ipc_list(struct smr_ep *ep)

if (ipc_entry->rx_entry) {
context = ipc_entry->rx_entry->context;
flags = smr_rx_cq_flags(ipc_entry->cmd.msg.hdr.op,
ipc_entry->rx_entry->flags,
flags = smr_rx_cq_flags(ipc_entry->rx_entry->flags,
ipc_entry->cmd.msg.hdr.op_flags);
} else {
context = NULL;
flags = smr_rx_cq_flags(ipc_entry->cmd.msg.hdr.op,
0, ipc_entry->cmd.msg.hdr.op_flags);
flags = smr_rx_cq_flags(0, ipc_entry->cmd.msg.hdr.op_flags);
}

ret = smr_complete_rx(ep, context, ipc_entry->cmd.msg.hdr.op,
Expand Down Expand Up @@ -1422,13 +1419,13 @@ static void smr_progress_sar_list(struct smr_ep *ep)

if (sar_entry->rx_entry) {
comp_ctx = sar_entry->rx_entry->context;
comp_flags = smr_rx_cq_flags(sar_entry->cmd.msg.hdr.op,
comp_flags = smr_rx_cq_flags(
sar_entry->rx_entry->flags,
sar_entry->cmd.msg.hdr.op_flags);
} else {
comp_ctx = NULL;
comp_flags = smr_rx_cq_flags(sar_entry->cmd.msg.hdr.op,
0, sar_entry->cmd.msg.hdr.op_flags);
comp_flags = smr_rx_cq_flags(0,
sar_entry->cmd.msg.hdr.op_flags);
}
ret = smr_complete_rx(ep, comp_ctx,
sar_entry->cmd.msg.hdr.op, comp_flags,
Expand Down

0 comments on commit fc24cad

Please sign in to comment.