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

msg/async/rdma: Fix broken compilation #13603

Merged
merged 1 commit into from Feb 27, 2017

Conversation

Projects
None yet
4 participants
@Adirl

Adirl commented Feb 23, 2017

following api change in commit eb0f624

Signed-off-by: Sarit Zubakov saritz@mellanox.com

msg/async/rdma: Fix broken compilation
Resposible commit is: eb0f624

issue:985021

Change-Id: I5b4afc537a9351dd18f5ea08bf4d72a1b03a8635
Signed-off-by: Sarit Zubakov <saritz@mellanox.com>
@Adirl

This comment has been minimized.

Adirl commented Feb 23, 2017

@@ -97,7 +97,7 @@ int RDMAServerSocketImpl::accept(ConnectedSocket *sock, const SocketOptions &opt
::close(sd);
return -errno;
}
net.set_priority(sd, opt.priority);
net.set_priority(sd, opt.priority, out->get_family());

This comment has been minimized.

@yuyuyu101

yuyuyu101 Feb 23, 2017

Member

I think we need to set priority after assigning value to "out"

This comment has been minimized.

@saritz

saritz Feb 23, 2017

Contributor

Hi @yuyuyu101 ,
How about the following (change order put set_sockadde() before)?

`int RDMAServerSocketImpl::accept(ConnectedSocket *sock, const SocketOptions &opt, entity_addr_t *out, Worker *w)
{
ldout(cct, 15) << func << dendl;

assert(sock);
sockaddr_storage ss;
socklen_t slen = sizeof(ss);
int sd = ::accept(server_setup_socket, (sockaddr*)&ss, &slen);
if (sd < 0) {
return -errno;
}
ldout(cct, 20) << func << " accepted a new QP, tcp_fd: " << sd << dendl;

net.set_close_on_exec(sd);
int r = net.set_nonblock(sd);
if (r < 0) {
::close(sd);
return -errno;
}

r = net.set_socket_options(sd, opt.nodelay, opt.rcbuf_size);
if (r < 0) {
::close(sd);
return -errno;
}

if (out)
out->set_sockaddr((sockaddr*)&ss);
net.set_priority(sd, opt.priority, out->get_family());

RDMAConnectedSocketImpl* server;
//Worker* w = dispatcher->get_stack()->get_worker();
server = new RDMAConnectedSocketImpl(cct, infiniband, dispatcher, dynamic_cast<RDMAWorker*>(w));
server->set_accept_fd(sd);
ldout(cct, 20) << func << " accepted a new QP, tcp_fd: " << sd << dendl;
std::unique_ptr csi(server);
*sock = ConnectedSocket(std::move(csi));

return 0;
}
`

This comment has been minimized.

@yuyuyu101

This comment has been minimized.

@saritz

saritz Feb 28, 2017

Contributor

Hi @yuyuyu101, @robbat2 ,
In the original commit: "msg/async: support IPv6 QoS. #13418" (#13418), the call to "set_priority()" is done without check if "out" is NULL. We need to first check if out is not NULL before sending it to "set_priority()". What should be default value if "out" is NULL?

For convenience I copied and marked the essential code to see the problem.

In PosixStack.cc::
260 int PosixServerSocketImpl::accept(ConnectedSocket *sock, const SocketOptions &opt, entity_addr_t *out, Worker w) {

281 handler.set_priority(sd, opt.priority, out->get_family());

285 if (out)
286 out->set_sockaddr((sockaddr
)&ss);
287 return 0;
288 }

Thanks

@Adirl @orendu

This comment has been minimized.

@yuyuyu101

yuyuyu101 Feb 28, 2017

Member

fire a pr?

This comment has been minimized.

@robbat2

robbat2 Mar 1, 2017

Contributor

@saritz i'm trying to see why out should EVER be null inside PosixServerSocketImpl::accept, I'd say we're probably better off with assert(NULL != out)

@yuyuyu101

see inline

@yuyuyu101 yuyuyu101 merged commit ef19e90 into ceph:master Feb 27, 2017

3 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodifed Submodules submodules for project are unmodified
Details
default Build finished.
Details

@Adirl Adirl deleted the Adirl:fix_compile branch Apr 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment