mirror of
https://github.com/ceph/ceph
synced 2025-01-11 05:29:51 +00:00
msg/async/rdma: cosmetics initialize ibv_send_wr* var
API usage: int ibv_post_send(struct ibv_qp *qp, struct ibv_send_wr *wr, struct ibv_send_wr **bad_wr) Input Parameters: qp struct ibv_qp from ibv_create_qp wr first work request (WR) Output Parameters: bad_wr pointer to first rejected WR Return Value: 0 on success, -1 on error. If the call fails, errno will be set to indicate the reason for the failure. To avoid wrong checking return value, it's better to initialize the value to be nullptr. Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
This commit is contained in:
parent
7078506107
commit
60a87c9db9
@ -578,7 +578,7 @@ int RDMAConnectedSocketImpl::post_work_request(std::vector<Chunk*> &tx_buffers)
|
||||
++current_buffer;
|
||||
}
|
||||
|
||||
ibv_send_wr *bad_tx_work_request;
|
||||
ibv_send_wr *bad_tx_work_request = nullptr;
|
||||
if (ibv_post_send(qp->get_qp(), iswr, &bad_tx_work_request)) {
|
||||
ldout(cct, 1) << __func__ << " failed to send data"
|
||||
<< " (most probably should be peer not ready): "
|
||||
@ -600,7 +600,7 @@ void RDMAConnectedSocketImpl::fin() {
|
||||
wr.num_sge = 0;
|
||||
wr.opcode = IBV_WR_SEND;
|
||||
wr.send_flags = IBV_SEND_SIGNALED;
|
||||
ibv_send_wr* bad_tx_work_request;
|
||||
ibv_send_wr* bad_tx_work_request = nullptr;
|
||||
if (ibv_post_send(qp->get_qp(), &wr, &bad_tx_work_request)) {
|
||||
ldout(cct, 1) << __func__ << " failed to send message="
|
||||
<< " ibv_post_send failed(most probably should be peer not ready): "
|
||||
|
Loading…
Reference in New Issue
Block a user