From: Michael S. Tsirkin Date: Sun, 27 Aug 2006 12:28:09 +0000 (+0300) Subject: IB/sdp: request notification only if CQ exists. X-Git-Tag: v4.1.12-92~264^2~5^2~382 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bbd9a1643b3b5e2cdd436c7d47253a1ad2220945;p=users%2Fjedix%2Flinux-maple.git IB/sdp: request notification only if CQ exists. Further, poll after request for notification, as required by IB spec. Signed-off-by: Michael S. Tsirkin --- diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/sdp_main.c index ed919a34fb9f8..2e28438688c2a 100644 --- a/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/drivers/infiniband/ulp/sdp/sdp_main.c @@ -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;