From patchwork Wed Dec 9 22:42:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faisal Latif X-Patchwork-Id: 66116 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB9MhJdD024825 for ; Wed, 9 Dec 2009 22:43:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758545AbZLIWmg (ORCPT ); Wed, 9 Dec 2009 17:42:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758541AbZLIWmf (ORCPT ); Wed, 9 Dec 2009 17:42:35 -0500 Received: from mga02.intel.com ([134.134.136.20]:11982 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758550AbZLIWmY (ORCPT ); Wed, 9 Dec 2009 17:42:24 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 09 Dec 2009 14:41:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,370,1257148800"; d="scan'208";a="577240571" Received: from flatif-mobl.amr.corp.intel.com (HELO ctung-MOBL.intel.com) ([10.232.237.209]) by orsmga001.jf.intel.com with SMTP; 09 Dec 2009 14:42:13 -0800 Received: by ctung-MOBL.intel.com (sSMTP sendmail emulation); Wed, 09 Dec 2009 16:42:32 -0600 Date: Wed, 9 Dec 2009 16:42:31 -0600 From: Faisal Latif To: Roland Dreier Cc: linux-rdma@vger.kernel.org Subject: [PATCH 08/11] RDMA/nes: check for zero stag Message-ID: <20091209224231.GA124820@flatif-MOBL> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.2i 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/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c index 9fc0273..b1c2cbb 100644 --- a/drivers/infiniband/hw/nes/nes_hw.c +++ b/drivers/infiniband/hw/nes/nes_hw.c @@ -437,11 +437,12 @@ struct nes_adapter *nes_init_adapter(struct nes_device *nesdev, u8 hw_rev) { nesadapter->qp_table = (struct nes_qp **)(&nesadapter->allocated_arps[BITS_TO_LONGS(arp_table_size)]); - /* mark the usual suspect QPs and CQs as in use */ + /* mark the usual suspect QPs, MR and CQs as in use */ for (u32temp = 0; u32temp < NES_FIRST_QPN; u32temp++) { set_bit(u32temp, nesadapter->allocated_qps); set_bit(u32temp, nesadapter->allocated_cqs); } + set_bit(0, nesadapter->allocated_mrs); for (u32temp = 0; u32temp < 20; u32temp++) set_bit(u32temp, nesadapter->allocated_pds); diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 0e3eee2..de53e88 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c @@ -2503,9 +2503,6 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, stag = stag_index << 8; stag |= driver_key; stag += (u32)stag_key; - if (stag == 0) { - stag = 1; - } iova_start = virt; /* Make the leaf PBL the root if only one PBL */