0

我正在尝试让 RoCe(基于聚合以太网的 RDMA)在两个工作站上工作。我已经在两台配备 Mellanox ConnectX-5 EN 100GbE 适配器并通过相应电缆直接相互连接的计算机上安装了 MLNX_OFED。根据我所阅读的内容,我需要在其中一个工作站上运行子网管理器才能在它们之间使用 RoCe。

尝试运行命令opensm时,它说找不到本地端口。我可以 ping 两台计算机,并且可以正常工作。我还可以使用命令udaddy来测试 RDMA,它也可以工作。但是尝试运行本指南中提供的 RDMA_RC_EXAMPLE https://www.mellanox.com/related-docs/prod_software/RDMA_Aware_Programming_user_manual.pdf尝试创建队列对时失败,更具体地说,当它尝试将状态更改为 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时,它会编译但会出现相同的错误。

4

1 回答 1

1

解决了

使用 RoCE 时,您需要按照 @haggai_e 的说明指定 GID 索引。我认为在使用 Infiniband 而不是 RoCE 时不需要它。

运行 qperf RDMA 测试时,我们还需要设置连接管理器标志以使其运行。我假设它与使用 Infiniband 而不是 RoCE 时需要使用的子网管理器具有相同的功能。

于 2020-07-30T07:50:12.763 回答