Repository navigation
FT/TF: wireup recovery bugfixes - #12129
evgeny-leksikov wants to merge 27 commits into
Conversation
|
🤖 Starting review — findings will be posted here when done. |
| * usable. */ | ||
| uct_rc_mlx5_ep_save_ft_ci(ep); | ||
| } | ||
| /* Sometimes the NOP posted before the QP moves to ERR produces no |
There was a problem hiding this comment.
blocker: pls remove the #if 0 block. Disabled assertion left in the code with a comment admitting the mechanism does not work — dead code plus an unenforced contract. The comment says the NOP sometimes produces no completion, so err_handler_inprogress is not actually guaranteed here — that needs to be resolved rather than commented out.
| ucs_error("rc mlx5: rx token is NULL"); | ||
| return UCS_ERR_INVALID_PARAM; | ||
| } | ||
| if (start_pi == end_pi) { |
There was a problem hiding this comment.
blocker: an idle queue previously returned UCS_OK here; now any range that is not all-NOP (or with a non-empty outstanding queue) aborts the process, and ucs_assertv_always(start_pi != end_pi) is unconditionally false at this point (also in release builds). pls return a status instead of a fatal assert.
| * @brief Parameters for invalidating a UCT endpoint by @ref uct_ep_invalidate. | ||
| */ | ||
| typedef struct { | ||
| typedef struct { |
There was a problem hiding this comment.
blocker: stray leading space introduced in a public header.
| typedef struct { | |
| typedef struct { |
| } | ||
| } | ||
|
|
||
| /* Replay the rc_x/PUT order 4, 0, 2, 1, 3, then 5. The last lane stays |
There was a problem hiding this comment.
test coverage: this replaces lane shuffling with a single hardcoded order {4,0,2,1,3,5} and skips the test (UCS_TEST_SKIP_R) for any other lane count/set, so PUT coverage drops to one configuration. Looks like reproduction scaffolding — pls keep shuffle_lanes() here. (Same for the block around lines 282-287.)
| } | ||
|
|
||
| /* 0 is unseen. A wrapped id stays newer until half the counter space. */ | ||
| static int ucp_wireup_tf_req_is_newer(uint32_t seen, uint32_t request_id) |
There was a problem hiding this comment.
duplication: ucp_ep_tf_peer_req_is_newer() in ucp_ep.c is the same function, including the comment. pls keep one shared helper; src/AGENTS.md asks not to duplicate implementation patterns.
|
|
||
| ucs_debug("worker %p: error handler called for UCT EP %p: %s", | ||
| worker, uct_ep, ucs_status_string(status)); | ||
| ucs_diag("worker %p: error handler called for UCT EP %p: %s", |
There was a problem hiding this comment.
logging: pls keep these as ucs_debug (also line 594 and the other ucs_debug→ucs_diag conversions in ucp_ep.c / wireup.c). They are per-lane/per-message flow traces (error handler entry, lane lookup, token store/release, hold/detach), not diagnostics of a silent adjustment; docs/LoggingStyle.md reserves diag for silent adjustments and internal error handling.
| /* A peer request moves the queue pair to error and waits for that | ||
| * completion before this lane is failed. Recovery stays idle until | ||
| * the completion holds it. */ | ||
| if ((ep->ext->recovery_arg == NULL) || |
There was a problem hiding this comment.
readability: the nested form is confusing — when recovery_arg == NULL the assert is a tautology, so the whole block only means "recovery_arg is NULL or tf_reply is not NULL".
| if ((ep->ext->recovery_arg == NULL) || | |
| ucs_assert((ep->ext->recovery_arg == NULL) || | |
| (ep->ext->recovery_arg->tf_reply != NULL)); |
| @@ -2717,7 +2863,8 @@ uint8_t ucp_ep_tf_tx_len(ucp_ep_h ep, ucp_lane_index_t lane, | |||
|
|
|||
| ucs_status_t | |||
| ucp_ep_tf_derive_rx(ucp_ep_h ep, ucp_lane_index_t lane, const void *tx_token, | |||
There was a problem hiding this comment.
API shape: require_open exists only to decide whether ucp_ep_tf_derive_rx performs its derive at all. Per root AGENTS.md: "Do not add a parameter whose sole purpose is to decide whether a function performs its core operation; make that decision in the caller." pls move the ucp_ep_tf_exchange_open() check to the caller instead of passing require_open down. (See also src/ucp/core/ucp_ep.h:1205-1214.)
| { | ||
| UCT_RC_MLX5_BASE_EP_DECL(tl_ep, iface, ep); | ||
|
|
||
| /* An idle queue pair produces no completion after the transition to ERR. |
There was a problem hiding this comment.
question: uct_ep_invalidate is public API, and the NOP is now posted for every caller, consuming a WQE and a CQ credit. There is also no UCT_RC_EP_FLAG_CONNECTED check, so this can post on a QP that was never moved out of RESET/INIT. Should this NOP be gated on the ep being connected, and on the failover path only?
|
This PR is well over the 500-added-line limit in |
Restore outstanding purge to the contract that it runs only after the error handler returns UCS_INPROGRESS. Post a signaled NOP when invalidating an idle queue pair, and accept a NOP-only purge when that NOP completes without an error completion.
Post the invalidate NOP only when the outstanding queue is empty. Walk unreleased credits inside the endpoint NOP check, and return UCS_ERR_INVALID_PARAM when that range is unexpectedly empty.
|
🤖 CI Triage Agent — TL;DR: The "commit title" codestyle job failed because PR #12129 contains a revert commit titled Full analysisSummary: Codestyle stage, job Root cause:
Secondary CI bug: the step runs with Implicated commit: The offending commit is the auto-generated revert in branch File: Suggested fix:
Related: Guidance referenced by the job: https://github.com/openucx/ucx/wiki/Guidance-for-contributors#general-guidelines ; reverted PR: #12033 ; this PR: #12129
|
Move the queue pair to ERR before posting the NOP, so the NOP cannot complete successfully. ERR flushes whatever is still posted, but a queue that is not full can have nothing left to complete. Post the signaled NOP in that case. The delivered-flush purge test invalidates before the sentinel is observed and purges only after the error callback.
57ee962 to
18eb283
Compare
|
🤖 Starting review — findings will be posted here when done. |
| return lane; | ||
| } | ||
|
|
||
| if ((ucp_ep_config(ucp_ep)->key.lanes[lane].lane_types & |
There was a problem hiding this comment.
blocker — lane-type bit test is missing UCS_BIT().
UCP_LANE_TYPE_FAILED is an enum index (value 10 in src/ucp/proto/lane_type.h), not a mask. lane_types & 10 tests UCS_BIT(1) | UCS_BIT(3), i.e. AM_BW | RMA_BW. Every other site in the tree uses UCS_BIT(UCP_LANE_TYPE_FAILED) (ucp_ep.c:1707,1714,1743,1812,5563). The new lookup therefore matches healthy BW lanes and skips actual failed lanes, so tf[lane].uct_ep can be compared for the wrong lane index.
| if ((ucp_ep_config(ucp_ep)->key.lanes[lane].lane_types & | |
| if ((ucp_ep_config(ucp_ep)->key.lanes[lane].lane_types & | |
| UCS_BIT(UCP_LANE_TYPE_FAILED)) && |
| return UCS_OK; | ||
| } | ||
|
|
||
| ucs_assertv_always(start_pi != end_pi, |
There was a problem hiding this comment.
blocker — assertion inside if (start_pi == end_pi) always fires. ucs_assertv_always is unconditional in all builds (src/ucs/debug/assert.h), so reaching this line aborts the process. Any purge on an idle QP whose posted range is not all-NOP, or with a non-empty outstanding queue, now crashes instead of returning UCS_OK as before.
This is inside if (start_pi == end_pi), so the condition is always false and ucs_assertv_always aborts in release builds too. The old code returned UCS_OK for an idle queue — pls restore a non-fatal path here.
| (uint64_t)accepted); | ||
| } | ||
|
|
||
| if (accepted == 0) { |
There was a problem hiding this comment.
seen_peer_id survives a peer request_id restart, so the second failure episode is dropped.
ucp_ep_recovery_arg_free() is called once all lanes recover (ucp_ep.c:2460) and ucp_ep_recovery_arm() re-allocates the arg with ucs_calloc (ucp_ep.c:2356), so the initiator's request_id restarts at 1. seen_peer_id lives in ep->ext and is never reset, so ucp_ep_tf_peer_req_is_newer(seen=N>1, request_id=1) is false for every lane, accepted == 0, and the request returns here silently. Recovery then stalls until retries are exhausted and the endpoint is failed.
pls reset seen_peer_id together with the recovery state, or use a generation that is not reset on one side only.
| * @brief Parameters for invalidating a UCT endpoint by @ref uct_ep_invalidate. | ||
| */ | ||
| typedef struct { | ||
| typedef struct { |
There was a problem hiding this comment.
minor — stray leading space in a public header.
| typedef struct { | |
| typedef struct { |
minor: unintended whitespace change.
| uint8_t scheduled; | ||
| ucp_wireup_lane_token_t rx_tokens[UCP_MAX_LANES]; | ||
| void *address; | ||
| size_t address_length; |
There was a problem hiding this comment.
address_length is stored but never read. ucp_wireup_tf_reply_finish() calls ucp_address_unpack(ep->worker, reply->address, ...) without the length, so the field is dead state. REVIEW.md asks to avoid redundant state.
| size_t address_length; | |
| void *address; |
address_length is never read back — pls drop it.
| /* A peer request moves the queue pair to error and waits for that | ||
| * completion before this lane is failed. Recovery stays idle until | ||
| * the completion holds it. */ | ||
| if ((ep->ext->recovery_arg == NULL) || |
There was a problem hiding this comment.
The guarded assert can be written directly.
| if ((ep->ext->recovery_arg == NULL) || | |
| ucs_assert((ep->ext->recovery_arg == NULL) || | |
| (ep->ext->recovery_arg->tf_reply != NULL)); |
Same condition, without the if wrapper that only exists to reach a trivially-true assert.
| (ucp_ep_tf_hold(ucp_ep, lane, uct_ep) == UCS_OK)) { | ||
| return UCS_INPROGRESS; | ||
| if (wireup_ep == NULL) { | ||
| ucs_status_t hold_status = ucp_ep_tf_hold(ucp_ep, lane, uct_ep); |
There was a problem hiding this comment.
minor — declaration in the middle of a block. docs/CodeStyle.md ("Variable definition") wants definitions at the top of the function. Same issue for uint16_t outstanding_bb / uint16_t posted_pi at src/uct/ib/mlx5/rc/rc_mlx5_ep.c:1924.
minor: pls declare hold_status at the top of the function.
| const size_t size = ucs_max(attr.cap.get.min_zcopy, | ||
| ucs_min((size_t)4096, | ||
| attr.cap.get.max_zcopy)); | ||
| ucs_min((size_t)4096, attr.cap.get.max_zcopy)); |
There was a problem hiding this comment.
minor — reverted line wrap exceeds 80 columns.
| ucs_min((size_t)4096, attr.cap.get.max_zcopy)); | |
| const size_t size = ucs_max(attr.cap.get.min_zcopy, | |
| ucs_min((size_t)4096, | |
| attr.cap.get.max_zcopy)); |
minor: this line is 89 columns; the 80-column limit is in docs/CodeStyle.md.
|
|
||
| ucs_free(callback_data.dm_data); | ||
| uct_rc_mlx5_ep_purge_finish_tx(ep); | ||
| uct_rc_mlx5_ep_update_tx_qp_res(ep, txwq->prev_sw_pi); |
There was a problem hiding this comment.
Credit release is no longer guarded by err_handler_inprogress. uct_rc_mlx5_iface_handle_failure() already releases the TX credits at out_update_tx_res when err_handler_inprogress is 0, and the removed uct_rc_mlx5_ep_purge_finish_tx() guarded this call for exactly that reason. With the err_handler_inprogress assertion above disabled by #if 0, a purge can reach this line with err_handler_inprogress == 0.
With the assertion above disabled, can this run while err_handler_inprogress is 0? In that case uct_rc_mlx5_iface_handle_failure already released the credits at out_update_tx_res, and uct_rc_mlx5_ep_purge_finish_tx used to guard this call for that reason.
|
Residual coverage gaps: no test exercises the deferred Residual coverage gap: Residual coverage gap: the PUT fault-tolerance test now hard-codes a 6-lane order and skips otherwise, so the lane-recovery ordering path is effectively unexercised outside one hardware configuration. |
|
🤖 CI Triage Agent — TL;DR: The Full analysisSummary: Root cause: Environment/container issue, not a code regression. The build and
There is no hang: timestamps are continuous and the whole mpirun attempt takes under 50 ms. Nothing from the PR's UCX code ( Implicated commit: unknown — no UCX source commit is implicated; this is the CI container image / agent environment (the recently introduced DOCA 3.1.0 GPUNetIO Ubuntu 24.04 builder image). Closest related CI work: File: Suggested fix: Two complementary options, preferably both:
Re-run the PR once the image is fixed; no change to the PR's branch is needed. Related: PR #12129 (this build); no existing issue found matching
|
The keepalive test zeros cq_available before invalidate. That post needs one credit for the signaled NOP, so lend the credit for the injection and restore the drained count.
Return UCS_ERR_NO_RESOURCE when the send queue or CQ has no credit, and leave the QP unchanged. Post the flush NOP only after the QP is in ERR.
An empty transmit window has no packets, so purge returns before the RX-token check. The opcode scan only relaxed an error-handler assert.
rc_mlx5 invalidate posts a signaled NOP and returns no resources when the send queue or CQ is full. Stop filling one credit short so the peer-failure test can invalidate.
|
🤖 Starting review — findings will be posted here when done. |
| * usable. */ | ||
| uct_rc_mlx5_ep_save_ft_ci(ep); | ||
| } | ||
| ucs_assertv_always(ep->err_handler_inprogress, |
There was a problem hiding this comment.
blocker: ucp_ep_tf_purge_live_ep() (via ucp_ep_tf_retire_unaware_lanes() on the LANES_ADDR_REPLY path) still purges a lane whose error handler was never invoked, so this assert aborts in release as well. The PR reverts "outstanding purge before the error handler" in UCT, but UCP still has a caller that purges a lane with a live QP: ucp_ep_tf_retire_unaware_lanes() selects lanes with state == INVALIDATED, tf->uct_ep == NULL and a live ucp_ep_get_lane() and calls ucp_ep_tf_purge_live_ep() -> uct_ep_outstanding_purge(), so err_handler_inprogress == 0 and ucs_assertv_always aborts. The new request path was converted to ucp_ep_tf_invalidate_transport(), but the reply path was not. Should that path also go through uct_ep_invalidate(), or does the check need to stay a returned error?
|
|
||
| return uct_ib_mlx5_modify_qp_state(&iface->super.super, &ep->tx.wq.super, | ||
| IBV_QPS_ERR); | ||
| ucs_assertv(uct_rc_iface_have_tx_cqe_avail(&iface->super), |
There was a problem hiding this comment.
CQ credit for the invalidate NOP is only asserted: pls check uct_rc_iface_have_tx_cqe_avail() and skip the NOP (or return an error) instead of asserting; ucs_assertv is compiled out in release, so without a CQ credit we post a WQE that will produce an error CQE and can overrun the CQ. The new test_rc_keepalive::inject_error() has to bump tx.cq_available to get past it, which shows the condition does occur.
| } | ||
|
|
||
| /* A bare id can share a pointer's alignment, so the low bit marks it. */ | ||
| ep->ext->recovery_arg = |
There was a problem hiding this comment.
Tagged pointer in the close_req/recovery_arg union slot: why not keep the last accepted peer id in a plain ucp_ep_ext field next to the new tf_request_id? That drops the tag/shift encoding, the (uintptr_t)peer_id << 1 32-bit truncation, and the aliasing with close_req.
| return UCS_OK; | ||
| } | ||
|
|
||
| if (!ucp_ep_tf_peer_req_is_newer(ucp_ep_tf_seen_peer_id(ep), request_id)) { |
There was a problem hiding this comment.
ucp_ep_tf_accept_peer_req() writes the ext union slot without the failover/CM-lane check that ucp_ep_tf_get() does (UCP_ERR_HANDLING_MODE_FAILOVER / cm_lane == UCP_NULL_LANE); on a CM endpoint the slot is close_req, so ucp_ep_tf_seen_peer_id_set() would read and then write seen_peer_id inside a live ucp_request_t.
| /* A peer request moves the queue pair to error and waits for that | ||
| * completion before this lane is failed. Recovery stays idle until | ||
| * the completion holds it. */ | ||
| if ((ucp_ep_recovery_arg(ep) == NULL) || |
There was a problem hiding this comment.
minor: convoluted assertion (if (A || B) assert(A)). Suggested:
| if ((ucp_ep_recovery_arg(ep) == NULL) || | |
| ucs_assert((ucp_ep_recovery_arg(ep) == NULL) || | |
| (ucp_ep_recovery_arg(ep)->tf_reply != NULL)); |
Same condition, but easier to read.
| ucp_wireup_ep_is_owner(ucp_ep_get_lane(ucp_ep, lane), uct_ep)) { | ||
| return lane; | ||
| } | ||
|
|
There was a problem hiding this comment.
minor: ucp_ep_lookup_lane() open-codes recovery_arg->tf[lane] instead of using the new ucp_ep_tf_is_held(), bypassing the failover/CM checks.
| if ((ucp_ep_config(ucp_ep)->key.lanes[lane].lane_types & | |
| UCP_LANE_TYPE_FAILED) && | |
| ucp_ep_tf_is_held(ucp_ep, lane, uct_ep)) { |
|
|
||
| ucp_ep_tf_seen_peer_id_set(ep, request_id); | ||
| *accepted = lanes; | ||
| return UCS_OK; |
There was a problem hiding this comment.
minor: ucp_ep_tf_accept_peer_req() always returns UCS_OK, so the caller's status != UCS_OK branch is dead code. Maybe return the accepted lane map directly?
| * @brief Parameters for invalidating a UCT endpoint by @ref uct_ep_invalidate. | ||
| */ | ||
| typedef struct { | ||
| typedef struct { |
There was a problem hiding this comment.
minor: stray leading space added before typedef struct {.
| typedef struct { | |
| typedef struct { |
| (ucp_ep_tf_hold(ucp_ep, lane, uct_ep) == UCS_OK)) { | ||
| return UCS_INPROGRESS; | ||
| if (wireup_ep == NULL) { | ||
| ucs_status_t hold_status = ucp_ep_tf_hold(ucp_ep, lane, uct_ep); |
There was a problem hiding this comment.
minor: hold_status is declared mid-block; pls define it at the top of the function (docs/CodeStyle.md, "Variable definition").
| * IDLE round re-enters address exchange so rebuild can connect. */ | ||
| ep->ext->recovery_arg->state = UCP_EP_RECOVERY_STATE_IDLE; | ||
| ret = 1; | ||
| ucp_ep_recovery_arg(ep)->state = UCP_EP_RECOVERY_STATE_IDLE; |
There was a problem hiding this comment.
minor: repeated ucp_ep_recovery_arg(ep) calls break the assignment alignment rule in docs/CodeStyle.md; pls take a local arg = ucp_ep_recovery_arg(ep) in this function.
|
Residual coverage gap: finding 1 is a UCP+UCT interaction (asymmetric failure reported by |
|
🤖 CI Triage Agent — TL;DR: The Full analysisSummary: Root cause: The whole MPI/CUDA section of this run shows the test node's GPUs cannot do CUDA IPC between each other:
and the preceding
Implicated commit: 2f18f39 — Raul Akhmetshin, "UCT/CUDA/CUDA_IPC: Unmap memhandle mapped at rkey unpack & rkey ptr. (#11288)" — which added both the test and its unconditional invocation in CI. File: test/mpi/test_ucp_rkey_destroy.c:57 (and the launcher at contrib/test_jenkins.sh:1007-1018) Suggested fix: Make the test topology-aware instead of asserting success:
Re-running this PR after the test is gated should be green; no code change is needed in #12129. Related: #12146 (AZP/TESTS: Do not run test_rma_cuda and test_ucp_rkey_destroy), #11288 (commit that introduced the test) |
Co-authored-by: svc-nvidia-pr-review <svc-nvidia-pr-review@nvidia.com>
The address request rebuilt the lane before the error completion, so outstanding purge ran after the error handler had finished. Hold the queue pair from that completion, then rebuild and reply.
The two-lane case recovered. Three lanes is the case that still leaves a failed lane behind.
The reply omitted a lane while its aux probe was still running, so the peer never learned the new queue pair. Include a wireup that already holds next, and leave that lane off the data path.
A new failure was sending every lane that was still failed, so an older request invalidated a queue pair a newer exchange had already replaced.
The three-lane limit was only for the missing-address case. The original order is 4, 0, 2, 1, 3, then 5, with lane 5 left healthy.
A delayed LANES_ADDR request must not invalidate a replacement queue pair, and a newer request restarts a reply that is still waiting for an error that will not arrive. Purge succeeds when every posted WQE is a NOP, because that NOP sometimes completes without an error CQE.
The pinned injection order was only needed to reproduce one failure. The token PUT case now passes with the same random lane order as the other operations.
A reply derives the receive position even after the local exchange was released. An ACK hole for a lane that is still held means the peer queue pair is gone, so outstanding sends are purged as undelivered and the hold is released. PUT injection replays lanes 4, 0, 2, 1, 3, 5.
recovery_arg shares storage with the close request. A sockaddr endpoint does not support failover, so that pointer is the close request and reading it as recovery state walks off the allocation.
The endpoint and wireup each had the same newer-id test. Wireup now calls ucp_ep_tf_peer_req_is_newer.
Log the operation when a repost request is restarted or submitted. Paths that return before a request exists stay silent.
The per-lane seen-id array is larger than the check needs: one send sequence covers every lane in a request. Keep that counter in the padding after cm_idx so a later recovery does not restart at 1, and stash the last accepted peer id in the recovery slot when the object is freed.
They are not on the fast path. Export only the recovery and close lookups; the peer-id packing stays local to ucp_ep.c.
The slot shares storage with the close request. A CM endpoint does not support failover, so reading that pointer as recovery state walks off the allocation.
The shared slot is a close request while a CM lane exists, and failover state otherwise. A peer-id read is valid only when that lane is absent.
84f995a to
0296db8
Compare
|
🤖 Starting review — findings will be posted here when done. |
| } | ||
|
|
||
| ucp_ep_set_lanes_failed(ucp_ep, UCS_BIT(lane), status); | ||
| ucp_wireup_tf_lane_errored(ucp_ep, lane); |
There was a problem hiding this comment.
blocker: ucp_ep may already be freed here - ucp_ep_set_lanes_failed() can reach ucp_ep_set_failed(), which completes the close request (ucp_ep_local_disconnect_progress()) or calls ucp_ep_disconnected() and destroys the ep. That is why the old code returned immediately after it. The call only clears a waiting bit and schedules a oneshot, so pls do it before:
| ucp_wireup_tf_lane_errored(ucp_ep, lane); | |
| ucp_wireup_tf_lane_errored(ucp_ep, lane); | |
| } | |
| ucp_ep_set_lanes_failed(ucp_ep, UCS_BIT(lane), status); | |
| return UCS_OK; |
(the suggestion block needs to be anchored on lines 493–500 when posting; the point is to move ucp_wireup_tf_lane_errored() ahead of ucp_ep_set_lanes_failed())
| return UCS_OK; | ||
| } | ||
|
|
||
| if (!ucp_ep_tf_peer_req_is_newer(ucp_ep_tf_seen_peer_id(ep), request_id)) { |
There was a problem hiding this comment.
ucp_ep_tf_accept_peer_req: this is driven straight from the LANES_ADDR_REQUEST handler, and ucp_ep_tf_seen_peer_id_set read/write ep->ext->recovery_arg unconditionally. On a CM ep that slot is close_req, so a stray request would overwrite a live close request - only the ucs_assert() catches it in debug. pls bail out here for a CM/non-failover ep, like ucp_ep_tf_get() does.
| if (tf->purged) { | ||
| ucs_diag("ep %p: lane %d already purged uct_ep %p", ep, lane, | ||
| tf->uct_ep); | ||
| } else if (tf->rx_token == NULL) { |
There was a problem hiding this comment.
ucp_ep_tf_lanes_purge_outstanding, new rx_token == NULL branch: purging without UCT_EP_OUTSTANDING_FIELD_RX_TOKEN reports every outstanding op as undelivered, and ucp_ep_tf_outstanding_purge_cb() reposts them. If the peer QP is gone but some of those sends were already received and consumed (AM, atomics), the repost duplicates them. why is replay safe here instead of failing the lane/ep?
| UCT_RC_MLX5_BASE_EP_DECL(tl_ep, iface, ep); | ||
| ucs_status_t status; | ||
|
|
||
| UCT_RC_CHECK_TX_CQ_RES(&iface->super, &ep->super); |
There was a problem hiding this comment.
uct_ep_invalidate() can now return UCS_ERR_NO_RESOURCE (and posts a NOP), which is a user-visible contract change - the test had to reserve a credit for it. pls document it in the uct_ep_invalidate() doc in uct_v2.h; existing callers treat it as always succeeding.
| /* A peer request moves the queue pair to error and waits for that | ||
| * completion before this lane is failed. Recovery stays idle until | ||
| * the completion holds it. */ | ||
| if ((ucp_ep_recovery_arg(ep) == NULL) || |
There was a problem hiding this comment.
this reads as "assert(arg == NULL) unless a reply is parked"; pls write it directly:
| if ((ucp_ep_recovery_arg(ep) == NULL) || | |
| ucs_assert((ucp_ep_recovery_arg(ep) == NULL) || | |
| (ucp_ep_recovery_arg(ep)->tf_reply != NULL)); |
| } | ||
|
|
||
| if (ep->ext->recovery_arg == NULL) { | ||
| if (ucp_ep_recovery_arg(ep) == NULL) { |
There was a problem hiding this comment.
pls keep arg = ucp_ep_recovery_arg(ep) in a local var as before - this function now calls it ~15 times, and each call does a cm-lane check plus a tag test on a keepalive/progress path.
|
+1 on the existing thread: PR size/scope - the UCT purge revert, the deferred-reply machinery, the +1 on the existing thread: Residual coverage gap: Residual coverage gap: Residual coverage gap: |
|
🤖 CI Triage Agent — TL;DR: The Coverity Full analysisSummary: Root cause: 2966: ucp_ep_lane_tf_t *tf = ucp_ep_tf_get(ep, lane);
...
2971: if (!ucp_ep_tf_exchange_open(ep, lane) || (token == NULL) || (len == 0)) {
2972: return;
2973: }
2975: expect = from_ack ? tf->peer_id : tf->request_id; /* <-- deref */The NULL guard is indirect: Implicated commit: Most likely File: Suggested fix: Make the NULL check explicit and local so it is both correct and visible to the analyzer: ucp_ep_lane_tf_t *tf = ucp_ep_tf_get(ep, lane);
...
if ((tf == NULL) || !ucp_ep_tf_exchange_open(ep, lane) ||
(token == NULL) || (len == 0)) {
return;
}This matches the existing convention in Related: PR #12129 (branch
|
|
🤖 Starting review — findings will be posted here when done. |
| UCT_RC_MLX5_BASE_EP_DECL(tl_ep, iface, ep); | ||
| ucs_status_t status; | ||
|
|
||
| UCT_RC_CHECK_TX_CQ_RES(&iface->super, &ep->super); |
There was a problem hiding this comment.
uct_ep_invalidate() can now return UCS_ERR_NO_RESOURCE and leave the QP operational, but uct_v2.h documents it as "invalidates the endpoint and moves it to the error state", and test_uct_peer_failure::inject_error() does ASSERT_UCS_OK() right after the TX window is filled (two_pairs_send, test_uct_peer_failure_multiple) — the new invalidate_credit_left() guard only covers fill_resources(). Can we reserve the credit for the NOP instead of failing, or at least document the new return code and handle it in all callers?
| } | ||
|
|
||
| /* A bare id can share a pointer's alignment, so the low bit marks it. */ | ||
| ep->ext->recovery_arg = |
There was a problem hiding this comment.
Instead of tagging the close_req/recovery_arg slot, pls keep seen_peer_id as a plain uint32_t in ucp_ep_ext_t next to the new tf_request_id — it fits in the padding this PR already added (struct stays 224 bytes), drops UCP_EP_SLOT_PEER_ID_BIT / ucp_ep_ext_recovery_is_peer_id(), and removes the case where ucp_ep_tf_seen_peer_id_set() writes into ext->close_req, since ucp_ep_tf_accept_peer_req() has no CM-lane check.
| ucp_worker_h worker = ep->worker; | ||
| int ret = 0; | ||
| ucp_lane_map_t failed, recovered; | ||
| int resend; |
There was a problem hiding this comment.
Pls keep a local arg = ucp_ep_recovery_arg(ep) here, like ucp_ep_recovery_arm() and ucp_ep_recovery_on_reply_received() do; this function now calls ucp_ep_recovery_arg(ep) about 30 times on the keepalive path and it is much harder to read.
| /* A peer request moves the queue pair to error and waits for that | ||
| * completion before this lane is failed. Recovery stays idle until | ||
| * the completion holds it. */ | ||
| if ((ucp_ep_recovery_arg(ep) == NULL) || |
There was a problem hiding this comment.
Suggestion:
ucs_assert((ucp_ep_recovery_arg(ep) == NULL) ||
(ucp_ep_recovery_arg(ep)->tf_reply != NULL));
The if only guards an assertion of its own negation, which is hard to read.
| (ucp_ep_tf_hold(ucp_ep, lane, uct_ep) == UCS_OK)) { | ||
| return UCS_INPROGRESS; | ||
| if (wireup_ep == NULL) { | ||
| ucs_status_t hold_status = ucp_ep_tf_hold(ucp_ep, lane, uct_ep); |
There was a problem hiding this comment.
Pls define hold_status at the top of the function with wireup_ep (docs/CodeStyle.md, variable definition).
| } | ||
|
|
||
| ucs_status_t | ||
| ucp_ep_tf_accept_peer_req(ucp_ep_h ep, ucp_lane_map_t lanes, |
There was a problem hiding this comment.
ucp_ep_tf_accept_peer_req always returns UCS_OK, so the ucs_error() branch in ucp_wireup_process_lanes_addr_request() is dead code; can it just return the accepted lane map?
|
Notes on already-reported issues: the UCT purge/ Residual coverage gap: no test covers Residual coverage gap: nothing covers a second failure episode on the same endpoint, which is the only consumer of the persisted |
|
replaced with #12195 |
What?
Describe what this PR is doing.
Why?
Justification for the PR. If there is an existing issue/bug, please reference it. For
bug fixes, the 'Why?' and 'What?' can be merged into a single item.
How?
It is optional, but for complex PRs, please provide information about the design,
architecture, approach, etc.