From patchwork Thu Dec 17 15:15:40 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jackm X-Patchwork-Id: 68537 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 nBI4ixux005715 for ; Fri, 18 Dec 2009 04:47:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935803AbZLQPNp (ORCPT ); Thu, 17 Dec 2009 10:13:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S936193AbZLQPNp (ORCPT ); Thu, 17 Dec 2009 10:13:45 -0500 Received: from mail-fx0-f221.google.com ([209.85.220.221]:36837 "EHLO mail-fx0-f221.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935803AbZLQPNo (ORCPT ); Thu, 17 Dec 2009 10:13:44 -0500 Received: by fxm21 with SMTP id 21so1969696fxm.21 for ; Thu, 17 Dec 2009 07:13:43 -0800 (PST) Received: by 10.102.174.11 with SMTP id w11mr210687mue.124.1261062823125; Thu, 17 Dec 2009 07:13:43 -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.41 (version=SSLv3 cipher=RC4-MD5); Thu, 17 Dec 2009 07:13:42 -0800 (PST) From: Jack Morgenstein Organization: Mellanox To: rdreier@cisco.com Subject: [PATCH 1/2] libmlx4: initialize SRQ scatter entries when creating an SRQ Date: Thu, 17 Dec 2009 17:15:40 +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.40630.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/src/srq.c b/src/srq.c index ba2ceb9..f1d1240 100644 --- a/src/srq.c +++ b/src/srq.c @@ -128,6 +128,7 @@ int mlx4_alloc_srq_buf(struct ibv_pd *pd, struct ibv_srq_attr *attr, struct mlx4_srq *srq) { struct mlx4_wqe_srq_next_seg *next; + struct mlx4_wqe_data_seg *scatter; int size; int buf_size; int i; @@ -160,6 +161,11 @@ int mlx4_alloc_srq_buf(struct ibv_pd *pd, struct ibv_srq_attr *attr, for (i = 0; i < srq->max; ++i) { next = get_wqe(srq, i); next->next_wqe_index = htons((i + 1) & (srq->max - 1)); + + for (scatter = (void *) (next + 1); + (void *) scatter < (void *) next + (1 << srq->wqe_shift); + ++scatter) + scatter->lkey = htonl(MLX4_INVALID_LKEY); } srq->head = 0;