Date: Sun, 18 Sep 2005 22:39:35 -0700 From: Matthew Jacob <lydianconcepts@gmail.com> To: Ade Lovett <ade@freebsd.org> Cc: freebsd-scsi@freebsd.org Subject: Re: CAM tags / reset problem Message-ID: <7579f7fb0509182239187fb73c@mail.gmail.com> In-Reply-To: <3A1FD217-5880-4845-9F64-5DD9395D1C6D@FreeBSD.org> References: <3A1FD217-5880-4845-9F64-5DD9395D1C6D@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
I'll let Nate or Ken or Justin comment. On 9/17/05, Ade Lovett <ade@freebsd.org> wrote:=20 >=20 > The observed behaviour is this: there is a bus reset during device > probing / negotiation during boot, and after the system is up many of > the scsi devices are found to be running with dev_openings =3D 1, which > is less than the mintags =3D 2 setting, even though tag queueing is > supposedly enabled. Performance is impaired as a result. >=20 > The cause appears to be as follows: in cam_xpt.c, the routine > xpt_dev_ccbq_resize saves, in dev->tag_saved_openings, the requested > queue size _if and only if_ tag queueing is either enabled (SID_CmdQue > is set) or is _scheduled_ to be enabled (CAM_DEV_TAG_AFTER_COUNT is > set). However, the following sequence can occur: >=20 > 1) Device transfer settings are negotiated. The device can support > tags, so CAM_DEV_TAG_AFTER_COUNT is set (tag queueing is _not_ > immediately enabled). >=20 > 2) Before enough commands have been sent to cause tag queueing to be > started, the bus is reset and all transfer settings are reset. This > results in xpt_set_transfer_settings being called, and in turn this > clears SID_CmdQue and calls xpt_dev_ccbq_resize (to resize the queue > down to its non-tagged size, typically 1), and only then clears > CAM_DEV_TAG_AFTER_COUNT (which was of course set) and its associated > count. This causes xpt_dev_ccbq_resize to save the requested queue > size even though it does not relate to the desired size with tag > queueing enabled. >=20 > 3) If tag-queueing is enabled again, e.g. after another negotiation, > then the saved value (1) of tag_saved_openings is used rather than > the correct value. >=20 > The fix seems to be to clear CAM_DEV_TAG_AFTER_COUNT _before_ resizing > the queue, as per the following patch: >=20 > http://people.FreeBSD.org/~ade/sys-dev-cam-xpt.c >=20 > I'd like permission to commit this to HEAD, followed by a relatively > quick MFC to RELENG_6 (I know I've missed BETA5, but would like to > get it into -RELEASE) >=20 > -aDe >=20 > _______________________________________________ > 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" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7579f7fb0509182239187fb73c>