]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: BUG2038 - transmission goal size won't exceed SDP_MAX_PAYLOAD
authorEldad Zinger <eldadz@mellanox.co.il>
Sun, 6 Jun 2010 09:07:59 +0000 (12:07 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:04:59 +0000 (05:04 -0700)
Signed-off-by: Eldad Zinger <eldadz@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_main.c

index 51ee856ab49f80915a4b25acc821b6682b96e809..e46f1391afb8ddcf4bef5b8aabf51ed3fe1d67a7 100644 (file)
@@ -1858,7 +1858,7 @@ static int sdp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
        struct sdp_sock *ssk = sdp_sk(sk);
        struct sk_buff *skb;
        int iovlen, flags;
-       int size_goal;
+       const int size_goal = MIN(ssk->xmit_size_goal, SDP_MAX_PAYLOAD);
        int err, copied;
        long timeo;
        struct bzcopy_state *bz = NULL;
@@ -1881,8 +1881,6 @@ static int sdp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
        /* This should be in poll */
        clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
 
-       size_goal = ssk->xmit_size_goal;
-
        /* Ok commence sending. */
        iovlen = msg->msg_iovlen;
        copied = 0;
@@ -1919,10 +1917,6 @@ static int sdp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
                        sdp_dbg_data(sk, "ZCopied: 0x%x/0x%x\n", zcopied, seglen);
                }
 
-               /* Limiting the size_goal is reqired when using 64K pages*/
-               if (size_goal > SDP_MAX_PAYLOAD)
-                       size_goal = SDP_MAX_PAYLOAD;
-
                if (bz)
                        sdp_bz_cleanup(bz);
                bz = sdp_bz_setup(ssk, from, seglen, size_goal);
@@ -2039,8 +2033,6 @@ wait_for_memory:
                                        bz ? &bz->busy : NULL);
                        if (err)
                                goto do_error;
-
-                       size_goal = ssk->xmit_size_goal;
                }
        }