From patchwork Wed Feb 3 15:40:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Or Gerlitz X-Patchwork-Id: 76724 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o13FbR3k014192 for ; Wed, 3 Feb 2010 15:40:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932345Ab0BCPkb (ORCPT ); Wed, 3 Feb 2010 10:40:31 -0500 Received: from fwil.voltaire.com ([193.47.165.2]:33583 "EHLO exil.voltaire.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932306Ab0BCPkb (ORCPT ); Wed, 3 Feb 2010 10:40:31 -0500 Received: from zuben.voltaire.com ([172.25.5.15]) by exil.voltaire.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 3 Feb 2010 17:40:28 +0200 Date: Wed, 3 Feb 2010 17:40:42 +0200 (IST) From: Or Gerlitz To: Roland Dreier cc: linux-rdma , Mike Christie Subject: [PATCH 07/9] ib/iser: remove unnecessary connection checks In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-OriginalArrivalTime: 03 Feb 2010 15:40:28.0576 (UTC) FILETIME=[361D2200:01CAA4E7] 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 (demeter.kernel.org [140.211.167.41]); Wed, 03 Feb 2010 15:40:32 +0000 (UTC) Index: linux-2.6.33-rc4/drivers/infiniband/ulp/iser/iser_initiator.c =================================================================== --- linux-2.6.33-rc4.orig/drivers/infiniband/ulp/iser/iser_initiator.c +++ linux-2.6.33-rc4/drivers/infiniband/ulp/iser/iser_initiator.c @@ -260,20 +260,6 @@ int iser_conn_set_full_featured_mode(str return 0; } -static int -iser_check_xmit(struct iscsi_conn *conn, void *task) -{ - struct iscsi_iser_conn *iser_conn = conn->dd_data; - - if (atomic_read(&iser_conn->ib_conn->post_send_buf_count) == - ISER_QP_MAX_REQ_DTOS) { - iser_dbg("%ld can't xmit task %p\n",jiffies,task); - return -ENOBUFS; - } - return 0; -} - - /** * iser_send_command - send command PDU */ @@ -289,13 +275,6 @@ int iser_send_command(struct iscsi_conn struct scsi_cmnd *sc = task->sc; struct iser_tx_desc *tx_desc = &iser_task->desc; - if (!iser_conn_state_comp(iser_conn->ib_conn, ISER_CONN_UP)) { - iser_err("Failed to send, conn: 0x%p is not up\n", iser_conn->ib_conn); - return -EPERM; - } - if (iser_check_xmit(conn, task)) - return -ENOBUFS; - edtl = ntohl(hdr->data_length); /* build the tx desc regd header and add it to the tx desc dto */ @@ -357,15 +336,6 @@ int iser_send_data_out(struct iscsi_conn int err = 0; struct ib_sge *tx_dsg; - - if (!iser_conn_state_comp(iser_conn->ib_conn, ISER_CONN_UP)) { - iser_err("Failed to send, conn: 0x%p is not up\n", iser_conn->ib_conn); - return -EPERM; - } - - if (iser_check_xmit(conn, task)) - return -ENOBUFS; - itt = (__force uint32_t)hdr->itt; data_seg_len = ntoh24(hdr->dlength); buf_offset = ntohl(hdr->offset); @@ -425,14 +395,6 @@ int iser_send_control(struct iscsi_conn int err = 0; struct iser_device *device; - if (!iser_conn_state_comp(iser_conn->ib_conn, ISER_CONN_UP)) { - iser_err("Failed to send, conn: 0x%p is not up\n", iser_conn->ib_conn); - return -EPERM; - } - - if (iser_check_xmit(conn, task)) - return -ENOBUFS; - /* build the tx desc regd header and add it to the tx desc dto */ mdesc->type = ISCSI_TX_CONTROL; iser_create_send_desc(iser_conn->ib_conn, mdesc); Index: linux-2.6.33-rc4/drivers/infiniband/ulp/iser/iscsi_iser.h =================================================================== --- linux-2.6.33-rc4.orig/drivers/infiniband/ulp/iser/iscsi_iser.h +++ linux-2.6.33-rc4/drivers/infiniband/ulp/iser/iscsi_iser.h @@ -357,9 +357,6 @@ int iser_post_recvl(struct iser_conn *i int iser_post_recvm(struct iser_conn *ib_conn, int count); int iser_post_send(struct iser_conn *ib_conn, struct iser_tx_desc *tx_desc); -int iser_conn_state_comp(struct iser_conn *ib_conn, - enum iser_ib_conn_state comp); - int iser_dma_map_task_data(struct iscsi_iser_task *iser_task, struct iser_data_buf *data, enum iser_data_dir iser_dir, Index: linux-2.6.33-rc4/drivers/infiniband/ulp/iser/iser_verbs.c =================================================================== --- linux-2.6.33-rc4.orig/drivers/infiniband/ulp/iser/iser_verbs.c +++ linux-2.6.33-rc4/drivers/infiniband/ulp/iser/iser_verbs.c @@ -300,17 +300,6 @@ static void iser_device_try_release(stru mutex_unlock(&ig.device_list_mutex); } -int iser_conn_state_comp(struct iser_conn *ib_conn, - enum iser_ib_conn_state comp) -{ - int ret; - - spin_lock_bh(&ib_conn->lock); - ret = (ib_conn->state == comp); - spin_unlock_bh(&ib_conn->lock); - return ret; -} - static int iser_conn_state_comp_exch(struct iser_conn *ib_conn, enum iser_ib_conn_state comp, enum iser_ib_conn_state exch)