From patchwork Mon Oct 18 13:27:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Dillow X-Patchwork-Id: 261881 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 o9IDRcDj027840 for ; Mon, 18 Oct 2010 13:27:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754898Ab0JRN1i (ORCPT ); Mon, 18 Oct 2010 09:27:38 -0400 Received: from emroute3.ornl.gov ([160.91.4.110]:38998 "EHLO emroute3.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754533Ab0JRN1h (ORCPT ); Mon, 18 Oct 2010 09:27:37 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 18 Oct 2010 13:27:38 +0000 (UTC) X-Greylist: delayed 1174 seconds by postgrey-1.27 at vger.kernel.org; Mon, 18 Oct 2010 09:27:37 EDT Received: from emroute3.ornl.gov ([127.0.0.1]) by emroute3.ornl.gov (PMDF V6.5-x1 #31823) with ESMTP id <0LAH007J6MPZ94@emroute3.ornl.gov> for linux-rdma@vger.kernel.org; Mon, 18 Oct 2010 09:27:36 -0400 (EDT) Received: from CONVERSION-DAEMON.emroute3.ornl.gov by emroute3.ornl.gov (PMDF V6.5-x1 #31823) id <0LAH00801MPZHP@emroute3.ornl.gov>; Mon, 18 Oct 2010 09:27:35 -0400 (EDT) Received: from [160.91.210.54] (lap75545.ornl.gov [160.91.210.54]) by emroute3.ornl.gov (PMDF V6.5-x1 #31823) with ESMTP id <0LAH0084JMPZ4Z@emroute3.ornl.gov>; Mon, 18 Oct 2010 09:27:35 -0400 (EDT) Date: Mon, 18 Oct 2010 09:27:35 -0400 From: David Dillow Subject: Re: [PATCH 2/5] IB/srp: implement SRP_CRED_REQ and SRP_AER_REQ In-reply-to: <1287407410.10438.46.camel@lap75545.ornl.gov> To: Bart Van Assche Cc: "rolandd@cisco.com" , "linux-rdma@vger.kernel.org" Message-id: <1287408455.10438.51.camel@lap75545.ornl.gov> Organization: Oak Ridge National Laboratory MIME-version: 1.0 X-Mailer: Evolution 2.30.3 (2.30.3-1.fc13) Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit References: <1287285925-11710-1-git-send-email-dillowda@ornl.gov> <1287285925-11710-3-git-send-email-dillowda@ornl.gov> <1287407410.10438.46.camel@lap75545.ornl.gov> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index cfc1d65..92ced00 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -854,10 +854,13 @@ static struct srp_iu *__srp_get_tx_iu(struct srp_target_port *target, static int __srp_post_send(struct srp_target_port *target, struct srp_iu *iu, int len) { + struct ib_device *dev = target->srp_host->srp_dev->dev; struct ib_sge list; struct ib_send_wr wr, *bad_wr; int ret = 0; + ib_dma_sync_single_for_device(dev, iu->dma, len, DMA_TO_DEVICE); + list.addr = iu->dma; list.length = len; list.lkey = target->srp_host->srp_dev->mr->lkey; @@ -985,9 +988,7 @@ static int srp_response_common(struct srp_target_port *target, s32 req_delta, goto out; } - ib_dma_sync_single_for_cpu(dev, iu->dma, len, DMA_TO_DEVICE); memcpy(iu->buf, rsp, len); - ib_dma_sync_single_for_device(dev, iu->dma, len, DMA_TO_DEVICE); err = __srp_post_send(target, iu, len); if (err) @@ -1130,7 +1131,6 @@ static int srp_queuecommand(struct scsi_cmnd *scmnd, struct srp_request *req; struct srp_iu *iu; struct srp_cmd *cmd; - struct ib_device *dev; int len; if (target->state == SRP_TARGET_CONNECTING) @@ -1147,10 +1147,6 @@ static int srp_queuecommand(struct scsi_cmnd *scmnd, if (!iu) goto err; - dev = target->srp_host->srp_dev->dev; - ib_dma_sync_single_for_cpu(dev, iu->dma, srp_max_iu_len, - DMA_TO_DEVICE); - req = list_first_entry(&target->free_reqs, struct srp_request, list); scmnd->scsi_done = done; @@ -1177,9 +1173,6 @@ static int srp_queuecommand(struct scsi_cmnd *scmnd, goto err; } - ib_dma_sync_single_for_device(dev, iu->dma, srp_max_iu_len, - DMA_TO_DEVICE); - if (__srp_post_send(target, iu, len)) { shost_printk(KERN_ERR, target->scsi_host, PFX "Send failed\n"); goto err_unmap; @@ -1442,7 +1435,6 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event) static int srp_send_tsk_mgmt(struct srp_target_port *target, struct srp_request *req, u8 func) { - struct ib_device *dev = target->srp_host->srp_dev->dev; struct srp_iu *iu; struct srp_tsk_mgmt *tsk_mgmt; @@ -1460,8 +1452,6 @@ static int srp_send_tsk_mgmt(struct srp_target_port *target, if (!iu) goto out; - ib_dma_sync_single_for_cpu(dev, iu->dma, sizeof *tsk_mgmt, - DMA_TO_DEVICE); tsk_mgmt = iu->buf; memset(tsk_mgmt, 0, sizeof *tsk_mgmt); @@ -1471,8 +1461,6 @@ static int srp_send_tsk_mgmt(struct srp_target_port *target, tsk_mgmt->tsk_mgmt_func = func; tsk_mgmt->task_tag = req->index; - ib_dma_sync_single_for_device(dev, iu->dma, sizeof *tsk_mgmt, - DMA_TO_DEVICE); if (__srp_post_send(target, iu, sizeof *tsk_mgmt)) goto out;