Linux SCSI subsystem development
 help / color / mirror / Atom feed
* Re: FICON target support
       [not found] <CADiuDASOCJbnwLs-LEp0aCX+T4dMvFfKQv_zsypHW-iSF8wW=Q@mail.gmail.com>
@ 2019-05-30 23:10 ` Bart Van Assche
       [not found]   ` <5c5609d8-e4b4-3561-ece9-93746fd46206-HInyCGIudOg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2019-05-30 23:10 UTC (permalink / raw)
  To: Christian Svensson, linux-scsi-u79uwXL29TY76Z2rM5mHXA
  Cc: fcoe-devel-s9riP+hp16TNLxjTenLetw

On 5/26/19 8:51 AM, Christian Svensson wrote:
> I am doing some preliminary scouting of how one could add support for
> FICON (FC-SB-3 specifically). I am mostly interested in Linux being
> able to act as a FICON target for now.
> 
> The TL;DR summary for FICON is that it uses Fibre Channel just like FCP/SCSI
> up to but not including the FC-4 (FCP) layer. At that point it uses its own
> SBCCS layer.
> 
> FICON is used by IBM mainframes to interface peripherals like tape, disk,
> printers, card punchers/readers, etc. It is more like a mainframe USB/Firewire
> than SCSI in that regard.
> 
> I would prefer to implement my peripherals in user-space, I don't see any
> convincing case for having e.g. a virtual tape drive running in kernel space.
> The I/O heavy disks would probably benefit from being in kernel space, but I am
> OK limiting the initial scope.
> 
> I am 100% new to the SCSI and Fibre Channel subsystem in Linux, and I
> do not even know if the current HBAs support sending frames without FCP
> but after scouting the code it does seem that it might work out - FCP
> seems decoupled enough.
> 
> If you want to learn more the standard document Wireshark has an
> implementation of the protocol (packet-fcsb3.c/h). If you want all the details
> you will sadly have to pay $60 and buy it from INCITS at
> https://webstore.ansi.org/Standards/INCITS/INCITS3742003S2013.
> Fwiw, FICON uses FC type 0x1B and 0x1C.
> 
> Any thoughts or ideas where you would start? Do you see any future for this
> addition to the kernel?

Hi Chris,

I'm not sure what the best approach is for the initiator functionality. 
For the target functionality you may want to have a look at tcmu 
(Documentation/target/tcmu-design.txt and 
drivers/target/target_core_user.c). An existing FC target driver is 
available in drivers/scsi/qla2xxx/tcm_qla2xxx.c. A diagram that shows 
the different functional blocks in TCM is available at 
https://en.wikipedia.org/wiki/LIO_(SCSI_target) (LIO is another name for 
TCM).

Bart.

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

* Re: FICON target support
       [not found]   ` <5c5609d8-e4b4-3561-ece9-93746fd46206-HInyCGIudOg@public.gmane.org>
@ 2019-05-31  6:06     ` Hannes Reinecke
       [not found]       ` <CADiuDATRN_85Tu3uw1WBtY=m8KrqKV5zpYrsggYdAOH23dwU=Q@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Hannes Reinecke @ 2019-05-31  6:06 UTC (permalink / raw)
  To: Bart Van Assche, Christian Svensson,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA
  Cc: fcoe-devel-s9riP+hp16TNLxjTenLetw

On 5/31/19 1:10 AM, Bart Van Assche wrote:
> On 5/26/19 8:51 AM, Christian Svensson wrote:
>> I am doing some preliminary scouting of how one could add support for
>> FICON (FC-SB-3 specifically). I am mostly interested in Linux being
>> able to act as a FICON target for now.
>>
>> The TL;DR summary for FICON is that it uses Fibre Channel just like
>> FCP/SCSI
>> up to but not including the FC-4 (FCP) layer. At that point it uses
>> its own SBCCS layer.
>>
>> FICON is used by IBM mainframes to interface peripherals like tape, disk,
>> printers, card punchers/readers, etc. It is more like a mainframe
>> USB/Firewire than SCSI in that regard.
>>
>> I would prefer to implement my peripherals in user-space, I don't see any
>> convincing case for having e.g. a virtual tape drive running in kernel
>> space.
>> The I/O heavy disks would probably benefit from being in kernel space,
>> but I am OK limiting the initial scope.
>>
>> I am 100% new to the SCSI and Fibre Channel subsystem in Linux, and I
>> do not even know if the current HBAs support sending frames without FCP
>> but after scouting the code it does seem that it might work out - FCP
>> seems decoupled enough.
>>
>> If you want to learn more the standard document Wireshark has an
>> implementation of the protocol (packet-fcsb3.c/h). If you want all the
>> details
>> you will sadly have to pay $60 and buy it from INCITS at
>> https://webstore.ansi.org/Standards/INCITS/INCITS3742003S2013.
>> Fwiw, FICON uses FC type 0x1B and 0x1C.
>>
>> Any thoughts or ideas where you would start? Do you see any future for
>> this addition to the kernel?
> 
> Hi Chris,
> 
> I'm not sure what the best approach is for the initiator functionality.
> For the target functionality you may want to have a look at tcmu
> (Documentation/target/tcmu-design.txt and
> drivers/target/target_core_user.c). An existing FC target driver is
> available in drivers/scsi/qla2xxx/tcm_qla2xxx.c. A diagram that shows
> the different functional blocks in TCM is available at
> https://en.wikipedia.org/wiki/LIO_(SCSI_target) (LIO is another name for
> TCM).
> 
Hmm. I wonder: do you _know_ what you are asking?
Have you ever worked with a mainframe?
Thing is, from an initiator side you don't even _see_ the FICON frames;
everything is abstracted away to some higher level.
IE you have no idea how the initiator formats frames and what it expects
in return. Which makes debugging pretty much impossible unless you're
having access to a fibrechannel analyser hooked up to a mainframe.

Hmm?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
_______________________________________________
fcoe-devel mailing list
fcoe-devel@open-fcoe.org
http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel

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

* Re: FICON target support
       [not found]       ` <CADiuDATRN_85Tu3uw1WBtY=m8KrqKV5zpYrsggYdAOH23dwU=Q@mail.gmail.com>
