From: Eldad Zinger Date: Thu, 22 Apr 2010 07:34:59 +0000 (+0300) Subject: sdp: sdp_bzcopy_thresh module parameter removal X-Git-Tag: v4.1.12-92~264^2~5^2~195 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0d444e7cd201ea1808dc7f3a00dd41da2ffefe4a;p=users%2Fjedix%2Flinux-maple.git sdp: sdp_bzcopy_thresh module parameter removal Field [bzcopy_thresh] inside 'struct sdp_sock' changed to [zcopy_thresh] and the ability to disable zcopy per-socket was added. Signed-off-by: Eldad Zinger --- diff --git a/drivers/infiniband/ulp/sdp/sdp.h b/drivers/infiniband/ulp/sdp/sdp.h index f6660caee6cc3..2d66c36c72384 100644 --- a/drivers/infiniband/ulp/sdp/sdp.h +++ b/drivers/infiniband/ulp/sdp/sdp.h @@ -416,8 +416,8 @@ struct sdp_sock { unsigned long rx_bytes; struct sdp_moderation auto_mod; - /* BZCOPY data */ - int bzcopy_thresh; + /* ZCOPY data: -1:use global; 0:disable zcopy; >0: zcopy threshold */ + int zcopy_thresh; int last_bind_err; }; diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/sdp_main.c index 4aca949bfeeaa..c6d3ef7b6150d 100644 --- a/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/drivers/infiniband/ulp/sdp/sdp_main.c @@ -92,8 +92,7 @@ SDP_MODPARAM_SINT(recv_poll_miss, -1, "How many times recv poll missed."); SDP_MODPARAM_SINT(recv_poll, 1000, "How many times to poll recv."); 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."); +static int sdp_bzcopy_thresh = 0; SDP_MODPARAM_INT(sdp_zcopy_thresh, SDP_DEF_ZCOPY_THRESH , "Zero copy using RDMA threshold; 0=Off."); #define SDP_RX_COAL_TIME_HIGH 128 @@ -1085,7 +1084,7 @@ int sdp_init_sock(struct sock *sk) init_timer(&ssk->tx_ring.timer); init_timer(&ssk->nagle_timer); init_timer(&sk->sk_timer); - + ssk->zcopy_thresh = -1; /* use global sdp_zcopy_thresh */ ssk->last_bind_err = 0; return 0; @@ -1231,7 +1230,7 @@ static int sdp_setsockopt(struct sock *sk, int level, int optname, if (val < SDP_MIN_ZCOPY_THRESH || val > SDP_MAX_ZCOPY_THRESH) err = -EINVAL; else - ssk->bzcopy_thresh = val; + ssk->zcopy_thresh = val; break; default: err = -ENOPROTOOPT; @@ -1275,7 +1274,7 @@ static int sdp_getsockopt(struct sock *sk, int level, int optname, val = (ssk->keepalive_time ? : sdp_keepalive_time) / HZ; break; case SDP_ZCOPY_THRESH: - val = ssk->bzcopy_thresh ? ssk->bzcopy_thresh : sdp_bzcopy_thresh; + val = ssk->zcopy_thresh; break; case SDP_LAST_BIND_ERR: val = ssk->last_bind_err; @@ -1498,7 +1497,7 @@ static struct bzcopy_state *sdp_bz_setup(struct sdp_sock *ssk, mm_segment_t cur_fs; int rc = 0; - thresh = ssk->bzcopy_thresh ? : sdp_bzcopy_thresh; + thresh = sdp_bzcopy_thresh; if (thresh == 0 || len < thresh || !capable(CAP_IPC_LOCK)) { SDPSTATS_COUNTER_INC(sendmsg_bcopy_segment); return NULL; @@ -1812,6 +1811,7 @@ static int sdp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, int err, copied; long timeo; struct bzcopy_state *bz = NULL; + int zcopy_thresh = -1 != ssk->zcopy_thresh ? ssk->zcopy_thresh : sdp_zcopy_thresh; SDPSTATS_COUNTER_INC(sendmsg); lock_sock(sk); @@ -1849,7 +1849,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 && + if (zcopy_thresh && seglen > zcopy_thresh && seglen > SDP_MIN_ZCOPY_THRESH && tx_slots_free(ssk)) { int zcopied = 0;