Default data QPs to infinite RNR retries - #71
Open
davidcanar wants to merge 1 commit into
Open
Conversation
A SEND that arrives before the peer has posted its receive gets an RNR NAK. With the verbs defaults (rnr_retry = 0, retry_cnt = 0) the module completes that SEND immediately with RNR_RETRY_EXC_ERR and then marks the QP in error, taking the whole connection down on a single scheduler-induced race between the sender's post_send and the receiver's post_recv. Default data QPs to infinite RNR retries (7, per the IB spec) and a retry count instead: the SEND then waits for the peer's advertised recv credits (tbv_send_rnr_waits_for_recv_credit). Users can still override both through modify_qp (IB_QP_RNR_RETRY / IB_QP_RETRY_CNT). Validated with ds4's two-machine tensor parallelism over usb4_rdma0 (concurrent sessions, prefill row swaps, long decodes) and with the uc_oneway bidi bench: zero QP errors where the previous default killed the QP on the first post_recv/post_send race.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A SEND that arrives before the peer has posted its receive gets an RNR NAK. With the verbs defaults (
rnr_retry = 0,retry_cnt = 0) the module completes that SEND immediately withRNR_RETRY_EXC_ERRand then marks the QP in error, taking the whole connection down on a single scheduler-induced race between the sender'spost_sendand the receiver'spost_recv.This bit us while running ds4's two-machine tensor parallelism over
usb4_rdma0: the gate protocol posts receives and sends in lockstep from two machines, and a microseconds-scale race at the first decode gate (or at a bulk round boundary) errored the QP permanently. The only robust workaround on the userspace side was a two-QP design with receives always posted before any send could arrive — but the race is inherent to two-sided UC/RC usage and any application can hit it.Change
In
tbv_create_qp, default non-GSI QPs to infinite RNR retries (rnr_retry = 7, per the IB spec) and a retry count. A SEND that hits an RNR then waits for the peer's advertised recv credits (tbv_send_rnr_waits_for_recv_credit) instead of completing with an error. Applications can still override both throughmodify_qp(IB_QP_RNR_RETRY/IB_QP_RETRY_CNT).Testing
uc_oneway --role bidi --check: 64/64 both directions, pattern checks pass.usb4_rdma0: 4 concurrent sessions, 445-token prefills, multi-turn sessions, ~14 tok/s decode — zero QP errors (the previous default killed the QP on the first race).