Skip to content

Commit 632eb0f

Browse files
committed
Add libfabric patch: log efa_is_local_peer GID decisions
Patches efa_conn.c to always log (at WARN level) whether each peer is classified as LOCAL or REMOTE based on GID comparison. This will show definitively whether remote peers are being misidentified as local (causing messages to be routed through SHM where they fail).
1 parent 9a6620a commit 632eb0f

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--- prov/efa/src/efa_conn.c.orig 2026-07-13 16:22:58
2+
+++ prov/efa/src/efa_conn.c 2026-07-13 16:23:15
3+
@@ -15,23 +15,25 @@
4+
{
5+
int i;
6+
uint8_t *raw_gid = ((struct efa_ep_addr *)addr)->raw;
7+
+ char peer_gid_str[INET6_ADDRSTRLEN] = { 0 };
8+
+ char local_gid_str[INET6_ADDRSTRLEN] = { 0 };
9+
10+
-#if ENABLE_DEBUG
11+
- char raw_gid_str[INET6_ADDRSTRLEN] = { 0 };
12+
+ inet_ntop(AF_INET6, raw_gid, peer_gid_str, INET6_ADDRSTRLEN);
13+
14+
- if (!inet_ntop(AF_INET6, raw_gid, raw_gid_str, INET6_ADDRSTRLEN)) {
15+
- EFA_WARN(FI_LOG_AV, "Failed to get current EFA's GID, errno: %d\n", errno);
16+
- return 0;
17+
- }
18+
- EFA_INFO(FI_LOG_AV, "The peer's GID is %s.\n", raw_gid_str);
19+
-#endif
20+
for (i = 0; i < g_efa_ibv_gid_cnt; ++i) {
21+
if (!memcmp(raw_gid, g_efa_ibv_gid_list[i].raw, EFA_GID_LEN)) {
22+
- EFA_INFO(FI_LOG_AV, "The peer is local.\n");
23+
+ inet_ntop(AF_INET6, g_efa_ibv_gid_list[i].raw,
24+
+ local_gid_str, INET6_ADDRSTRLEN);
25+
+ EFA_WARN(FI_LOG_AV,
26+
+ "efa_is_local_peer: MATCH peer=%s == local[%d]=%s -> LOCAL\n",
27+
+ peer_gid_str, i, local_gid_str);
28+
return 1;
29+
}
30+
}
31+
32+
+ EFA_WARN(FI_LOG_AV,
33+
+ "efa_is_local_peer: NO MATCH peer=%s (checked %d local GIDs) -> REMOTE\n",
34+
+ peer_gid_str, g_efa_ibv_gid_cnt);
35+
return 0;
36+
}
37+

0 commit comments

Comments
 (0)