Skip to content
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

DAOS-15914 cart: Release input buffer during crt_reply_send() #14793

Draft
wants to merge 3 commits into
base: release/2.6
Choose a base branch
from
Draft
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
27 changes: 26 additions & 1 deletion src/cart/crt_hg.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright 2016-2023 Intel Corporation.
* (C) Copyright 2016-2024 Intel Corporation.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*/
Expand Down Expand Up @@ -1506,6 +1506,8 @@ crt_hg_reply_send(struct crt_rpc_priv *rpc_priv)
D_ASSERT(rpc_priv != NULL);

RPC_ADDREF(rpc_priv);

/* Input buffer still used during HG_Respond*/
hg_ret = HG_Respond(rpc_priv->crp_hg_hdl, crt_hg_reply_send_cb,
rpc_priv, &rpc_priv->crp_pub.cr_output);
if (hg_ret != HG_SUCCESS) {
Expand All @@ -1516,6 +1518,17 @@ crt_hg_reply_send(struct crt_rpc_priv *rpc_priv)
rc = crt_hgret_2_der(hg_ret);
}

/* Don't release input for forwarded RPCs as they share input with a parent */
if (!rpc_priv->crp_forward) {
/* Release input buffer */
hg_ret = HG_Release_input_buf(rpc_priv->crp_hg_hdl);
if (hg_ret != HG_SUCCESS) {
RPC_ERROR(rpc_priv, "HG_Release_input_buf failed, hg_ret: " DF_HG_RC "\n",
DP_HG_RC(hg_ret));
/* Fall through */
}
}

return rc;
}

Expand All @@ -1540,6 +1553,18 @@ crt_hg_reply_error_send(struct crt_rpc_priv *rpc_priv, int error_code)
"Sent CART level error message back to client. error_code: %d\n",
error_code);
}

/* Don't release input for forwarded RPCs as they share input with a parent */
if (!rpc_priv->crp_forward) {
/* Release input buffer */
hg_ret = HG_Release_input_buf(rpc_priv->crp_hg_hdl);
if (hg_ret != HG_SUCCESS) {
RPC_ERROR(rpc_priv, "HG_Release_input_buf failed, hg_ret: " DF_HG_RC "\n",
DP_HG_RC(hg_ret));
/* Fall through */
}
}

rpc_priv->crp_reply_pending = 0;
}

Expand Down
Loading