From patchwork Thu Dec 17 15:15:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jackm X-Patchwork-Id: 68538 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBI4ixv0005715 for ; Fri, 18 Dec 2009 04:47:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935958AbZLQPNq (ORCPT ); Thu, 17 Dec 2009 10:13:46 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S935919AbZLQPNq (ORCPT ); Thu, 17 Dec 2009 10:13:46 -0500 Received: from mail-fx0-f221.google.com ([209.85.220.221]:35552 "EHLO mail-fx0-f221.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935958AbZLQPNp (ORCPT ); Thu, 17 Dec 2009 10:13:45 -0500 Received: by mail-fx0-f221.google.com with SMTP id 21so1969677fxm.21 for ; Thu, 17 Dec 2009 07:13:45 -0800 (PST) Received: by 10.103.184.5 with SMTP id l5mr1246637mup.34.1261062825166; Thu, 17 Dec 2009 07:13:45 -0800 (PST) Received: from mtldesk006.lab.mtl.com ([212.179.152.71]) by mx.google.com with ESMTPS id s11sm6649707mue.19.2009.12.17.07.13.43 (version=SSLv3 cipher=RC4-MD5); Thu, 17 Dec 2009 07:13:44 -0800 (PST) From: Jack Morgenstein Organization: Mellanox To: rdreier@cisco.com Subject: [PATCH 2/2] mlx4_ib: initialize SRQ scatter entries when creating an SRQ Date: Thu, 17 Dec 2009 17:15:43 +0200 User-Agent: KMail/1.9.1 Cc: linux-rdma@vger.kernel.org, Tziporet Koren MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200912171715.43254.jackm@dev.mellanox.co.il> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/drivers/infiniband/hw/mlx4/srq.c b/drivers/infiniband/hw/mlx4/srq.c index d425652..403ccbc 100644 --- a/drivers/infiniband/hw/mlx4/srq.c +++ b/drivers/infiniband/hw/mlx4/srq.c @@ -130,6 +130,8 @@ struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd, if (err) goto err_mtt; } else { + struct mlx4_wqe_data_seg *scatter; + err = mlx4_db_alloc(dev->dev, &srq->db, 0); if (err) goto err_srq; @@ -149,6 +151,11 @@ struct ib_srq *mlx4_ib_create_srq(struct ib_pd *pd, next = get_wqe(srq, i); next->next_wqe_index = cpu_to_be16((i + 1) & (srq->msrq.max - 1)); + + for (scatter = (void *) (next + 1); + (void *) scatter < (void *) next + desc_size; + ++scatter) + scatter->lkey = cpu_to_be32(MLX4_INVALID_LKEY); } err = mlx4_mtt_init(dev->dev, srq->buf.npages, srq->buf.page_shift,