@ 2019-05-31  8:08         ` Hannes Reinecke
       [not found]           ` <CADiuDARPit+kKtQe-UGktUuxEXRMvoq7PGVPKo9DrLRkSTwNAA@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Hannes Reinecke @ 2019-05-31  8:08 UTC (permalink / raw)
  To: Christian Svensson
  Cc: fcoe-devel-s9riP+hp16TNLxjTenLetw, Bart Van Assche,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA

On 5/31/19 9:13 AM, Christian Svensson wrote:
> Hi Hannes,
> 
> On Fri, May 31, 2019 at 8:06 AM Hannes Reinecke <hare@suse.de> wrote:
>> Hmm. I wonder: do you _know_ what you are asking?
>> Have you ever worked with a mainframe?
> 
> I can assure you I have no idea what I am doing :-). I am doing this as a
> learning project where my aim is to implement a virtual card reader in
> user space.
> 
There are easier ways for this ... I'd start with virtio-ccw and
implement a virtual PUNCHER there ...

>>  unless you're having access to a fibrechannel analyser hooked up to a mainframe.
> 
> Funnily enough, I happen to own both.
> 
Oh. Now _that_ is unexpected.
Then I would not stand in your way.

Still, an uphill struggle; IBM is notorious for not giving out details
about the internals, and simulating a puncher is one of these things.
(And slightly pointless, but who am I to judge ...)

However, I do wonder how you came by an FC analyser ... any chance of me
borrowing it occasionally?

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
_______________________________________________
fcoe-devel mailing list
fcoe-devel@open-fcoe.org
http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel

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

* Re: FICON target support
       [not found]             ` <CADiuDARPit+kKtQe-UGktUuxEXRMvoq7PGVPKo9DrLRkSTwNAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2019-05-31 10:17               ` Hannes Reinecke
       [not found]                 ` <CADiuDASfjq=xyuTEF2VZtb+dV78_VdMRkfFrr4ujs0zPXjv7Ew@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Hannes Reinecke @ 2019-05-31 10:17 UTC (permalink / raw)
  To: Christian Svensson
  Cc: fcoe-devel-s9riP+hp16TNLxjTenLetw, Bart Van Assche,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA

On 5/31/19 10:52 AM, Christian Svensson wrote:
> Hi,
> 
> On Fri, May 31, 2019 at 10:08 AM Hannes Reinecke <hare@suse.de> wrote:
>> There are easier ways for this ... I'd start with virtio-ccw and
>> implement a virtual PUNCHER there ...
> 
> The larger project scope is making FICON accessories more available
> for people as crazy as I, that is wanting to run a mainframe as a
> hobbyist, but maybe not want to buy a metric ton worth of disks or
> tape robots (a 700 kg mainframe is hard enough by itself to house).
> 
> I will take a look, but from the name of it it sounds like it will not
> help me much getting FICON targets supported.
> Maybe it will help if I ever want FICON initiator.
> 
Right.

>> Still, an uphill struggle; IBM is notorious for not giving out details
>> about the internals, and simulating a puncher is one of these things.
>> (And slightly pointless, but who am I to judge ...)
> 
> It's a low-speed peripheral that has been emulated successfully in
> Hercules, and there are some petty detailed documents around the CCWs
> for 3505 around. I figured it would
> be a good start getting a FICON user-space thing implemented, before I
> try to tackle e.g. ECKDs or tapes.
> 
Oh. Sure. You might want to ask on the s390 mailing lists, too; they
typically have a quite good idea on what's going on.
The biggest problem, however, will be to get the documentation from the
HBAs themselves.
All FC HBAs will present you with some version of cooked frames, and not
allow you to access the frames themselves. So in the end you'd have to
see to get hold of the HBA documentation itself, as you need to figure
out how to pass FICON frames into the HBA.

It might be easier when you'd be working with FCoE cards, as there you
_do_ have access to the full frame, and do whatever you like with thems.
Sadly you'd need an FCoE bridge then to hook up the mainframe.

But as you have gotten hold of an FC analyser, getting an FCoE bridge
shouldn't be too hard, too :-)

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah
HRB 21284 (AG Nürnberg)
_______________________________________________
fcoe-devel mailing list
fcoe-devel@open-fcoe.org
http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel

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

* Re: [Open-FCoE] FICON target support
       [not found]                 ` <CADiuDASfjq=xyuTEF2VZtb+dV78_VdMRkfFrr4ujs0zPXjv7Ew@mail.gmail.com>
