Date: Wed, 23 Nov 2005 03:16:15 -0800 From: Ade Lovett <ade@freebsd.org> To: lydianconcepts@gmail.com Cc: freebsd-scsi@freebsd.org Subject: Re: CAM tags / reset problem Message-ID: <C4D06303-21F6-4F6B-8EE7-10A1FE79D248@freebsd.org> In-Reply-To: <7579f7fb0509182239187fb73c@mail.gmail.com> References: <3A1FD217-5880-4845-9F64-5DD9395D1C6D@FreeBSD.org> <7579f7fb0509182239187fb73c@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Any further thoughts on this, chaps? Unless anyone objects strenuously, I'd like to go ahead and commit this to HEAD, give it a month or so to settle in, and then MFC to both RELENG_6 and RELENG_5. -aDe On Sep 18, 2005, at 22:39 , Matthew Jacob wrote: > I'll let Nate or Ken or Justin comment. > > On 9/17/05, Ade Lovett <ade@freebsd.org> wrote: >> >> 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 = 1, which >> is less than the mintags = 2 setting, even though tag queueing is >> supposedly enabled. Performance is impaired as a result. >> >> 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: >> >> 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). >> >> 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. >> >> 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. >> >> The fix seems to be to clear CAM_DEV_TAG_AFTER_COUNT _before_ >> resizing >> the queue, as per the following patch: >> >> http://people.FreeBSD.org/~ade/sys-dev-cam-xpt.c >> >> 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) >> >> -aDe >> >> _______________________________________________ >> 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" >> > _______________________________________________ > 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?C4D06303-21F6-4F6B-8EE7-10A1FE79D248>
