From: Amir Vadai Date: Sun, 27 Dec 2009 10:51:16 +0000 (+0200) Subject: sdp: Set a lower limit to ZCopy threshold X-Git-Tag: v4.1.12-92~264^2~5^2~225 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7dc7a114e80bdef1bb114d7d90be6d971e75b23c;p=users%2Fjedix%2Flinux-maple.git sdp: Set a lower limit to ZCopy threshold No need to use ZCopy, when the whole packet is sent as SrcAvail payload Signed-off-by: Amir Vadai --- diff --git a/drivers/infiniband/ulp/sdp/sdp.h b/drivers/infiniband/ulp/sdp/sdp.h index f436c90c74ef0..afb829d552095 100644 --- a/drivers/infiniband/ulp/sdp/sdp.h +++ b/drivers/infiniband/ulp/sdp/sdp.h @@ -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 diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/sdp_main.c index 2590514881dbc..e97100fcbc666 100644 --- a/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/drivers/infiniband/ulp/sdp/sdp_main.c @@ -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");