]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
SDP: Fix to limit max buffer size in sdp_resize_buffers on IA64
authorAmir Vadai <amirv@mellanox.co.il>
Tue, 2 Dec 2008 13:01:26 +0000 (15:01 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:04:22 +0000 (05:04 -0700)
Fix for bug 1311
https://bugs.openfabrics.org/show_bug.cgi?id=1311

Signed-off-by: Nicolas Morey-Chaisemartin <nicolas.morey-chaisemartin@ext.bull.net>
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_bcopy.c

index 7dd0d06330a7b73976d449c033166f22ae7c3f1c..53e2d7ed030436a264e735eedfb411a20f0557c4 100644 (file)
@@ -604,7 +604,16 @@ int sdp_init_buffers(struct sdp_sock *ssk, u32 new_size)
 int sdp_resize_buffers(struct sdp_sock *ssk, u32 new_size)
 {
        u32 curr_size = SDP_HEAD_SIZE + ssk->recv_frags * PAGE_SIZE;
+#if defined(__ia64__)
+       /* for huge PAGE_SIZE systems, aka IA64, limit buffers size
+          [re-]negotiation to a known+working size that will not
+          trigger a HW error/rc to be interpreted as a IB_WC_LOC_LEN_ERR */
+       u32 max_size = (SDP_HEAD_SIZE + SDP_MAX_SEND_SKB_FRAGS * PAGE_SIZE) <=
+               32784 ?
+               (SDP_HEAD_SIZE + SDP_MAX_SEND_SKB_FRAGS * PAGE_SIZE): 32784;
+#else 
        u32 max_size = SDP_HEAD_SIZE + SDP_MAX_SEND_SKB_FRAGS * PAGE_SIZE;
+#endif
 
        if (new_size > curr_size && new_size <= max_size &&
            sdp_get_large_socket(ssk)) {