]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: fixed BUG1796 - running out of memory on rx
authorAmir Vadai <amirv@mellanox.co.il>
Tue, 24 Nov 2009 07:32:39 +0000 (09:32 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:04:40 +0000 (05:04 -0700)
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 <amirv@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_rx.c

index 4f71bb38267eeea9badbe100db2b48d6a310e151..ca2f0bca91167e1290ed04280e65cc073d1fcdad 100644 (file)
@@ -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;