* [PATCH net] rds: RDS (tcp) hangs on sendto() to unresponding address
@ 2018-10-08 16:17 Ka-Cheong Poon
2018-10-08 16:59 ` Santosh Shilimkar
2018-10-11 5:21 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Ka-Cheong Poon @ 2018-10-08 16:17 UTC (permalink / raw)
To: netdev; +Cc: santosh.shilimkar, davem, rds-devel
In rds_send_mprds_hash(), if the calculated hash value is non-zero and
the MPRDS connections are not yet up, it will wait. But it should not
wait if the send is non-blocking. In this case, it should just use the
base c_path for sending the message.
Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
---
net/rds/send.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/net/rds/send.c b/net/rds/send.c
index 57b3d5a..fe785ee 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -1007,7 +1007,8 @@ static int rds_cmsg_send(struct rds_sock *rs, struct rds_message *rm,
return ret;
}
-static int rds_send_mprds_hash(struct rds_sock *rs, struct rds_connection *conn)
+static int rds_send_mprds_hash(struct rds_sock *rs,
+ struct rds_connection *conn, int nonblock)
{
int hash;
@@ -1023,10 +1024,16 @@ static int rds_send_mprds_hash(struct rds_sock *rs, struct rds_connection *conn)
* used. But if we are interrupted, we have to use the zero
* c_path in case the connection ends up being non-MP capable.
*/
- if (conn->c_npaths == 0)
+ if (conn->c_npaths == 0) {
+ /* Cannot wait for the connection be made, so just use
+ * the base c_path.
+ */
+ if (nonblock)
+ return 0;
if (wait_event_interruptible(conn->c_hs_waitq,
conn->c_npaths != 0))
hash = 0;
+ }
if (conn->c_npaths == 1)
hash = 0;
}
@@ -1256,7 +1263,7 @@ int rds_sendmsg(struct socket *sock, struct msghdr *msg, size_t payload_len)
}
if (conn->c_trans->t_mp_capable)
- cpath = &conn->c_path[rds_send_mprds_hash(rs, conn)];
+ cpath = &conn->c_path[rds_send_mprds_hash(rs, conn, nonblock)];
else
cpath = &conn->c_path[0];
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net] rds: RDS (tcp) hangs on sendto() to unresponding address
2018-10-08 16:17 [PATCH net] rds: RDS (tcp) hangs on sendto() to unresponding address Ka-Cheong Poon
@ 2018-10-08 16:59 ` Santosh Shilimkar
2018-10-11 5:21 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Santosh Shilimkar @ 2018-10-08 16:59 UTC (permalink / raw)
To: Ka-Cheong Poon, netdev; +Cc: davem, rds-devel
10/8/2018 9:17 AM, Ka-Cheong Poon wrote:
> In rds_send_mprds_hash(), if the calculated hash value is non-zero and
> the MPRDS connections are not yet up, it will wait. But it should not
> wait if the send is non-blocking. In this case, it should just use the
> base c_path for sending the message.
>
> Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
> ---
Thanks for getting this out on the list.
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] rds: RDS (tcp) hangs on sendto() to unresponding address
2018-10-08 16:17 [PATCH net] rds: RDS (tcp) hangs on sendto() to unresponding address Ka-Cheong Poon
2018-10-08 16:59 ` Santosh Shilimkar
@ 2018-10-11 5:21 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-10-11 5:21 UTC (permalink / raw)
To: ka-cheong.poon; +Cc: netdev, santosh.shilimkar, rds-devel
From: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
Date: Mon, 8 Oct 2018 09:17:11 -0700
> In rds_send_mprds_hash(), if the calculated hash value is non-zero and
> the MPRDS connections are not yet up, it will wait. But it should not
> wait if the send is non-blocking. In this case, it should just use the
> base c_path for sending the message.
>
> Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-11 12:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-08 16:17 [PATCH net] rds: RDS (tcp) hangs on sendto() to unresponding address Ka-Cheong Poon
2018-10-08 16:59 ` Santosh Shilimkar
2018-10-11 5:21 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).