Re: scsi traffic sniffing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

谢纲 wrote:
On Tue, Sep 1, 2009 at 2:13 PM, Jonathan Nell<crtrn13@xxxxxxxxx> wrote:
Is there any way to sniff the traffic of a scsi device? I need to
debug a firmware update and need to see the traffic being passed to
the drive
You may hook the queue_command function of the scsi host. It can sniff
all scsi request to scsi host driver.

Actually you can switch on logging of commands and status (though not of data) at runtime by something like
# echo $BITMASK > /sys/module/scsi_mod/parameters/scsi_logging_level
# echo $BITMASK > /proc/sys/dev/scsi/logging_level
provided that the kernel's SCSI core was compiled with CONFIG_SCSI_LOGGING=y.

Bitmask values can be constructed as in linux/drivers/scsi/scsi_logging.h. Long ago I made a note that 9216 as bitmask was useful for my purposes, but don't ask me what that means.

For data logging, you have to modify the SCSI low-level driver or SCSI core indeed.

However, all this applies only if the firmware updater actually runs on a Linux initiator, not e.g. on an MS Windows initiator. In the latter case, you need a debug driver which hooks into Windows' SCSI stack, or some sort of bus analyzer.
Stefan Richter
-=====-==--= =--= ----=
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Photos]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

Add to Google Powered by Linux