aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorOr Gerlitz <ogerlitz@voltaire.com>2010-02-08 08:21:18 -0500
committerRoland Dreier <rolandd@cisco.com>2010-02-24 12:41:13 -0500
commitaae3c995ff74a183d15207436d383942485b2edd (patch)
tree219ed74a75507cf592398fff677840e69a74098e /drivers/infiniband
parent528f4e8c8341706a354ff96daf615e678e9b296f (diff)
IB/iser: Remove unnecessary connection checks
Remove unnecessary checks for the IB connection state and for QP overflow, as conn state changes are reported by iSER to libiscsi and handled there. QP overflow is theoretically possible only when unsolicited data-outs are used; anyway it's being checked and handled by HW drivers. Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/iser/iscsi_iser.h3
-rw-r--r--drivers/infiniband/ulp/iser/iser_initiator.c38
-rw-r--r--drivers/infiniband/ulp/iser/iser_verbs.c11
3 files changed, 0 insertions, 52 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h
index 269f23f1b6d1..036934cdcb92 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.h
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.h
@@ -357,9 +357,6 @@ int iser_post_recvl(struct iser_conn *ib_conn);
357int iser_post_recvm(struct iser_conn *ib_conn, int count); 357int iser_post_recvm(struct iser_conn *ib_conn, int count);
358int iser_post_send(struct iser_conn *ib_conn, struct iser_tx_desc *tx_desc); 358int iser_post_send(struct iser_conn *ib_conn, struct iser_tx_desc *tx_desc);
359 359
360int iser_conn_state_comp(struct iser_conn *ib_conn,
361 enum iser_ib_conn_state comp);
362
363int iser_dma_map_task_data(struct iscsi_iser_task *iser_task, 360int iser_dma_map_task_data(struct iscsi_iser_task *iser_task,
364 struct iser_data_buf *data, 361 struct iser_data_buf *data,
365 enum iser_data_dir iser_dir, 362 enum iser_data_dir iser_dir,
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index e27eb8757650..27450eebd1e4 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -260,20 +260,6 @@ int iser_conn_set_full_featured_mode(struct iscsi_conn *conn)
260 return 0; 260 return 0;
261} 261}
262 262
263static int
264iser_check_xmit(struct iscsi_conn *conn, void *task)
265{
266 struct iscsi_iser_conn *iser_conn = conn->dd_data;
267
268 if (atomic_read(&iser_conn->ib_conn->post_send_buf_count) ==
269 ISER_QP_MAX_REQ_DTOS) {
270 iser_dbg("%ld can't xmit task %p\n",jiffies,task);
271 return -ENOBUFS;
272 }
273 return 0;
274}
275
276
277/** 263/**
278 * iser_send_command - send command PDU 264 * iser_send_command - send command PDU
279 */ 265 */
@@ -289,13 +275,6 @@ int iser_send_command(struct iscsi_conn *conn,
289 struct scsi_cmnd *sc = task->sc; 275 struct scsi_cmnd *sc = task->sc;
290 struct iser_tx_desc *tx_desc = &iser_task->desc; 276 struct iser_tx_desc *tx_desc = &iser_task->desc;
291 277
292 if (!iser_conn_state_comp(iser_conn->ib_conn, ISER_CONN_UP)) {
293 iser_err("Failed to send, conn: 0x%p is not up\n", iser_conn->ib_conn);
294 return -EPERM;
295 }
296 if (iser_check_xmit(conn, task))
297 return -ENOBUFS;
298
299 edtl = ntohl(hdr->data_length); 278 edtl = ntohl(hdr->data_length);
300 279
301 /* build the tx desc regd header and add it to the tx desc dto */ 280 /* 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 *conn,
357 int err = 0; 336 int err = 0;
358 struct ib_sge *tx_dsg; 337 struct ib_sge *tx_dsg;
359 338
360
361 if (!iser_conn_state_comp(iser_conn->ib_conn, ISER_CONN_UP)) {
362 iser_err("Failed to send, conn: 0x%p is not up\n", iser_conn->ib_conn);
363 return -EPERM;
364 }
365
366 if (iser_check_xmit(conn, task))
367 return -ENOBUFS;
368
369 itt = (__force uint32_t)hdr->itt; 339 itt = (__force uint32_t)hdr->itt;
370 data_seg_len = ntoh24(hdr->dlength); 340 data_seg_len = ntoh24(hdr->dlength);
371 buf_offset = ntohl(hdr->offset); 341 buf_offset = ntohl(hdr->offset);
@@ -425,14 +395,6 @@ int iser_send_control(struct iscsi_conn *conn,
425 int err = 0; 395 int err = 0;
426 struct iser_device *device; 396 struct iser_device *device;
427 397
428 if (!iser_conn_state_comp(iser_conn->ib_conn, ISER_CONN_UP)) {
429 iser_err("Failed to send, conn: 0x%p is not up\n", iser_conn->ib_conn);
430 return -EPERM;
431 }
432
433 if (iser_check_xmit(conn, task))
434 return -ENOBUFS;
435
436 /* build the tx desc regd header and add it to the tx desc dto */ 398 /* build the tx desc regd header and add it to the tx desc dto */
437 mdesc->type = ISCSI_TX_CONTROL; 399 mdesc->type = ISCSI_TX_CONTROL;
438 iser_create_send_desc(iser_conn->ib_conn, mdesc); 400 iser_create_send_desc(iser_conn->ib_conn, mdesc);
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 18cf65f092e8..308d17bb5146 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -300,17 +300,6 @@ static void iser_device_try_release(struct iser_device *device)
300 mutex_unlock(&ig.device_list_mutex); 300 mutex_unlock(&ig.device_list_mutex);
301} 301}
302 302
303int iser_conn_state_comp(struct iser_conn *ib_conn,
304 enum iser_ib_conn_state comp)
305{
306 int ret;
307
308 spin_lock_bh(&ib_conn->lock);
309 ret = (ib_conn->state == comp);
310 spin_unlock_bh(&ib_conn->lock);
311 return ret;
312}
313
314static int iser_conn_state_comp_exch(struct iser_conn *ib_conn, 303static int iser_conn_state_comp_exch(struct iser_conn *ib_conn,
315 enum iser_ib_conn_state comp, 304 enum iser_ib_conn_state comp,
316 enum iser_ib_conn_state exch) 305 enum iser_ib_conn_state exch)