]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: Initialize remote credits when sending Hello
authorAmir Vadai <amirv@mellanox.co.il>
Wed, 27 Oct 2010 13:56:23 +0000 (15:56 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:05:33 +0000 (05:05 -0700)
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_cma.c

index 916c338ab0519ea14b5f98bfa900965c5ae71bfc..1747929f4380a9b7dd9bdccfd13194d606beb3cb 100644 (file)
@@ -363,8 +363,6 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
                rc = sdp_init_qp(sk, id);
                if (rc)
                        break;
-               atomic_set(&sdp_sk(sk)->remote_credits,
-                               rx_ring_posted(sdp_sk(sk)));
                memset(&hh, 0, sizeof hh);
                hh.bsdh.mid = SDP_MID_HELLO;
                hh.bsdh.len = htonl(sizeof(struct sdp_hh));
@@ -373,6 +371,8 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
                hh.majv_minv = SDP_MAJV_MINV;
                sdp_init_buffers(sdp_sk(sk), rcvbuf_initial_size);
                hh.bsdh.bufs = htons(rx_ring_posted(sdp_sk(sk)));
+               atomic_set(&sdp_sk(sk)->remote_credits,
+                               rx_ring_posted(sdp_sk(sk)));
                hh.localrcvsz = hh.desremrcvsz = htonl(sdp_sk(sk)->recv_frags *
                                PAGE_SIZE + sizeof(struct sdp_bsdh));
                inet_sk(sk)->saddr = inet_sk(sk)->rcv_saddr =