ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
63 stars 60 forks source link

Output of lscss is confusing with vfio-ccw devices #32

Closed cohuck closed 6 years ago

cohuck commented 6 years ago

Setup: LPAR with one subchannel for a dasd reassigned from the I/O subchannel driver to the vfio-ccw driver (no mdev created yet)

lscss shows

Device   Subchan.  DevType CU Type Use  PIM PAM POM  CHPIDs           
----------------------------------------------------------------------
0.0.0900 0.0.001f  1732/01 1731/01 yes  80  80  ff   15000000 00000000
0.0.0901 0.0.0020  1732/01 1731/01 yes  80  80  ff   15000000 00000000
0.0.0902 0.0.0021  1732/01 1731/01 yes  80  80  ff   15000000 00000000
0.0.2a01 0.0.021d  3390/0e 3990/e9 yes  f0  f0  ff   19293909 00000000
0.0.2b01 0.0.031d  3390/0e 3990/e9 yes  f0  f0  ff   1a2a3a0a 00000000
0.0.2b08 0.0.0324  3390/0e 3990/e9 yes  f0  f0  ff   1a2a3a0a 00000000
none     0.0.0325                       f0  f0  ff   1a2a3a0a 00000000
0.0.2c01 0.0.041d  3390/0e 3990/e9 yes  f0  f0  ff   0a1a2838 00000000
0.0.2d01 0.0.049d  3390/0e 3990/e9 yes  f0  f0  ff   09192939 00000000

The line for subchannel 0.0.0325 is a bit confusing, as it looks like there is something wrong with the subchannel (previously, I saw output like that only if there was some problem with device recognition in the common I/O layer, as the I/O subchannel driver always registers a ccw device.) lscss --all does not reveal anything, either.

The subchannel shows up correctly with lscss --vfio.

MDEV                                  Subchan.  PIM PAM POM  CHPIDs           
------------------------------------------------------------------------------
none                                  0.0.0325  f0  f0  ff   1a2a3a0a 00000000

I'm not sure what the best approach is here. If lscss only showed devices bound to a subchannel driver, we would miss chsc or eadm subchannels if the driver is not present. (I think we can rely on the I/O subchannel driver always being present.)

I would, however, expect the output of lscss --all to include the output of lscss --vfio. Or maybe a new option lscss --everything or so.

sebott commented 6 years ago

I totally forgot that this option even exists... lscss does not show subchannels by drivers but by subchannel type, I guess that's why a subchannel is displayed even when bound to an alternate driver.

The --vfio does break the rule stated above in that it shows only subchannels bound to the vfio_ccw driver. Why is --vfio not selected by --all? I guess because a subchannel should only be displayed once. --io and --vfio have been deliberately made incompatible by the developers implementing that change:

lscss --vfio --io
lscss: Invalid option combination: --vfio can not be used with --io, -d, -t or --avail
cohuck commented 6 years ago

OK, that sounds like we have to live with 'lscss handling of vfio-ccw devices is a bit odd'.

But can we get an update for the man page? It currently states

NOTES
       In rare situations a device might temporarily not be accessible to  the
       subchannel.  Then  "none" is displayed as the device identifier and the
       other device attributes are empty.

That is not really true for vfio-ccw devices.

sebott commented 6 years ago

Good point. I'll add something like: For subchannels bound to an alternate driver (most notably vfio_ccw) the device identifier can also be displayed as "none". In this case use the --vfio option to show VFIO specific subchannel information.

cohuck commented 6 years ago

Possibly s/can/may/ or s/can/will/ ? Otherwise, sounds good to me.