Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ud_mcast for mlx5 #5

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/uct/ib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,13 @@ libuct_ib_la_SOURCES += \
if HAVE_MLX5_HW_UD
noinst_HEADERS += \
ud/accel/ud_mlx5_common.h \
ud/accel/ud_mlx5.h
ud/accel/ud_mlx5.h \
ud/accel/ud_mcast_mlx5.h

libuct_ib_la_SOURCES += \
ud/accel/ud_mlx5_common.c \
ud/accel/ud_mlx5.c
ud/accel/ud_mlx5.c \
ud/accel/ud_mcast_mlx5.c
endif # HAVE_MLX5_HW_UD

endif # HAVE_TL_UD
Expand Down
14 changes: 14 additions & 0 deletions src/uct/ib/base/ib_iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,20 @@ ucs_status_t uct_ib_iface_create_qp(uct_ib_iface_t *iface,
attr->cap = attr->ibv.cap;
*qp_p = qp;

union ibv_gid mgid;
uint8_t mcg_gid[16] = MCG_GID;
mcg_gid[6] = qp->qp_num & 0xFF;
memcpy(mgid.raw,mcg_gid,16);
char p[128];
ucs_debug("mcast gid is %s", uct_ib_gid_str(&mgid, p, sizeof(p)));
int ret = ibv_attach_mcast(qp, &mgid, 0);
if (ret) {
ucs_debug("ibv_attach_mcast failed %d.", ret);
return UCS_ERR_INVALID_PARAM;
}
sleep(1);
ucs_debug("ibv_attach_mcast success.");

ucs_debug("iface=%p: created %s QP 0x%x on %s:%d "
"TX wr:%d sge:%d inl:%d resp:%d RX wr:%d sge:%d resp:%d",
iface, uct_ib_qp_type_str(attr->qp_type), qp->qp_num,
Expand Down
2 changes: 2 additions & 0 deletions src/uct/ib/base/ib_iface.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#define UCT_IB_ADDRESS_INVALID_PKEY 0
#define UCT_IB_ADDRESS_DEFAULT_PKEY 0xffff

#define MCG_GID {0xFF,0x1,0,0,0,0,0,0,0x1e,0x34,0,0,0,0,0,0}

/* Forward declarations */
typedef struct uct_ib_iface_config uct_ib_iface_config_t;
typedef struct uct_ib_iface_ops uct_ib_iface_ops_t;
Expand Down
1 change: 1 addition & 0 deletions src/uct/ib/base/ib_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ static inline ucs_status_t uct_ib_qp_max_send_sge(struct ibv_qp *qp,

typedef struct uct_ib_qpnum {
uct_ib_uint24_t qp_num;
uct_ib_uint24_t remote_qp_num;
} uct_ib_qpnum_t;

#endif /* UCT_IB_VERBS_H */
2 changes: 1 addition & 1 deletion src/uct/ib/dc/dc_mlx5.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ uct_dc_mlx5_ep_create_connected(const uct_ep_params_t *params, uct_ep_h* ep_p)

status = uct_ud_mlx5_iface_get_av(&iface->super.super.super,
&iface->ud_common, ib_addr, path_index,
&av, &grh_av, &is_global);
&av, &grh_av, &is_global, 0);
if (status != UCS_OK) {
return UCS_ERR_INVALID_ADDR;
}
Expand Down
Loading