* scsi (sg) device status vs FC connectivity
@ 2012-02-21 21:35 Candid Shot
2012-02-21 22:36 ` Douglas Gilbert
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Candid Shot @ 2012-02-21 21:35 UTC (permalink / raw)
To: linux-scsi
(I hope this list is the right place to ask SG Driver related question ..)
Background: A FC cable-pull is simulated by disabling the FC switch (Brocade) port.
While /sys/class/fc_host/hostx/port_state might confirm the FC connectivity is missing,
/proc/scsi/sg/devices will show the scsi device to be 'online'.
My goal is to be able to return an error to the application, should a cable-pull happen.
Is there a way to be able to tweak this behavior where the scsi driver is able to look at port events,
and possibly return errors during read/write operations?
Thanks,
Raj.
Platform: Adapter: EMC LPe12002-E 8Gb 2-port PCIe Fibre Channel Adapter on PCI
Server: Linux ostqa-media3a.sie.hds.com 2.6.18-238.el5 #1 SMP Sun Dec 19 14:22:44 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: scsi (sg) device status vs FC connectivity
2012-02-21 21:35 scsi (sg) device status vs FC connectivity Candid Shot
@ 2012-02-21 22:36 ` Douglas Gilbert
2012-02-22 3:21 ` James Bottomley
2012-02-22 9:02 ` Mike Christie
2 siblings, 0 replies; 4+ messages in thread
From: Douglas Gilbert @ 2012-02-21 22:36 UTC (permalink / raw)
To: Candid Shot; +Cc: linux-scsi
On 12-02-21 04:35 PM, Candid Shot wrote:
> (I hope this list is the right place to ask SG Driver related question ..)
>
> Background: A FC cable-pull is simulated by disabling the FC switch (Brocade) port.
>
>
> While /sys/class/fc_host/hostx/port_state might confirm the FC connectivity is missing,
>
> /proc/scsi/sg/devices will show the scsi device to be 'online'.
>
> My goal is to be able to return an error to the application, should a cable-pull happen.
>
> Is there a way to be able to tweak this behavior where the scsi driver is able to look at port events,
> and possibly return errors during read/write operations?
The sg driver works at the SCSI level and these days
asynchronous notifications are being left to the
transport layer.
I don't know much about FC. Using SAS (disks connected via
an expander which seems to be functionally similar to a
FC switch) then if an expander port connecting a disk
is disabled then the expander will generate a
Broadcast(Change) which all initiators (HBAs) should
receive and those HBAs should do another device discover
process. That should lead to various events being generated
which udev sees and removes the disk device node.
Hopefully someone who knows about FC and Linux can
supply more details for your case.
Doug Gilbert
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: scsi (sg) device status vs FC connectivity
2012-02-21 21:35 scsi (sg) device status vs FC connectivity Candid Shot
2012-02-21 22:36 ` Douglas Gilbert
@ 2012-02-22 3:21 ` James Bottomley
2012-02-22 9:02 ` Mike Christie
2 siblings, 0 replies; 4+ messages in thread
From: James Bottomley @ 2012-02-22 3:21 UTC (permalink / raw)
To: Candid Shot; +Cc: linux-scsi
On Tue, 2012-02-21 at 13:35 -0800, Candid Shot wrote:
> (I hope this list is the right place to ask SG Driver related question ..)
>
> Background: A FC cable-pull is simulated by disabling the FC switch (Brocade) port.
>
>
> While /sys/class/fc_host/hostx/port_state might confirm the FC connectivity is missing,
>
> /proc/scsi/sg/devices will show the scsi device to be 'online'.
>
> My goal is to be able to return an error to the application, should a cable-pull happen.
>
> Is there a way to be able to tweak this behavior where the scsi driver is able to look at port events,
> and possibly return errors during read/write operations?
Yes, set the dev_loss_tmo to zero. That parameter was introduced to
allow the cables to be disconnected and reconnected without tearing down
the fibre channel connections. By default it waits 60 seconds for
reconnection, if you set it to zero, teardown will happen immediately.
James
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: scsi (sg) device status vs FC connectivity
2012-02-21 21:35 scsi (sg) device status vs FC connectivity Candid Shot
2012-02-21 22:36 ` Douglas Gilbert
2012-02-22 3:21 ` James Bottomley
@ 2012-02-22 9:02 ` Mike Christie
2 siblings, 0 replies; 4+ messages in thread
From: Mike Christie @ 2012-02-22 9:02 UTC (permalink / raw)
To: Candid Shot; +Cc: linux-scsi
On 02/21/2012 03:35 PM, Candid Shot wrote:
> (I hope this list is the right place to ask SG Driver related question ..)
>
> Background: A FC cable-pull is simulated by disabling the FC switch (Brocade) port.
>
>
> While /sys/class/fc_host/hostx/port_state might confirm the FC connectivity is missing,
>
> /proc/scsi/sg/devices will show the scsi device to be 'online'.
>
> My goal is to be able to return an error to the application, should a cable-pull happen.
>
> Is there a way to be able to tweak this behavior where the scsi driver is able to look at port events,
> and possibly return errors during read/write operations?
You can listen on the fc scsi netlink socket for fc_host_event_code. You
get values like:
{ FCH_EVT_LIP, "lip" },
{ FCH_EVT_LINKUP, "link_up" },
{ FCH_EVT_LINKDOWN, "link_down" },
{ FCH_EVT_LIPRESET, "lip_reset" },
{ FCH_EVT_RSCN, "rscn" },
{ FCH_EVT_ADAPTER_CHANGE, "adapter_chg" },
{ FCH_EVT_PORT_UNKNOWN, "port_unknown" },
{ FCH_EVT_PORT_ONLINE, "port_online" },
{ FCH_EVT_PORT_OFFLINE, "port_offline" },
{ FCH_EVT_PORT_FABRIC, "port_fabric" },
{ FCH_EVT_LINK_UNKNOWN, "link_unknown" },
{ FCH_EVT_VENDOR_UNIQUE, "vendor_unique" },
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-22 9:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-21 21:35 scsi (sg) device status vs FC connectivity Candid Shot
2012-02-21 22:36 ` Douglas Gilbert
2012-02-22 3:21 ` James Bottomley
2012-02-22 9:02 ` Mike Christie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).