From: Eldad Zinger Date: Sun, 24 Oct 2010 09:24:27 +0000 (+0200) Subject: sdp: no point of waiting for data if remote host can't send X-Git-Tag: v4.1.12-92~264^2~5^2~71 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=af9ca1f590cc38541763e0accc54c2cffe5fb1d0;p=users%2Fjedix%2Flinux-maple.git sdp: no point of waiting for data if remote host can't send Signed-off-by: Eldad Zinger --- diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/sdp_main.c index d67e8d411c993..946becd4d2834 100644 --- a/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/drivers/infiniband/ulp/sdp/sdp_main.c @@ -2389,6 +2389,17 @@ sdp_mid_data: if (poll_recv_cq(sk)) { sdp_dbg_data(sk, "sk_wait_data %ld\n", timeo); + if (remote_credits(ssk) <= SDP_MIN_TX_CREDITS) { + /* Remote host can not send, so there is no + * point of waiting for data. + * This situation is possible if current host + * can not send credits-update due to lack of + * memory. + */ + if (!copied) + copied = -ENOMEM; + break; + } posts_handler_put(ssk, 0); sk_wait_data(sk, &timeo);