Unable to detect target on SAN when using a Fiber Switch

Status
Not open for further replies.

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
I've reproduced the problem in my lab. The problem is that while all other devices register "FC4s: FCP" in switch name server, QLogic BIOS does not do it (while IIRC it is required by specifications for many years now). FreeBSD isp(4) driver use that data during fabric scan to identify compatible devices it can talk to. Unfortunately the way it does that assumes that if FC-4 type is not registered, device won't be found. The code in Linux does this scan in much more complicated way, which does not have this limitation. I'll work on that.
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
This FreeBSD patch fixes the problem for me. I'll probably merge it to FreeNAS 11.1 later if it work well.
 

Snail

Cadet
Joined
Jun 3, 2017
Messages
7
Hello,

I can confirm that it works fine.
The "navigation" in the qlogic bios was OK.
A windows 10 and a FreeBSD initiator booted fine. The FreeBSD one has been running for a few hours now, without any problem or freeze.

@mav : Did you mean you would merge it to FreeNAS 11.1 or FreeBSD 11.1, or both ?

Thanks for your work.
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
FreeBSD 11.1 is quite late in its release process now (about RC2) and this change is quite invasive (I worry about some broken switches), so I am not planning to merge there probably, it will go to stable/11 at some point after. What's about FreeNAS 11.1 -- will see when time come.
 

Snail

Cadet
Joined
Jun 3, 2017
Messages
7
That is what I feared, but that is logic.
I will continue to test it and will report any problem occuring, if any.

Thank you again, I can now play with FC.
 

Snail

Cadet
Joined
Jun 3, 2017
Messages
7
Hello,

It is still working great, but I found a problem when trying to use some NPIV; the luns are not seen by the initiator.

I set 2 NPIVs:
Code:
hint.isp.1.vports=2

The FreeBSD logs read:
Code:
kernel: isp1: Chan 2 Fabric Nameserver rejected GID_PT (Reason=0x9 Expl=0xa)
kernel: isp1: Chan 0 Fabric Nameserver rejected GID_PT (Reason=0x9 Expl=0xa)

And the switchshow command on the switch shows an L-Port :
Code:
switchshow
........
Area Port Media Speed State  Proto
=====================================
.......
1  1  id  N4  Online  L-Port  2 public
.......

From the logs provided by IAPro, it seems that it should be
Code:
F-Port 1 N Port + 2 NPIV public


Forcing the port to G mode on the switch helps to see the LUNS - but I sometimes have to reset the port ( portdisable then portenable ) -
Code:
portcfggport 1 1
switchshow
.......
Area Port Media Speed State  Proto
=====================================
.......
  1  1  id  N4  F-Port  2 NPIV public
.......


As you can see, it shows "2 NPIV", not "1 N Port + 2 NPIV", but that maybe depends on the switch.

I hope I gave enough logs, but I can provide more if needed or requested.
 

mav@

iXsystems
iXsystems
Joined
Sep 29, 2011
Messages
1,428
I'll try to reproduce that, but NPIV never actually worked correctly with L-ports. To use NPIV you should better add hint.isp.X.topology="nport-only" .
 
Last edited:

Snail

Cadet
Joined
Jun 3, 2017
Messages
7
I thought it would default to F-port on the switch, as it does when there are no NPIVs involved. I am new to FC.
Anyway, setting "hint.isp.X.topology="nport-only" did the trick.
Thank you
 

IAPro

Dabbler
Joined
Nov 14, 2013
Messages
14
I'm on FreeBSD 10.3-RELEASE-p26 built from source as detailed in /usr/src/Makefile. This server is in production so I'd like to track RELENG. I'd update to 11.1-RELEASE but as you stated it does not have the GID_PT+GFF_ID/GFT_ID patch either and I'd like to try using the updated driver.

I've been at this long enough that I should know the right way to do this, but does this sound reasonable (to try on a test system first of course)? I think these drivers are self contained enough that I'm not going to find myself in dependency hell?
Code:
cd /usr/src
svn up
cd /tmp
svn co  svn://svn.freebsd.org/base/head/sys/dev/isp
svn co  svn://svn.freebsd.org/base/head/sys/dev/ispfw
svn co  svn://svn.freebsd.org/base/head/share/man/man4
cp isp/* /usr/src/sys/dev/isp
cp ispfw/* /usr/src/sys/dev/ispfw
cp man4/isp.4 /usr/src/share/man/man4
rm -rf isp ispfw man4
cd /usr/src
make BUILDWORLD; make BUILDKERNEL=MYHOSTNAME

.... and so on as detailed in /usr/src/Makefile?

I'm trying this right now, but even if it works, is there a better way to tell subversion that you want a set of subdirectories to check out from a different place in the source code tree?

By the way, thanks again so much for the patch and all that you and iXsystems do!
 

IAPro

Dabbler
Joined
Nov 14, 2013
Messages
14
LOLno. I expected there would be problems. There was a function call parameter type mismatch. I’m trying it with a 11.1-RELEASE-p6 checkout now.

Edit: It does compile fine after doing a svn switch https://svn0.us-east.freebsd.org/base/releng/11.1 /usr/src, i.e. updating /usr/src to 11.1-RELEASE-p6, and then copying over the isp and ispfw source directories from head. I will work on upgrading test host and trying it with the updated driver within 11.1-RELEASE-p6.
 
Last edited:

IAPro

Dabbler
Joined
Nov 14, 2013
Messages
14
Just wanted to follow up - What I wrote above, updating to 11.1-RELEASE-p6 and then copying in the /usr/src/sys/dev/isp and /usr/src/sys/dev/ispfw directories from head, and then following the process detailed in /usr/src/Makefile produces a system that has been providing FC target service with NPIV that works with the QLogic BIOS with CentOS, Ubuntu and various Windows based FC initiators only seeing the targets they're supposed to. This has been stable and in production for weeks now. Obviously I would expect a system compiled entirely from head to work also. Any questions about how I implemented this please ask. Thanks @mav for the fix, you guys are outstanding.
 
Status
Not open for further replies.
Top