Skip to content

Commit 217c757

Browse files
committed
prov/rxm, prov/util: Update logic for source and dir_recv
When updating the unspec queue address information the peer_context's connection is sometimes NULL. This results in segmentation faults on av_insert so checking for it before accessing it fixes the issue. However, this isn't a complete fix because it leaves potential for an entry to get stuck in the wrong queue. The util_srx implementation is overcomplicated for the non-directed receive case. To simplify this, queuing will be limited to the unspecified unexpected queue when not using directed receive. This is because we do not need to enable the per-peer queues unless directed receive is requested. This makes sure that entries do not get stuck in the wrong queue because they are all living in the same one. It also simplifies the lookup for the non-directed receive case. Note: We do not want to fix this by forcing the rx_buf->conn to be set for all incoming message. We want to avoid an extra lookup/set because the conn is only needed for FI_SOURCE and FI_DIRECTED_RECV cases.
1 parent e57cc58 commit 217c757

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

prov/rxm/src/rxm_domain.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ static fi_addr_t rxm_get_addr(struct fi_peer_rx_entry *rx_entry)
225225
{
226226
struct rxm_rx_buf *rx_buf = rx_entry->peer_context;
227227

228+
if (!rx_buf->conn)
229+
return rx_entry->addr;
230+
228231
return rx_buf->conn->peer->fi_addr;
229232
}
230233

prov/util/src/util_srx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ static int util_queue_msg(struct fi_peer_rx_entry *rx_entry)
346346

347347
util_entry = container_of(rx_entry, struct util_rx_entry, peer_entry);
348348
assert(util_entry->status == RX_ENTRY_UNEXP);
349-
if (rx_entry->addr == FI_ADDR_UNSPEC) {
349+
if (!srx_ctx->dir_recv || rx_entry->addr == FI_ADDR_UNSPEC) {
350350
dlist_insert_tail(&util_entry->d_entry,
351351
&srx_ctx->unspec_unexp_msg_queue);
352352
} else {
@@ -371,7 +371,7 @@ static int util_queue_tag(struct fi_peer_rx_entry *rx_entry)
371371

372372
util_entry = container_of(rx_entry, struct util_rx_entry, peer_entry);
373373
assert(util_entry->status == RX_ENTRY_UNEXP);
374-
if (rx_entry->addr == FI_ADDR_UNSPEC) {
374+
if (!srx_ctx->dir_recv || rx_entry->addr == FI_ADDR_UNSPEC) {
375375
dlist_insert_tail(&util_entry->d_entry,
376376
&srx_ctx->unspec_unexp_tag_queue);
377377
} else {

0 commit comments

Comments
 (0)