All of lore.kernel.org
 help / color / mirror / Atom feed
* sg version 4 tools
@ 2007-02-15  1:39 FUJITA Tomonori
  2007-02-15 16:25 ` Douglas Gilbert
  0 siblings, 1 reply; 4+ messages in thread
From: FUJITA Tomonori @ 2007-02-15  1:39 UTC (permalink / raw)
  To: linux-scsi

I created a git tree for makeshift sg version 4 tools:

http://www.kernel.org/git/?p=linux/kernel/git/tomo/sgv4-tools.git;a=summary

# not synchronized yet.

The interface has changed continuously (and will do). After mainline
inclusion, Doug's sg tools support sg v4, I think. Until then, I put
tools that I use for sg v4 development.

Currently, there is only one tool, sgv4_dd, which can read/write
from/to a device via the bsg interface (both ioctl and the read/write
interfaces are supported).

Here are some examples:

# ./sgv4_dd -i /dev/sdb -o /dev/null --count 2
succeeded (read/write interface)

# ./sgv4_dd -i /dev/sdb -o /dev/null --count 2 --sgio
succeeded (SG_IO)

# ./sgv4_dd -i /dev/zero -o /dev/sdb --count 3 --sgio
succeeded (SG_IO)

# ./sgv4_dd -i /dev/zero -o /dev/sdb --count 3
succeeded (read/write interface)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: sg version 4 tools
  2007-02-15  1:39 sg version 4 tools FUJITA Tomonori
@ 2007-02-15 16:25 ` Douglas Gilbert
  2007-02-15 16:58   ` FUJITA Tomonori
  0 siblings, 1 reply; 4+ messages in thread
From: Douglas Gilbert @ 2007-02-15 16:25 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: linux-scsi

FUJITA Tomonori wrote:
> I created a git tree for makeshift sg version 4 tools:
> 
> http://www.kernel.org/git/?p=linux/kernel/git/tomo/sgv4-tools.git;a=summary
> 
> # not synchronized yet.
> 
> The interface has changed continuously (and will do). After mainline
> inclusion, Doug's sg tools support sg v4, I think. Until then, I put
> tools that I use for sg v4 development.
> 
> Currently, there is only one tool, sgv4_dd, which can read/write
> from/to a device via the bsg interface (both ioctl and the read/write
> interfaces are supported).
> 
> Here are some examples:
> 
> # ./sgv4_dd -i /dev/sdb -o /dev/null --count 2
> succeeded (read/write interface)
> 
> # ./sgv4_dd -i /dev/sdb -o /dev/null --count 2 --sgio
> succeeded (SG_IO)
> 
> # ./sgv4_dd -i /dev/zero -o /dev/sdb --count 3 --sgio
> succeeded (SG_IO)
> 
> # ./sgv4_dd -i /dev/zero -o /dev/sdb --count 3
> succeeded (read/write interface)

Tomo,
Just a few points.

While the sgv4_dd command line interface (cli) looks
sensible, it diverges from the dd command (which is
non-unix like but reasonably "fit for service" for the
function that dd performs). So even though the Unix dd
command syntax takes a while to get used to, other testers
will be most likely to be comfortable with existing dd syntax.


Of the 41 utilities in (the main directory of) sg3_utils,
29 are ported to FreeBSD and Windows. This is done by
putting a generic pass-through layer between those 29
utilities and the OS specific pass-throughs ***. The
remaining 12 utilities are either:
  a) linux specific (e.g. sg_reset and sg_map26)
  b) or a bit too complicated due to other system
     calls (e.g. sg_dd) to convert
  c) both a) and b) (e.g. sgm_dd)
The generic pass through layer is defined with bi-directional
in mind.

It also should be relatively easy to allow for two linux
specific pass-throughs (i.e. sgv3 and sgv4) so that
the common 29 utilities "just work" on either pass-through
(by compile or run time switch).


In summary, I don't think that there needs to be a
sg4_utils. As you suggest, sgv4_dd can be incorporated
into the existing sg3_utils at a convenient time.
sg v4 represents an alternate interface for a linux
pass-through and the bulk of sg3_utils already supports
4 pass-throughs via a common code base. [The four are
linux (sg v3), FreeBSD, Tru64, Windows (from NT forward).]


*** smartmontools takes the same approach and it supports
    several pass-thoughs for Windows.

Doug Gilbert




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: sg version 4 tools
  2007-02-15 16:25 ` Douglas Gilbert
@ 2007-02-15 16:58   ` FUJITA Tomonori
  2007-02-15 22:47     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: FUJITA Tomonori @ 2007-02-15 16:58 UTC (permalink / raw)
  To: dougg; +Cc: fujita.tomonori, linux-scsi

From: Douglas Gilbert <dougg@torque.net>
Subject: Re: sg version 4 tools
Date: Thu, 15 Feb 2007 08:25:52 -0800

> FUJITA Tomonori wrote:
> > I created a git tree for makeshift sg version 4 tools:
> > 
> > http://www.kernel.org/git/?p=linux/kernel/git/tomo/sgv4-tools.git;a=summary

(snip)

> Tomo,
> Just a few points.
> 
> While the sgv4_dd command line interface (cli) looks
> sensible, it diverges from the dd command (which is
> non-unix like but reasonably "fit for service" for the
> function that dd performs). So even though the Unix dd
> command syntax takes a while to get used to, other testers
> will be most likely to be comfortable with existing dd syntax.

Yeah, probably. Patches are always welcome. :) It's just a simple tool
that I've used for development.


> In summary, I don't think that there needs to be a
> sg4_utils. As you suggest, sgv4_dd can be incorporated
> into the existing sg3_utils at a convenient time.
> sg v4 represents an alternate interface for a linux
> pass-through and the bulk of sg3_utils already supports
> 4 pass-throughs via a common code base. [The four are
> linux (sg v3), FreeBSD, Tru64, Windows (from NT forward).]

Agreed. Surely, I don't want to maintain sgv4_utils. I'm thinking
about keeping it until we finish some experiments on sgv4 interface
(like ring buffer).

If you add sgv4 support to sg3_utils now, I'm happy to remove the git
tree. :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: sg version 4 tools
  2007-02-15 16:58   ` FUJITA Tomonori
@ 2007-02-15 22:47     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2007-02-15 22:47 UTC (permalink / raw)
  To: FUJITA Tomonori; +Cc: dougg, linux-scsi

On Fri, Feb 16 2007, FUJITA Tomonori wrote:
> If you add sgv4 support to sg3_utils now, I'm happy to remove the git
> tree. :)

I think keeping a private testing tools git repo for sg v4 makes a lot
of sense. Some/most of these tools are just for playing around and
making sure that things still work, it's not mean to be packaged for
distros or anything like that.

sg v4 is still in early development, and things change. Integrating
anything with the sg3 tools package at this point would be a big
mistake.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-02-15 22:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-15  1:39 sg version 4 tools FUJITA Tomonori
2007-02-15 16:25 ` Douglas Gilbert
2007-02-15 16:58   ` FUJITA Tomonori
2007-02-15 22:47     ` Jens Axboe

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.