]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
IB/sdp: request notification only if CQ exists.
authorMichael S. Tsirkin <mst@mellanox.co.il>
Sun, 27 Aug 2006 12:28:09 +0000 (15:28 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:03:58 +0000 (05:03 -0700)
Further, poll after request for notification, as required by IB spec.

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_main.c

index ed919a34fb9f85029a4de1b1cd4b31a99c27a410..2e28438688c2ad1a95e43ac80ac6d2652f17ce4e 100644 (file)
@@ -557,11 +557,17 @@ static struct sock *sdp_accept(struct sock *sk, int flags, int *err)
        newssk->parent = NULL;
        sk_acceptq_removed(sk);
        newsk = &newssk->isk.sk;
-       sdp_dbg(sk, "%s: ib_req_notify_cq\n", __func__);
-       ib_req_notify_cq(newssk->cq, IB_CQ_NEXT_COMP);
-       /* TODO: poll cq here */
 out:
        release_sock(sk);
+       if (newsk) {
+               lock_sock(newsk);
+               if (newssk->cq) {
+                       sdp_dbg(newsk, "%s: ib_req_notify_cq\n", __func__);
+                       ib_req_notify_cq(newssk->cq, IB_CQ_NEXT_COMP);
+                       sdp_poll_cq(newssk, newssk->cq);
+               }
+               release_sock(newsk);
+       }
        sdp_dbg(sk, "%s: status %d sk %p newsk %p\n", __func__,
                *err, sk, newsk);
        return newsk;