8000 [TE FIX] Updating the outstanding work request counting when closing a QP by alogfans · Pull Request #390 · kvcache-ai/Mooncake · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[TE FIX] Updating the outstanding work request counting when closing a QP #390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,21 @@ int RdmaEndPoint::construct(ibv_cq *cq, size_t num_qp_list,

int RdmaEndPoint::deconstruct() {
for (size_t i = 0; i < qp_list_.size(); ++i) {
if (wr_depth_list_[i] != 0)
LOG(WARNING)
<< "Outstanding work requests found, CQ will not be 8000 generated";

if (ibv_destroy_qp(qp_list_[i])) {
PLOG(ERROR) << "Failed to destroy QP";
return ERR_ENDPOINT;
}
// After destroying QP, the wr_depth_list_ won't change
bool displayed = false;
if (wr_depth_list_[i] != 0) {
if (!displayed) {
LOG(WARNING)
<< "Outstanding work requests found, CQ will not be generated";
displayed = true;
}
__sync_fetch_and_sub(cq_outstanding_, wr_depth_list_[i]);
wr_depth_list_[i] = 0;
}
}
qp_list_.clear();
delete[] wr_depth_list_;
Expand Down Expand Up @@ -218,18 +225,24 @@ void RdmaEndPoint::disconnect() {
}

void RdmaEndPoint::disconnectUnlocked() {
for (size_t i = 0; i < qp_list_.size(); ++i) {
if (wr_depth_list_[i] != 0)
LOG(WARNING) << "Outstanding work requests will be dropped";
}
ibv_qp_attr attr;
memset(&attr, 0, sizeof(attr));
attr.qp_state = IBV_QPS_RESET;
for (size_t i = 0; i < qp_list_.size(); ++i) {
int ret = ibv_modify_qp(qp_list_[i], &attr, IBV_QP_STATE);
if (ret) PLOG(ERROR) << "Failed to modify QP to RESET";
// After resetting QP, the wr_depth_list_ won't change
bool displayed = false;
if (wr_depth_list_[i] != 0) {
if (!displayed) {
LOG(WARNING)
<< "Outstanding work requests found, CQ will not be generated";
displayed = true;
}
__sync_fetch_and_sub(cq_outstanding_, wr_depth_list_[i]);
wr_depth_list_[i] = 0;
}
}
for (size_t i = 0; i < qp_list_.size(); ++i) wr_depth_list_[i] = 0;
status_.store(UNCONNECTED, std::memory_order_release);
}

Expand Down
Loading
0