From: Amir Vadai Date: Tue, 24 Nov 2009 07:32:39 +0000 (+0200) Subject: sdp: fixed BUG1796 - running out of memory on rx X-Git-Tag: v4.1.12-92~264^2~5^2~244 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f55045831d1097449ec82cec9fe4de60fd5b2ad9;p=users%2Fjedix%2Flinux-maple.git sdp: fixed BUG1796 - running out of memory on rx rcv queue could grow endlessly because minimal RX buffers in QP was set to SDP_MIN_TX_CREDITS + 1 - so there always were credits available for the sender. Signed-off-by: Amir Vadai --- diff --git a/drivers/infiniband/ulp/sdp/sdp_rx.c b/drivers/infiniband/ulp/sdp/sdp_rx.c index 4f71bb38267ee..ca2f0bca91167 100644 --- a/drivers/infiniband/ulp/sdp/sdp_rx.c +++ b/drivers/infiniband/ulp/sdp/sdp_rx.c @@ -258,7 +258,7 @@ static inline int sdp_post_recvs_needed(struct sdp_sock *ssk) if (unlikely(rx_ring_posted(ssk) >= SDP_RX_SIZE)) return 0; - if (likely(rx_ring_posted(ssk) > SDP_MIN_TX_CREDITS)) { + if (likely(rx_ring_posted(ssk) >= SDP_MIN_TX_CREDITS)) { unsigned long bytes_in_process = (rx_ring_posted(ssk) - SDP_MIN_TX_CREDITS) * buffer_size;