【发布时间】:2020-07-29 09:58:36
【问题描述】:
我正在尝试让 RoCe(基于融合以太网的 RDMA)在两个工作站上工作。我已经在两台配备 Mellanox ConnectX-5 EN 100GbE 适配器并通过相应电缆直接相互连接的计算机上安装了 MLNX_OFED。根据我读到的内容,我需要在其中一个工作站上运行子网管理器才能在它们之间使用 RoCe。
当尝试运行命令 opensm 时,它说找不到本地端口。我可以 ping 两台计算机,并且可以正常工作。我还可以使用命令 udaddy 来测试 RDMA,它也可以工作。但是尝试运行本指南https://www.mellanox.com/related-docs/prod_software/RDMA_Aware_Programming_user_manual.pdf 中提供的 RDMA_RC_EXAMPLE 会在尝试创建队列对时失败,尤其是在尝试将状态更改为 RTR(准备接收)时。
还有一些消息来源说您需要 RDMA 服务,而我的计算机上不存在该服务。并且 MLNX_OFED 的安装在 /etc/yum.conf 中排除了 ibutils-libs*,我不知道它是否相关,但我注意到了。
我在其中一台机器上运行 CentOS 7.7,在另一台机器上运行 CentOS 7.8。
我有点不明白哪里出了问题。
更新 这是运行代码时中断的函数。
/******************************************************************************
* Function: modify_qp_to_rtr
*
* Input
* qp QP to transition
* remote_qpn remote QP number
* dlid destination LID
* dgid destination GID (mandatory for RoCEE)
*
* Output
* none
*
* Returns
* 0 on success, ibv_modify_qp failure code on failure
*
* Description
* Transition a QP from the INIT to RTR state, using the specified QP number
******************************************************************************/
static int modify_qp_to_rtr (struct ibv_qp *qp, uint32_t remote_qpn, uint16_t dlid, uint8_t * dgid)
{
struct ibv_qp_attr attr;
int flags;
int rc;
memset (&attr, 0, sizeof (attr));
attr.qp_state = IBV_QPS_RTR;
attr.path_mtu = IBV_MTU_256;
attr.dest_qp_num = remote_qpn;
attr.rq_psn = 0;
attr.max_dest_rd_atomic = 1;
attr.min_rnr_timer = 0x12;
attr.ah_attr.is_global = 0;
attr.ah_attr.dlid = dlid;
attr.ah_attr.sl = 0;
attr.ah_attr.src_path_bits = 0;
attr.ah_attr.port_num = config.ib_port;
if (config.gid_idx >= 0)
{
attr.ah_attr.is_global = 1;
attr.ah_attr.port_num = 1;
memcpy (&attr.ah_attr.grh.dgid, dgid, 16);
attr.ah_attr.grh.flow_label = 0;
attr.ah_attr.grh.hop_limit = 1;
attr.ah_attr.grh.sgid_index = config.gid_idx;
attr.ah_attr.grh.traffic_class = 0;
}
flags = IBV_QP_STATE | IBV_QP_AV | IBV_QP_PATH_MTU | IBV_QP_DEST_QPN |
IBV_QP_RQ_PSN | IBV_QP_MAX_DEST_RD_ATOMIC | IBV_QP_MIN_RNR_TIMER;
rc = ibv_modify_qp (qp, &attr, flags);
if (rc)
fprintf (stderr, "failed to modify QP state to RTR\n");
return rc;
}
这个消息来源RoCE Debug flow Linux 这么说
RoCE 要求网络负载的 MTU 至少为 1024 字节。
我猜这会影响代码中的这一行:
attr.path_mtu = IBV_MTU_256;
当更改为 IBV_MTU_1024 时,它会编译但会出现相同的错误。
【问题讨论】:
-
嗨,欢迎来到堆栈溢出,请注意堆栈溢出是针对编码问题的。我建议你在super user 上问同样的问题
-
谢谢。如果我在错误的论坛中,我很抱歉。我发布的问题可能与代码相关,因为我不确定问题出在系统设置中还是在 RDMA_RC_Example.c 代码中的代码本身中。我发现的最新情况是 Mellanox 给出的代码示例是 Infiniband 而不是以太网的示例。而且 RoCE 似乎对 Infiniband 有一些限制,这可能会导致代码中断。
-
你能报告
config.gid_idx的值吗?在 RoCE 中,必须使用 GID。 -
谢谢!是的,我昨天经过大量搜索后发现了这一点。这解决了问题,现在运行良好。如果我理解正确,您在使用 Infiniband 时不需要指定 GID,而仅用于 RoCE,我在查找该信息时遇到了一些麻烦。感谢您的帮助。 @haggai_e
标签: c network-programming infiniband rdma mellanox