Skip to content

fix(gda): set gid_type when ROCSHMEM_IB_GID_INDEX forces the GID - #40

Closed
bleech243 wants to merge 1 commit into
HYGON-AI:developfrom
bleech243:bleech243/fix-gid-type
Closed

bleech243 wants to merge 1 commit into
HYGON-AI:developfrom
bleech243:bleech243/fix-gid-type

Conversation

@bleech243

Copy link
Copy Markdown
Contributor

MLX5 moves QPs to RTR/RTS through mlx5dv.modify_qp(), which takes the GID type as an explicit argument because userspace builds the QP address vector itself. The generic ibv_modify_qp() path did not need this: the kernel derived the RoCE version from the GID entry that sgid_index points at.

select_gid_index() only assigned nic.gid_type on the automatic-probe path, so the ROCSHMEM_IB_GID_INDEX override updated nic.gid_index and nic.gid but left nic.gid_type at the value the probe had picked. The probe prefers RoCEv2, so forcing a RoCEv1 index such as GID 0 built an address vector as RoCEv2 while sgid_index selected a RoCEv1 GID, and the NIC rejected the transition with EREMOTEIO (121) from modify_qps_init_to_rtr().

Take gid_type from the GID table entry of the forced index so it always matches sgid_index.

MLX5 moves QPs to RTR/RTS through mlx5dv.modify_qp(), which takes the GID type as an explicit argument because userspace builds the QP address vector itself. The generic ibv_modify_qp() path did not need this: the kernel derived the RoCE version from the GID entry that sgid_index points at.

select_gid_index() only assigned nic.gid_type on the automatic-probe path, so the ROCSHMEM_IB_GID_INDEX override updated nic.gid_index and nic.gid but left nic.gid_type at the value the probe had picked. The probe prefers RoCEv2, so forcing a RoCEv1 index such as GID 0 built an address vector as RoCEv2 while sgid_index selected a RoCEv1 GID, and the NIC rejected the transition with EREMOTEIO (121) from modify_qps_init_to_rtr().

Take gid_type from the GID table entry of the forced index so it always matches sgid_index.
@hygon-ai-reviewer

Copy link
Copy Markdown

AI Review

审查尚未完整完成,无法给出整体结论;当前没有可发布的已确认问题,不代表代码没有问题。

审查未完整完成:以 GitHub 返回的 PR diff 为主体,关联上下文仅用于核验,未运行代码。

覆盖情况:共 1 个文件,已审查 0 个,待审查 1 个。

进度已保存。正在继续处理。

@bleech243 bleech243 closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant