From owner-freebsd-scsi@FreeBSD.ORG Tue Mar 4 09:05:15 2008 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35CCA1065670 for ; Tue, 4 Mar 2008 09:05:15 +0000 (UTC) (envelope-from thomas.rasmussen@siminn.dk) Received: from smtp.webpartner.dk (smtp.webpartner.dk [195.184.96.12]) by mx1.freebsd.org (Postfix) with ESMTP id CB8828FC23 for ; Tue, 4 Mar 2008 09:05:14 +0000 (UTC) (envelope-from thomas.rasmussen@siminn.dk) Received: from wp-ex02.hq.webpartner.dk (fw.int.webpartner.dk [213.150.34.98]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by smtp.webpartner.dk (Postfix) with ESMTP id 69F3A93BFC6; Tue, 4 Mar 2008 09:47:29 +0100 (CET) Received: from wp-ex02.hq.webpartner.dk ([10.32.62.19]) by wp-ex02.hq.webpartner.dk ([10.32.62.19]) with mapi; Tue, 4 Mar 2008 09:46:16 +0100 From: Thomas Steen Rasmussen To: Pierre Beyssac Date: Tue, 4 Mar 2008 09:46:15 +0100 Thread-Topic: iscsi initiator speed very low in FreeBSD 7 Thread-Index: Ach5QjLqbZSqoStfSXGWLrLathWWvgEkMuJw Message-ID: <4A66E92B3FBF8541A78CD11D1C0E3CFC491D952199@wp-ex02.hq.webpartner.dk> References: <4A66E92B3FBF8541A78CD11D1C0E3CFC491D952009@wp-ex02.hq.webpartner.dk> <20080226155813.GD75747@bofh.enst.fr> <20080226160527.GE75747@bofh.enst.fr> <20080227125033.GA35933@bofh.enst.fr> In-Reply-To: <20080227125033.GA35933@bofh.enst.fr> Accept-Language: da-DK, en-US Content-Language: da-DK X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: da-DK, en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "freebsd-scsi@freebsd.org" Subject: SV: iscsi initiator speed very low in FreeBSD 7 X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2008 09:05:15 -0000 Hello The patch works! :) I had some problems getting it to apply cleanly, due to a (junk?) character in the source file (the file being patched) line= 456. Once I got it applied to a fresh 7 install the speed was considerably bette= r. In my test setup I got to around 20 megabytes / sec to or from my laptop in= itiator. I now need to test the production server with the actual appliance SAN, and see what kind of speeds I get there. I will revert with the results her= e. Until then, thank you very much for your assistance. Med venlig hilsen / Kind regards Thomas Steen Rasmussen Sikkerheds- & Unix-administrator Siminn -----Oprindelig meddelelse----- Fra: owner-freebsd-scsi@freebsd.org [mailto:owner-freebsd-scsi@freebsd.org]= P=E5 vegne af Pierre Beyssac Sendt: 27. februar 2008 13:51 Til: Ivan Voras Cc: freebsd-scsi@freebsd.org Emne: Re: iscsi initiator speed very low in FreeBSD 7 On Wed, Feb 27, 2008 at 01:45:35PM +0100, Ivan Voras wrote: > > Better with the patch... :-) > I think you need to send a file with a .txt extension for it to pass the > spam / list filters. Here it is inline... --- isc_sm.c 2007-07-24 17:35:02.000000000 +0200 +++ /tmp/isc_sm.c 2008-02-26 16:53:54.000000000 +0100 @@ -325,7 +325,9 @@ mtx_unlock(&sp->io_mtx); // XXX } #else + mtx_lock(&sp->io_mtx); // XXX wakeup(&sp->flags); + mtx_unlock(&sp->io_mtx); // XXX #endif return error; } @@ -454,6 +456,11 @@ } } +/* + * Should be called with sp->io_mtx held to avoid race condition + * on queue empty. + * Returns with sp->io_mtx held. + */ static int proc_out(isc_session_t *sp) { @@ -481,6 +488,8 @@ if((pq =3D i_dqueue_snd(sp, which)) =3D=3D NULL) break; + mtx_unlock(&sp->io_mtx); + pp =3D &pq->pdu; bhs =3D &pp->ipdu.bhs; switch(bhs->opcode) { @@ -523,6 +532,8 @@ xdebug("error=3D%d ndone=3D%d opcode=3D0x%x ccb=3D%p itt=3D%= x", error, ndone, bhs->opcode, pq->ccb, ntohl(bhs->itt)); if(error =3D=3D EPIPE) { + pdu_free(sp->isc, pq); + mtx_lock(&sp->io_mtx); // XXX: better do some error recovery ... break; } @@ -540,6 +551,7 @@ } if(pq->ccb =3D=3D NULL || error) pdu_free(sp->isc, pq); + mtx_lock(&sp->io_mtx); } return ndone; } @@ -558,13 +570,13 @@ sp->flags |=3D ISC_SM_RUNNING; do { + mtx_lock(&sp->io_mtx); if(sp->flags & ISC_SM_HOLD) odone =3D 0; else odone =3D proc_out(sp); sdebug(7, "odone=3D%d", odone); if(odone =3D=3D 0) { - mtx_lock(&sp->io_mtx); #ifdef ISC_OWAITING sp->flags |=3D ISC_OWAITING; #endif @@ -574,8 +586,8 @@ #ifdef ISC_OWAITING sp->flags &=3D ~ISC_OWAITING; #endif - mtx_unlock(&sp->io_mtx); } + mtx_unlock(&sp->io_mtx); } while(sp->flags & ISC_SM_RUN); sp->flags &=3D ~ISC_SM_RUNNING; -- A: Yes. Pierre Beyssac pb@enst.fr >Q: Are you sure? >>A: Because it reverses the logical flow of conversation. >>>Q: Why is top posting annoying in email? _______________________________________________ freebsd-scsi@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-scsi To unsubscribe, send any mail to "freebsd-scsi-unsubscribe@freebsd.org"