From patchwork Sun Oct 17 03:25:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Dillow X-Patchwork-Id: 259631 X-Patchwork-Delegate: dave@thedillows.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9H3pqZc015613 for ; Sun, 17 Oct 2010 03:51:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752192Ab0JQDvx (ORCPT ); Sat, 16 Oct 2010 23:51:53 -0400 Received: from amavis-smtp.knology.net ([75.76.199.6]:36518 "EHLO amavis-smtp.knology.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752719Ab0JQDvu (ORCPT ); Sat, 16 Oct 2010 23:51:50 -0400 Received: from localhost (amavis-smtp [127.0.0.1]) by amavis-smtp.knology.net (Postfix) with ESMTP id BB9C588AC4; Sat, 16 Oct 2010 23:25:24 -0400 (EDT) Received: from smtp12.knology.net ([75.76.199.9]) by localhost (amavis-smtp.knology.net [75.76.199.6]) (amavisd-new, port 10024) with LMTP id jonVfbcJvym3; Sat, 16 Oct 2010 23:25:24 -0400 (EDT) Received: from shed.thedillows.org (unknown [207.98.218.89]) by smtp12.knology.net (Postfix) with ESMTP id 83AA65200057; Sat, 16 Oct 2010 23:25:01 -0400 (EDT) Received: from shed.thedillows.org (localhost.localdomain [127.0.0.1]) by shed.thedillows.org (8.14.4/8.14.4) with ESMTP id o9H3PQR3011758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 16 Oct 2010 23:25:26 -0400 Received: (from dad@localhost) by shed.thedillows.org (8.14.4/8.14.4/Submit) id o9H3PQfx011757; Sat, 16 Oct 2010 23:25:26 -0400 X-Authentication-Warning: shed.thedillows.org: dad set sender to dave@thedillows.org using -f From: David Dillow To: rolandd@cisco.com Cc: linux-rdma@vger.kernel.org, bart.vanassche@gmail.com Subject: [PATCH 4/5] IB/srp: Reduce number of BUSY conditions Date: Sat, 16 Oct 2010 23:25:24 -0400 Message-Id: <1287285925-11710-5-git-send-email-dillowda@ornl.gov> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1287285925-11710-1-git-send-email-dillowda@ornl.gov> References: <1287285925-11710-1-git-send-email-dillowda@ornl.gov> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 17 Oct 2010 03:51:53 +0000 (UTC) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index d4c08d6..4df8275 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1339,8 +1339,13 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event) target->max_ti_iu_len = be32_to_cpu(rsp->max_ti_iu_len); target->req_lim = be32_to_cpu(rsp->req_lim_delta); - target->scsi_host->can_queue = min(target->req_lim, - target->scsi_host->can_queue); + /* + * Reserve credits for task management so we don't + * bounce requests back to the SCSI mid-layer. + */ + target->scsi_host->can_queue + = min(target->req_lim - SRP_TSK_MGMT_SQ_SIZE, + target->scsi_host->can_queue); } else { shost_printk(KERN_WARNING, target->scsi_host, PFX "Unhandled RSP opcode %#x\n", opcode);