]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: Don't count sdp header twice when calculating size_goal
authorAmir Vadai <amirv@mellanox.co.il>
Thu, 15 Apr 2010 08:52:19 +0000 (11:52 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:04:53 +0000 (05:04 -0700)
sizeof(struct sdp_bsdh) is included inside skb->len. Ignore it
when calculating maximum payload of the skb.
This mistake caused every BCopy send of 32K (and its multiples) to
be split and thus got bad performance.

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

index 597201d0d08e25c35fd72b2fcd933bebb2481fd2..27a563cf9d90553686ef665280e90bf61ce7403c 100644 (file)
@@ -1887,7 +1887,7 @@ static int sdp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
                        skb = sk->sk_write_queue.prev;
 
                        if (!sk->sk_send_head ||
-                           (copy = size_goal - skb->len) <= 0 ||
+                           (copy = size_goal - (skb->len - sizeof(struct sdp_bsdh))) <= 0 ||
                            bz != BZCOPY_STATE(skb)) {
 new_segment:
                                /*
@@ -1925,14 +1925,16 @@ new_segment:
                                sdp_dbg_data(sk, "created new skb: %p"
                                        " len = %d, sk_send_head: %p "
                                        "copy: %d size_goal: %d\n",
-                                       skb, skb->len, sk->sk_send_head, copy, size_goal);
+                                       skb, skb->len - sizeof(struct sdp_bsdh),
+                                       sk->sk_send_head, copy, size_goal);
 
 
                        } else {
                                sdp_dbg_data(sk, "adding to existing skb: %p"
                                        " len = %d, sk_send_head: %p "
                                        "copy: %d\n",
-                                       skb, skb->len, sk->sk_send_head, copy);
+                                       skb, skb->len - sizeof(struct sdp_bsdh),
+                                       sk->sk_send_head, copy);
                        }
 
                        /* Try to append data to the end of skb. */
@@ -2011,7 +2013,7 @@ out:
 do_fault:
        sdp_prf(sk, skb, "prepare fault");
 
-       if (!skb->len) {
+       if (skb->len <= sizeof(struct sdp_bsdh)) {
                if (sk->sk_send_head == skb)
                        sk->sk_send_head = NULL;
                __skb_unlink(skb, &sk->sk_write_queue);