All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	open-osd ml <osd-dev@open-osd.org>
Subject: Re: [PATCH 13/16] libosd: SCSI/OSD Sense decoding support
Date: Thu, 29 Jan 2009 09:00:58 -0600	[thread overview]
Message-ID: <1233241258.3257.10.camel@localhost.localdomain> (raw)
In-Reply-To: <498182A8.4020003@panasas.com>

On Thu, 2009-01-29 at 12:19 +0200, Boaz Harrosh wrote:
> James Bottomley wrote:
> > On Sun, 2009-01-25 at 17:15 +0200, Boaz Harrosh wrote:
> >>  
> >> +# CONFIG_SCSI_OSD_DPRINT_SENSE =
> >> +#	0 - no print of errors
> >> +#	1 - print errors
> >> +#	2 - errors + warrnings
> >> +ccflags-y += -DCONFIG_SCSI_OSD_DPRINT_SENSE=1
> > 
> > Why are these all defines not Kconfig variables?
> > 
> 
> They are a "Kconfig variables". What you see above is a section of the 
> Kbuild file that's for the out-of-tree compilation. [ifneq ($(OSD_INC),)]
> For the out-of-tree compilation the Kbuild file defines everything as
> configured in.

OK, let me rephrase the question "what's a file designed for out of tree
compiles doing in-tree?".

> <snip>
> diff --git a/include/scsi/osd_sense.h b/include/scsi/osd_sense.h
> >> new file mode 100644
> >> index 0000000..ff9b33c
> >> --- /dev/null
> >> +++ b/include/scsi/osd_sense.h
> >> @@ -0,0 +1,260 @@
> >> +/*
> >> + * osd_sense.h - OSD Related sense handling definitions.
> >> + *
> >> + * Copyright (C) 2008 Panasas Inc.  All rights reserved.
> >> + *
> >> + * Authors:
> >> + *   Boaz Harrosh <bharrosh@panasas.com>
> >> + *   Benny Halevy <bhalevy@panasas.com>
> >> + *
> >> + * This program is free software; you can redistribute it and/or modify
> >> + * it under the terms of the GNU General Public License version 2
> >> + *
> >> + * This file contains types and constants that are defined by the protocol
> >> + * Note: All names and symbols are taken from the OSD standard's text.
> >> + */
> >> +#ifndef __OSD_SENSE_H__
> >> +#define __OSD_SENSE_H__
> >> 
> <snip>
> >> +	scsi_sense_Reserved_first		= 0x0A,
> >> +	scsi_sense_Reserved_last		= 0x7F,
> >> +	scsi_sense_Vendor_specific_first	= 0x80,
> >> +	scsi_sense_Vendor_specific_last		= 0xFF,
> >> +};
> >> +
> >> +struct scsi_sense_descriptor { /* for picking into desc type */
> >> +	u8	descriptor_type; /* one of enum scsi_descriptor_types */
> >> +	u8	additional_length; /* n - 1 */
> >> +	u8	data[];
> >> +} __packed;
> > 
> > Why is it necessary to do a complete duplication of all the sense header
> > handling and print out in include/scsi/scsi_eh.h and
> > drivers/scsi/constants.c ... can't these two frameworks be integrated?
> > 
> 
> I have tried. 
> Some of this stuff is new and exclusive to OSD so the file is needed.
> The rest is buried in constants.c while I need them in an header file.
> If it is accepted by you to take some of constants.c and put them in an
> header then, sure I can do that. Refactor some of above stuff and constants.c
> stuff into an scsi_sense.h file and use them at both places.
> (I will send an RFC after things settle a bit)

That's what I'd prefer to see, yes.  The linux tradition is that if a
particular piece of code, which was designed for use in X could be used
in Y, we don't duplicate it for Y, we redesign it so it can be used in
both X and Y ... that's how we keep the kernel clean and neat.   Of
course, if you're really lucky, the X user already figured out a more
generic framework and it's a simple matter to reuse it.  I'm afraid it's
a bit more work in this case.

> Other then that, the source of the osd_req_decode_sense() is totally new to
> osd. An osd target returns very detailed, variable length, sense information
> that denotes exactly what field of the CDB and/or buffer-data failed it's checks
> as well as details on other failures and conditions. Also later we will support
> security signatures of sense data.

But this is all just an extension of the basic SAM defined sense format.

James



  reply	other threads:[~2009-01-29 15:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-25 14:46 [PATCHSET 00/16] open-osd: OSD Initiator library for 2.6.30 Boaz Harrosh
2009-01-25 14:50 ` [PATCH 01/16] major.h: char-major number for OSD device driver Boaz Harrosh
2009-01-25 14:51 ` [PATCH 02/16] scsi: OSD_TYPE Boaz Harrosh
2009-01-25 14:54 ` [PATCH 03/16] libosd: OSDv1 Headers Boaz Harrosh
2009-01-25 14:55 ` [PATCH 04/16] libosd: OSDv1 preliminary implementation Boaz Harrosh
2009-01-25 14:56 ` [PATCH 05/16] osd_uld: OSD scsi ULD Boaz Harrosh
2009-01-25 14:58 ` [PATCH 06/16] osd_uld: API for retrieving osd devices from Kernel Boaz Harrosh
2009-01-28 16:32   ` James Bottomley
2009-01-29 11:12     ` Boaz Harrosh
2009-01-25 14:59 ` [PATCH 07/16] libosd: attributes Support Boaz Harrosh
2009-01-25 15:03 ` [PATCH 08/16] libosd: OSD Security processing stubs Boaz Harrosh
2009-01-25 15:05 ` [PATCH 09/16] libosd: Add Flush and List-objects support Boaz Harrosh
2009-01-25 15:07 ` [PATCH 10/16] libosd: Not implemented commands Boaz Harrosh
2009-01-25 15:09 ` [PATCH 11/16] libosd: OSD version 2 Support Boaz Harrosh
2009-01-25 15:13 ` [PATCH 12/16] libosd: OSDv2 auto detection Boaz Harrosh
2009-01-25 15:15 ` [PATCH 13/16] libosd: SCSI/OSD Sense decoding support Boaz Harrosh
2009-01-28 16:32   ` James Bottomley
2009-01-29 10:19     ` Boaz Harrosh
2009-01-29 15:00       ` James Bottomley [this message]
2009-01-29 16:33         ` Boaz Harrosh
2009-01-25 15:21 ` [PATCH 14/16] osd: Documentation for OSD library Boaz Harrosh
2009-01-25 15:22 ` [PATCH 15/16] osd: Kconfig file for in-tree builds Boaz Harrosh
2009-01-25 15:24 ` [PATCH 16/16] scsi: Add osd library to build system Boaz Harrosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1233241258.3257.10.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=bharrosh@panasas.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=osd-dev@open-osd.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.