]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: BUG1727 - there is no point of using zcopy when credits are not available.
authorEldad Zinger <eldadz@mellanox.co.il>
Thu, 18 Mar 2010 08:53:56 +0000 (10:53 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:04:52 +0000 (05:04 -0700)
if credits are not available, data won't be transferred anyway,
so it would be better to use bcopy.

Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_main.c

index df7e70600e70a6be2b0eb841ca69a59c664fe23e..74d6f0ef31469895667250625318fde430b7eba8 100644 (file)
@@ -1845,7 +1845,7 @@ static int sdp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
                SDPSTATS_HIST(sendmsg_seglen, seglen);
 
                if (sdp_zcopy_thresh && seglen > sdp_zcopy_thresh &&
-                               seglen > SDP_MIN_ZCOPY_THRESH) {
+                               seglen > SDP_MIN_ZCOPY_THRESH && tx_slots_free(ssk)) {
                        int zcopied = 0;
 
                        zcopied = sdp_sendmsg_zcopy(iocb, sk, iov);