]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: sdp_bzcopy_thresh module parameter removal
authorEldad Zinger <eldadz@mellanox.co.il>
Thu, 22 Apr 2010 07:34:59 +0000 (10:34 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:04:54 +0000 (05:04 -0700)
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 <eldadz@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp.h
drivers/infiniband/ulp/sdp/sdp_main.c

index f6660caee6cc3c2e456d71e179a4e7dbfca15c55..2d66c36c7238431f138873633b03ccc7722cac34 100644 (file)
@@ -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;
 };
index 4aca949bfeeaa071e14232dc96290f12a307d53b..c6d3ef7b6150dabad778964341a9b4c940e91c46 100644 (file)
@@ -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;