@ 2019-10-03 16:38                   ` Christian Svensson
  2019-10-03 18:37                     ` Laurence Oberman
  0 siblings, 1 reply; 6+ messages in thread
From: Christian Svensson @ 2019-10-03 16:38 UTC (permalink / raw)
  To: Hannes Reinecke; +Cc: Bart Van Assche, linux-scsi, fcoe-devel

Hi,

An update if you're curious about this. I found that DE5-Net FPGA
cards are reasonably priced right now on eBay, so I started a project
to implement FICON target support. You can find more information on
github: https://github.com/bluecmd/fejkon

Essentially it's a 4x SFP+ port card for $300-$400 that I will export
as "fc0-3" netdev's using ARPHRD_FCFABRIC type.
This allows libpcap to capture raw FC directly on the netdev. The
devices will be fully TX/RX capable.

FICON and normal FCP will be implemented in userspace by reading /
writing packets straight to the netdev.
I assume this will be CPU intensive but for my purposes it should be
fine. Maybe it is a good solution for people that want a more modern
Fibre Channel analyzer as well.

Regards,
Christian

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

* Re: [Open-FCoE] FICON target support
  2019-10-03 16:38                   ` [Open-FCoE] " Christian Svensson
@ 2019-10-03 18:37                     ` Laurence Oberman
  0 siblings, 0 replies; 6+ messages in thread
From: Laurence Oberman @ 2019-10-03 18:37 UTC (permalink / raw)
  To: Christian Svensson, Hannes Reinecke
  Cc: Bart Van Assche, linux-scsi, fcoe-devel

On Thu, 2019-10-03 at 18:38 +0200, Christian Svensson wrote:
> Hi,
> 
> An update if you're curious about this. I found that DE5-Net FPGA
> cards are reasonably priced right now on eBay, so I started a project
> to implement FICON target support. You can find more information on
> github: https://github.com/bluecmd/fejkon
> 
> Essentially it's a 4x SFP+ port card for $300-$400 that I will export
> as "fc0-3" netdev's using ARPHRD_FCFABRIC type.
> This allows libpcap to capture raw FC directly on the netdev. The
> devices will be fully TX/RX capable.
> 
> FICON and normal FCP will be implemented in userspace by reading /
> writing packets straight to the netdev.
> I assume this will be CPU intensive but for my purposes it should be
> fine. Maybe it is a good solution for people that want a more modern
> Fibre Channel analyzer as well.
> 
> Regards,
> Christian

Very interesting and thanks for sharing
Regards
Laurence


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

end of thread, other threads:[~2019-10-03 18:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CADiuDASOCJbnwLs-LEp0aCX+T4dMvFfKQv_zsypHW-iSF8wW=Q@mail.gmail.com>
2019-05-30 23:10 ` FICON target support Bart Van Assche
     [not found]   ` <5c5609d8-e4b4-3561-ece9-93746fd46206-HInyCGIudOg@public.gmane.org>
2019-05-31  6:06     ` Hannes Reinecke
     [not found]       ` <CADiuDATRN_85Tu3uw1WBtY=m8KrqKV5zpYrsggYdAOH23dwU=Q@mail.gmail.com>
2019-05-31  8:08         ` Hannes Reinecke
     [not found]           ` <CADiuDARPit+kKtQe-UGktUuxEXRMvoq7PGVPKo9DrLRkSTwNAA@mail.gmail.com>
     [not found]             ` <CADiuDARPit+kKtQe-UGktUuxEXRMvoq7PGVPKo9DrLRkSTwNAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-05-31 10:17               ` Hannes Reinecke
     [not found]                 ` <CADiuDASfjq=xyuTEF2VZtb+dV78_VdMRkfFrr4ujs0zPXjv7Ew@mail.gmail.com>
2019-10-03 16:38                   ` [Open-FCoE] " Christian Svensson
2019-10-03 18:37                     ` Laurence Oberman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox