]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: Set a lower limit to ZCopy threshold
authorAmir Vadai <amirv@mellanox.co.il>
Sun, 27 Dec 2009 10:51:16 +0000 (12:51 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:04:45 +0000 (05:04 -0700)
No need to use ZCopy, when the whole packet is sent as SrcAvail payload

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp.h
drivers/infiniband/ulp/sdp/sdp_main.c

index f436c90c74ef0b3bcba1467617ca886ee730f37a..afb829d552095edc8b789a13342c849dfa68c6ed 100644 (file)
@@ -44,7 +44,8 @@
 #define SDP_NUM_WC 4
 #define SDP_MAX_PAYLOAD ((1 << 16) - SDP_HEAD_SIZE)
 
-#define SDP_MIN_ZCOPY_THRESH    1024
+#define SDP_DEF_ZCOPY_THRESH 64*1024
+#define SDP_MIN_ZCOPY_THRESH PAGE_SIZE
 #define SDP_MAX_ZCOPY_THRESH 1048576
 
 #define SDP_OP_RECV 0x800000000LL
index 2590514881dbc5c4c4cdbed69700c6c5cd0b5798..e97100fcbc666ef0f47dd5d63aef45dabf4adb85 100644 (file)
@@ -95,8 +95,8 @@ SDP_MODPARAM_SINT(sdp_keepalive_time, SDP_KEEPALIVE_TIME,
        "Default idle time in seconds before keepalive probe sent.");
 SDP_MODPARAM_SINT(sdp_bzcopy_thresh, 0,
        "Zero copy send using SEND threshold; 0=0ff.");
-SDP_MODPARAM_INT(sdp_zcopy_thresh, 64*1024,
-       "Zero copy using RDMA threshold; 0=0ff.");
+SDP_MODPARAM_INT(sdp_zcopy_thresh, SDP_DEF_ZCOPY_THRESH ,
+       "Zero copy using RDMA threshold; 0=Off.");
 #define SDP_RX_COAL_TIME_HIGH 128
 SDP_MODPARAM_SINT(sdp_rx_coal_target, 0x50000,
        "Target number of bytes to coalesce with interrupt moderation.");
@@ -1810,7 +1810,7 @@ static int sdp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
        struct bzcopy_state *bz = NULL;
        SDPSTATS_COUNTER_INC(sendmsg);
 
-       if (sdp_zcopy_thresh && size > sdp_zcopy_thresh) {
+       if (sdp_zcopy_thresh && size > sdp_zcopy_thresh && size > SDP_MIN_ZCOPY_THRESH) {
                zcopied = sdp_sendmsg_zcopy(iocb, sk, msg, size);
                if (zcopied == -EAGAIN || zcopied == -ETIME) {
                        sdp_dbg_data(sk, "Got SendSM/Timedout - fallback to regular send\n");