From 6319b0c72e1681f79a5f33dfa976a63eedd4a2a4 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Thu, 18 Aug 2011 12:28:47 -0700 Subject: 1385 iscsi target drops due to taskq Reviewed by: Jason Brian King Reviewed by: Albert Lee Reviewed by: Dmitry Yusupov Reviewed by: Richard Lowe Approved by: Eric Shrock --- usr/src/uts/common/io/comstar/port/iscsit/iscsit.c | 16 +++++----------- usr/src/uts/common/sys/idm/idm_impl.h | 8 ++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) (limited to 'usr/src') diff --git a/usr/src/uts/common/io/comstar/port/iscsit/iscsit.c b/usr/src/uts/common/io/comstar/port/iscsit/iscsit.c index 4df6327f31..59bdf682e0 100644 --- a/usr/src/uts/common/io/comstar/port/iscsit/iscsit.c +++ b/usr/src/uts/common/io/comstar/port/iscsit/iscsit.c @@ -21,6 +21,9 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + */ #include #include @@ -2165,7 +2168,6 @@ iscsit_post_scsi_cmd(idm_conn_t *ic, idm_pdu_t *rx_pdu) } } -/*ARGSUSED*/ void iscsit_deferred_dispatch(idm_pdu_t *rx_pdu) { @@ -2188,16 +2190,8 @@ iscsit_deferred_dispatch(idm_pdu_t *rx_pdu) iscsit_conn_dispatch_hold(ict); mutex_exit(&ict->ict_mutex); - if (taskq_dispatch(iscsit_global.global_dispatch_taskq, - iscsit_deferred, rx_pdu, DDI_NOSLEEP) == NULL) { - /* - * In the unlikely scenario that we couldn't get the resources - * to dispatch the PDU then just drop it. - */ - idm_pdu_complete(rx_pdu, IDM_STATUS_FAIL); - idm_conn_event(ict->ict_ic, CE_TRANSPORT_FAIL, NULL); - iscsit_conn_dispatch_rele(ict); - } + taskq_dispatch_ent(iscsit_global.global_dispatch_taskq, + iscsit_deferred, rx_pdu, 0, &rx_pdu->isp_tqent); } static void diff --git a/usr/src/uts/common/sys/idm/idm_impl.h b/usr/src/uts/common/sys/idm/idm_impl.h index 11e9534687..72641bbfad 100644 --- a/usr/src/uts/common/sys/idm/idm_impl.h +++ b/usr/src/uts/common/sys/idm/idm_impl.h @@ -21,6 +21,10 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + */ + #ifndef _IDM_IMPL_H_ #define _IDM_IMPL_H_ @@ -30,6 +34,7 @@ extern "C" { #include #include +#include /* * IDM lock order: @@ -373,6 +378,9 @@ typedef struct idm_pdu_s { uint_t isp_hdrbuflen; uint_t isp_databuflen; time_t isp_queue_time; + + /* Taskq dispatching state for deferred PDU */ + taskq_ent_t isp_tqent; } idm_pdu_t; /* -- cgit v1.2.3