From owner-freebsd-stable@FreeBSD.ORG Thu Nov 11 13:28:52 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90E44106566B; Thu, 11 Nov 2010 13:28:52 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id B53498FC08; Thu, 11 Nov 2010 13:28:51 +0000 (UTC) Received: by fxm19 with SMTP id 19so1277894fxm.13 for ; Thu, 11 Nov 2010 05:28:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=yZyM3gleemwPTCnpdko7NZf+EbCOFHP1Uk2zwbC8N44=; b=DR91x+fwCrStGLnv6wxRB3RVyU8cP216qRnN1R0Az5UqXQLRqdaHFTFgrKySZ70RdY B9v9PG0rLOHLoA2H6tCl7t3HbN+SpJqusw7zBVyU4o3OmmJRZuv691253J53HqsDe4V6 xda6Pi6StgjmZ3PXxZlpm45cdl2noV0drsK+k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=OBeNX+ckUDfEF0K2C+NI2OQPDCu89qKyy2WFojEswsJexiR+4dr9xI0fkPv+GeotBR BOEJxdYKYeBOai/BD1wZCUUgqdKbXvFkrKfnl0nXIAIkUAFzq0PUe0Rwq5INcKCdfG+T QzyrCPTgyS7I8neqtrRGx8tgyz8obpbCS1gt0= Received: by 10.204.54.82 with SMTP id p18mr1306551bkg.205.1289482130301; Thu, 11 Nov 2010 05:28:50 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id p22sm926623bkp.21.2010.11.11.05.28.48 (version=SSLv3 cipher=RC4-MD5); Thu, 11 Nov 2010 05:28:49 -0800 (PST) Sender: Alexander Motin Message-ID: <4CDBEF8D.5080001@FreeBSD.org> Date: Thu, 11 Nov 2010 15:28:45 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.24 (X11/20100402) MIME-Version: 1.0 To: Joerg Schilling References: <4CD45209.5010607@FreeBSD.org> <20101105192028.GA68728@alchemy.franken.de> <4cd822df.o/wBtwsNCXiy8xZn%Joerg.Schilling@fokus.fraunhofer.de> <4CD82E2A.3070407@FreeBSD.org> <4cd8320a.U7/OjtLLBVtE4dTy%Joerg.Schilling@fokus.fraunhofer.de> <4CD83535.1010008@FreeBSD.org> <4cdbbfef.v4cr/k2jZr9gdpyF%Joerg.Schilling@fokus.fraunhofer.de> <4CDBC55B.1040307@FreeBSD.org> <4cdbc65f.bo+mYNFB2GPwXmq7%Joerg.Schilling@fokus.fraunhofer.de> <4CDBEA8B.1020306@FreeBSD.org> <4cdbece1.EWYSqdvnx6XWF8EF%Joerg.Schilling@fokus.fraunhofer.de> In-Reply-To: <4cdbece1.EWYSqdvnx6XWF8EF%Joerg.Schilling@fokus.fraunhofer.de> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-scsi@FreeBSD.org, freebsd-current@FreeBSD.org, freebsd-stable@FreeBSD.org, marius@alchemy.franken.de Subject: Re: Sense fetching [Was: cdrtools /devel ...] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 13:28:52 -0000 Joerg Schilling wrote: > Alexander Motin wrote: > >>> Compare the number of sense bytes I like to request (18) with the number >>> previous FreeBSD versions did actually request. It is obvious that in case >>> there is a resid reported onm an old kernel, libscg (with your chanhge) would >>> believe that probably less that the absolute minumum of sense data is available. >> Kernel code I have changed affects only controllers without automatic >> sense fetching. For such controllers CAM previously always reported zero >> sense_resid, independently of requested size (which actually was also >> ignored in this case). So previously whatever you asked for 18 or 32 >> bytes - sense_resid was always zero, like if you got full 18 or 32 >> bytes. That was wrong. Now, in the same situation, if device wants to >> return let's say 20 bytes -- you will get 0 and 12 bytes of sense_resid >> respectively, meaning 18 and 20 bytes of received sense. >> >> AFAIK sense_resid always measured from the requested sense_len. In my >> patch for libscg you may see that I have changed both request and >> response paths. Resulted sense_count should be absolutely the same. > > What is the requested size with the various HBAs in earlier kernels? For HBAs with automatic sense fetching -- as passed in sence_len request field. In case of libscg it was SSD_FULL_SIZE before and I've set it to be real value now. Returned sense_resid should be real in both cases, respecting submitted sense_len. For HBAs without sense fetching, CAM was always requesting SSD_FULL_SIZE and returned fake zero sense_resid, like if it just completely fulfilled sense_len from request. Now it should start honor sense_len on request and return real sense_resid on reply, relative to sense_len. -- Alexander Motin