I am still having a hard time understanding kernel drivers vs module's in practical use: I understand a kernel driver, is a driver that Linus, et al, have coded into the kernel, so if i have a peice of hardware, and I compile a kernel with that device's driver turned on, then my device will work. If i build that kernel driver as a module, the driver remains outside the kernel, but still availible for use. As a module I can rmmod or insmod when i need to use the device. My foggy'ness comes from a few things. 1. if the driver is built into the kernel, will it show up in lsmod? 2. if the driver does not show up in lsmod, how do i know if its loaded? 3. weather it's a built in driver or a module, how do i associate the driver (or module) with a particular device? 4. if the device does not have a driver in the kernel, I cannot build a custom kernel to include it, nor can I build it as a module from the kernel source. So: 5. if I get the driver from the vendor, it will build a module for me, based on my kernel-source or kernel-headers??? Then what? again, see #3: how do i associate the module with my device? This is a general linux quandry, but this time i have a debian stable install and have inserted a QLogic HBA. lsmod does show qla2xxx, but it doesn't seem to be functioning as it isn't logging into the fiber switch. thanks mike
==> Regarding [Wlug] kernel driver vs module; Mike Leo <mleo963@yahoo.com> adds: mleo963> I am still having a hard time understanding kernel drivers vs mleo963> module's in practical use: I understand a kernel driver, is a mleo963> driver that Linus, et al, have coded into the kernel, so if i have mleo963> a peice of hardware, and I compile a kernel with that device's mleo963> driver turned on, then my device will work. mleo963> If i build that kernel driver as a module, the driver remains mleo963> outside the kernel, but still availible for use. As a module I mleo963> can rmmod or insmod when i need to use the device. mleo963> My foggy'ness comes from a few things. mleo963> 1. if the driver is built into the kernel, will it show up in lsmod? No. mleo963> 2. if the driver does not show up in lsmod, how do i know if its mleo963> loaded? dmesg mleo963> 3. weather it's a built in driver or a module, how do i associate mleo963> the driver (or module) with a particular device? It's done for you, via built-in PCI id mappings. mleo963> 4. if the device does not have a driver in the kernel, I cannot mleo963> build a custom kernel to include it, nor can I build it as a mleo963> module from the kernel source. So: This isn't a question... ;) mleo963> 5. if I get the driver from the vendor, it will build a module mleo963> for me, based on my kernel-source or kernel-headers??? Then what? mleo963> again, see #3: how do i associate the module with my device? Vendor modules come in 2 flavors: binary only, and not binary only. ;) In the former case, you'll likely have to run the kernel version against which they built the module. In the latter case, yes, you can build the module out of tree, and then insmod it. Again, PCI id's on the card are matched to those supported by the driver. mleo963> This is a general linux quandry, but this time i have a debian mleo963> stable install and have inserted a QLogic HBA. lsmod does show mleo963> qla2xxx, but it doesn't seem to be functioning as it isn't logging mleo963> into the fiber switch. What does the dmesg output show? -Jeff
good feedback...thanks the entries in dmesg show QLogic Fibre Channel HBA Driver qla2xxx 0000:00:01.0: Found an ISP2312, irq 9, iobase 0xf8aa6000 qla2xxx 0000:00:01.0: Configuring PCI space... qla2xxx 0000:00:01.0: Configure NVRAM parameters... qla2xxx 0000:00:01.0: Verifying loaded RISC code... qla2xxx 0000:00:01.0: Firmware image unavailable. qla2xxx 0000:00:01.0: Failed to initialize adapter This is a brand new, out of the box HBA and we have had zero failure rates to date on these (via Redhat). The only "drivers" i can find via QLogic are rpm's...that makes them binary drivers (?) since I cannot compile them myself, right? --- Jeff Moyer <jmoyer@redhat.com> wrote:
==> Regarding [Wlug] kernel driver vs module; Mike Leo <mleo963@yahoo.com> adds:
mleo963> I am still having a hard time understanding kernel drivers vs mleo963> module's in practical use: I understand a kernel driver, is a mleo963> driver that Linus, et al, have coded into the kernel, so if i have mleo963> a peice of hardware, and I compile a kernel with that device's mleo963> driver turned on, then my device will work.
mleo963> If i build that kernel driver as a module, the driver remains mleo963> outside the kernel, but still availible for use. As a module I mleo963> can rmmod or insmod when i need to use the device.
mleo963> My foggy'ness comes from a few things.
mleo963> 1. if the driver is built into the kernel, will it show up in lsmod?
No.
mleo963> 2. if the driver does not show up in lsmod, how do i know if its mleo963> loaded?
dmesg
mleo963> 3. weather it's a built in driver or a module, how do i associate mleo963> the driver (or module) with a particular device?
It's done for you, via built-in PCI id mappings.
mleo963> 4. if the device does not have a driver in the kernel, I cannot mleo963> build a custom kernel to include it, nor can I build it as a mleo963> module from the kernel source. So:
This isn't a question... ;)
mleo963> 5. if I get the driver from the vendor, it will build a module mleo963> for me, based on my kernel-source or kernel-headers??? Then what? mleo963> again, see #3: how do i associate the module with my device?
Vendor modules come in 2 flavors: binary only, and not binary only. ;) In the former case, you'll likely have to run the kernel version against which they built the module. In the latter case, yes, you can build the module out of tree, and then insmod it. Again, PCI id's on the card are matched to those supported by the driver.
mleo963> This is a general linux quandry, but this time i have a debian mleo963> stable install and have inserted a QLogic HBA. lsmod does show mleo963> qla2xxx, but it doesn't seem to be functioning as it isn't logging mleo963> into the fiber switch.
What does the dmesg output show?
-Jeff _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
Mike> good feedback...thanks Mike> the entries in dmesg show Mike> QLogic Fibre Channel HBA Driver Mike> qla2xxx 0000:00:01.0: Found an ISP2312, irq 9, iobase 0xf8aa6000 Mike> qla2xxx 0000:00:01.0: Configuring PCI space... Mike> qla2xxx 0000:00:01.0: Configure NVRAM parameters... Mike> qla2xxx 0000:00:01.0: Verifying loaded RISC code... Mike> qla2xxx 0000:00:01.0: Firmware image unavailable. Mike> qla2xxx 0000:00:01.0: Failed to initialize adapter This is good, but what it's really telling me is that you don't have the driver properly installed, with the firmware that needs to be downloaded to the card setup properly. Do you have any docs on the card driver install? Check that /lib/firmware/.. has the right stuff in there. Here's some docs from the KCONFIG entry, since the qla2xxx driver is part of the core linux kernel now (2.6.18-rc1-mm1): By default, firmware for the ISP parts will be loaded via the Firmware Loader interface. ISP Firmware Filename ---------- ----------------- 21xx ql2100_fw.bin 22xx ql2200_fw.bin 2300, 2312, 6312 ql2300_fw.bin 2322, 6322 ql2322_fw.bin 24xx ql2400_fw.bin Upon request, the driver caches the firmware image until the driver is unloaded. Firmware images can be retrieved from: ftp://ftp.qlogic.com/outgoing/linux/firmware/ Mike> This is a brand new, out of the box HBA and we have had zero Mike> failure rates to date on these (via Redhat). Mike> The only "drivers" i can find via QLogic are rpm's...that makes Mike> them binary drivers (?) since I cannot compile them myself, Mike> right? Whether they're RPMs or not doesn't mean much, it's whether or not you can get source code without any binary blobs. In this case, since the firmware is binary only, it's not a completely open adapter, but at least you can grab what you need easily enough. John
well, now can someone explain why putting a bin file in /lib/firmware i now get the following after a insmod qla2xxx: QLogic Fibre Channel HBA Driver qla2xxx 0000:00:01.0: Found an ISP2312, irq 9, iobase 0xf8aa6000 qla2xxx 0000:00:01.0: Configuring PCI space... qla2xxx 0000:00:01.0: Configure NVRAM parameters... qla2xxx 0000:00:01.0: Verifying loaded RISC code... qla2xxx 0000:00:01.0: Waiting for LIP to complete... qla2xxx 0000:00:01.0: LOOP UP detected (2 Gbps). qla2xxx 0000:00:01.0: Topology - (F_Port), Host Loop address 0xffff scsi6 : qla2xxx qla2xxx 0000:00:01.0: QLogic Fibre Channel HBA Driver: 8.01.04-k QLogic QLA2340 - 133MHz PCI-X to 2Gb FC, Single Channel ISP2312: PCI (33 MHz) @ 0000:00:01.0 hdma-, host#=6, fw=3.03.20 IPX My redhat servers don't even have a /lib/firmware directory...is this a debian thing? Seems by simply putting a qla2300_fw.bin file in /lib/firmware fixed my problem. I have yet to get actual SAN disks, but at least the card came up this time. Also, what is a KCONFIG entry? --- John Stoffel <john@stoffel.org> wrote:
Mike> good feedback...thanks Mike> the entries in dmesg show
Mike> QLogic Fibre Channel HBA Driver Mike> qla2xxx 0000:00:01.0: Found an ISP2312, irq 9, iobase 0xf8aa6000 Mike> qla2xxx 0000:00:01.0: Configuring PCI space... Mike> qla2xxx 0000:00:01.0: Configure NVRAM parameters... Mike> qla2xxx 0000:00:01.0: Verifying loaded RISC code... Mike> qla2xxx 0000:00:01.0: Firmware image unavailable. Mike> qla2xxx 0000:00:01.0: Failed to initialize adapter
This is good, but what it's really telling me is that you don't have the driver properly installed, with the firmware that needs to be downloaded to the card setup properly.
Do you have any docs on the card driver install? Check that /lib/firmware/.. has the right stuff in there. Here's some docs from the KCONFIG entry, since the qla2xxx driver is part of the core linux kernel now (2.6.18-rc1-mm1):
By default, firmware for the ISP parts will be loaded via the Firmware Loader interface.
ISP Firmware Filename ---------- ----------------- 21xx ql2100_fw.bin 22xx ql2200_fw.bin 2300, 2312, 6312 ql2300_fw.bin 2322, 6322 ql2322_fw.bin 24xx ql2400_fw.bin
Upon request, the driver caches the firmware image until the driver is unloaded.
Firmware images can be retrieved from:
ftp://ftp.qlogic.com/outgoing/linux/firmware/
Mike> This is a brand new, out of the box HBA and we have had zero Mike> failure rates to date on these (via Redhat).
Mike> The only "drivers" i can find via QLogic are rpm's...that makes Mike> them binary drivers (?) since I cannot compile them myself, Mike> right?
Whether they're RPMs or not doesn't mean much, it's whether or not you can get source code without any binary blobs. In this case, since the firmware is binary only, it's not a completely open adapter, but at least you can grab what you need easily enough.
John _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
The card that you are using requires that the firmware be loaded every time. Firmware, as you may know, is distinct from the driver that Linux uses to talk to the card ... it is the code that the card runs natively to control its operations and allow the card to communicate properly with (and pass data to) the PC. There are a number of reasons why they would load the firmware each time. I don't know this card or driver at all, so I won't bore you with conjecture, but the end result is that the driver needs to know where to find the firmware so that it can load it in, and get the card up and running. My guess, as to your question about redhat, is that the firmware is simply stored in a different location, or is linked into the driver directly. Again, having no intimate knowledge, I can only suppose. So, as you've properly ascertained, the driver can now get the card up and talking, and all you need now are some drives to have some real fun :). Hope that this helps, and good luck. Lee On 7/11/06, Mike Leo <mleo963@yahoo.com> wrote:
well, now can someone explain why putting a bin file in /lib/firmware i now get the following after a insmod qla2xxx:
QLogic Fibre Channel HBA Driver qla2xxx 0000:00:01.0: Found an ISP2312, irq 9, iobase 0xf8aa6000 qla2xxx 0000:00:01.0: Configuring PCI space... qla2xxx 0000:00:01.0: Configure NVRAM parameters... qla2xxx 0000:00:01.0: Verifying loaded RISC code... qla2xxx 0000:00:01.0: Waiting for LIP to complete... qla2xxx 0000:00:01.0: LOOP UP detected (2 Gbps). qla2xxx 0000:00:01.0: Topology - (F_Port), Host Loop address 0xffff scsi6 : qla2xxx qla2xxx 0000:00:01.0: QLogic Fibre Channel HBA Driver: 8.01.04-k QLogic QLA2340 - 133MHz PCI-X to 2Gb FC, Single Channel ISP2312: PCI (33 MHz) @ 0000:00:01.0 hdma-, host#=6, fw=3.03.20 IPX
My redhat servers don't even have a /lib/firmware directory...is this a debian thing?
Seems by simply putting a qla2300_fw.bin file in /lib/firmware fixed my problem.
I have yet to get actual SAN disks, but at least the card came up this time.
Also, what is a KCONFIG entry?
--- John Stoffel <john@stoffel.org> wrote:
Mike> good feedback...thanks Mike> the entries in dmesg show
Mike> QLogic Fibre Channel HBA Driver Mike> qla2xxx 0000:00:01.0: Found an ISP2312, irq 9, iobase 0xf8aa6000 Mike> qla2xxx 0000:00:01.0: Configuring PCI space... Mike> qla2xxx 0000:00:01.0: Configure NVRAM parameters... Mike> qla2xxx 0000:00:01.0: Verifying loaded RISC code... Mike> qla2xxx 0000:00:01.0: Firmware image unavailable. Mike> qla2xxx 0000:00:01.0: Failed to initialize adapter
This is good, but what it's really telling me is that you don't have the driver properly installed, with the firmware that needs to be downloaded to the card setup properly.
Do you have any docs on the card driver install? Check that /lib/firmware/.. has the right stuff in there. Here's some docs from the KCONFIG entry, since the qla2xxx driver is part of the core linux kernel now (2.6.18-rc1-mm1):
By default, firmware for the ISP parts will be loaded via the Firmware Loader interface.
ISP Firmware Filename ---------- ----------------- 21xx ql2100_fw.bin 22xx ql2200_fw.bin 2300, 2312, 6312 ql2300_fw.bin 2322, 6322 ql2322_fw.bin 24xx ql2400_fw.bin
Upon request, the driver caches the firmware image until the driver is unloaded.
Firmware images can be retrieved from:
ftp://ftp.qlogic.com/outgoing/linux/firmware/
Mike> This is a brand new, out of the box HBA and we have had zero Mike> failure rates to date on these (via Redhat).
Mike> The only "drivers" i can find via QLogic are rpm's...that makes Mike> them binary drivers (?) since I cannot compile them myself, Mike> right?
Whether they're RPMs or not doesn't mean much, it's whether or not you can get source code without any binary blobs. In this case, since the firmware is binary only, it's not a completely open adapter, but at least you can grab what you need easily enough.
John _______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
_______________________________________________ Wlug mailing list Wlug@mail.wlug.org http://mail.wlug.org/mailman/listinfo/wlug
-- Lee Keyser-Allen (lkeyser@alum.wpi.edu)
Mike> well, now can someone explain why putting a bin file in Mike> /lib/firmware i now get the following after a insmod qla2xxx: Umm... because the card can now initialize itself with the firmware image and do the initial logins to the SAN? I dunno, I've never used them under Linux. Yet. :] Mike> QLogic Fibre Channel HBA Driver Mike> qla2xxx 0000:00:01.0: Found an ISP2312, irq 9, iobase 0xf8aa6000 Mike> qla2xxx 0000:00:01.0: Configuring PCI space... Mike> qla2xxx 0000:00:01.0: Configure NVRAM parameters... Mike> qla2xxx 0000:00:01.0: Verifying loaded RISC code... Mike> qla2xxx 0000:00:01.0: Waiting for LIP to complete... Mike> qla2xxx 0000:00:01.0: LOOP UP detected (2 Gbps). Mike> qla2xxx 0000:00:01.0: Topology - (F_Port), Host Loop address 0xffff Mike> scsi6 : qla2xxx Mike> qla2xxx 0000:00:01.0: Mike> QLogic Fibre Channel HBA Driver: 8.01.04-k Mike> QLogic QLA2340 - 133MHz PCI-X to 2Gb FC, Single Channel Mike> ISP2312: PCI (33 MHz) @ 0000:00:01.0 hdma-, host#=6, fw=3.03.20 IPX So that's good. Mike> My redhat servers don't even have a /lib/firmware directory...is Mike> this a debian thing? It's a Linux 2.6 thing Mike> Seems by simply putting a qla2300_fw.bin file in /lib/firmware Mike> fixed my problem. Good. Mike> I have yet to get actual SAN disks, but at least the card came Mike> up this time. Yeah! I assume that there are some tools under Linux to actually probe the fabric and see what's out there. It sounds like you're most of the way there now, unless of course you run into SAN zoning issues. Mike> Also, what is a KCONFIG entry? It's part of the Linux kernel source code tree. When you extract the kernel source and do: make xconfig it prompts you with entries from the KCONFIG files for each driver/kernel feature that you need to configure. I just cut'n'pasted the info from my local copy of the kernel source before. Good luck, John
On Mon, Jul 10, 2006 at 08:13:36AM -0700, Mike Leo wrote:
My foggy'ness comes from a few things. 1. if the driver is built into the kernel, will it show up in lsmod?
No, because it's not a module.
2. if the driver does not show up in lsmod, how do i know if its loaded?
That largely depends on what it is, though generally you'll see related entries under /proc. If it's a filesystem for instance, you will see it listed under /proc/filesystems.
3. weather it's a built in driver or a module, how do i associate the driver (or module) with a particular device?
That depends on the driver. Most drivers are able to find their devices automatically. Others require kernel/module parameters to specify port, etc.
4. if the device does not have a driver in the kernel, I cannot build a custom kernel to include it, nor can I build it as a module from the kernel source. So: 5. if I get the driver from the vendor, it will build a module for me, based on my kernel-source or kernel-headers??? Then what? again, see #3: how do i associate the module with my device?
It will definitely need kernel-source or kernel-headers, whichever your distro uses. You'll end up with a compiled module (name.o). I haven't actually dealt with adding modules in ages, but as I recall you put the resulting module file under /lib/modules/... appropriately (/lib/modules/`uname -r`/misc ?) and run "depmod -a". At this point the module should be all set. There's probably docs from the vendor as well.
This is a general linux quandry, but this time i have a debian stable install and have inserted a QLogic HBA. lsmod does show qla2xxx, but it doesn't seem to be functioning as it isn't logging into the fiber switch.
Does the card show up in dmesg output / if you rmmod and then modprobe the module, do you see the card information? I never had to do anything special to get the HBA module (also Qlogic) loaded up and logged into the fabric as far as I can recall anyway. -- Randomly Generated Tagline: "I have not put in a single line of code into BIND 9. And I hope that's not why it's a thing of beauty." - Paul Vixie at LISA '99
Mike> I understand a kernel driver, is a driver that Linus, et al, Mike> have coded into the kernel, so if i have a peice of hardware, Mike> and I compile a kernel with that device's driver turned on, then Mike> my device will work. Mike> If i build that kernel driver as a module, the driver remains Mike> outside the kernel, but still availible for use. As a module I Mike> can rmmod or insmod when i need to use the device. You're mixing up two different things. Almost all drivers which are shipped with the linux kernel can be compiled in one of two ways: into the kernel, or as a module which can be loaded/unloaded at run-time. So if you have a driver and compile it into the kernel, you should see some output from 'dmesg' showing you what was deteced on bootup of the kernel. Mike> My foggy'ness comes from a few things. Mike> 1. if the driver is built into the kernel, will it show up in lsmod? No, because lsmod only shows loaded modules, not modules which are available for loading. It also doesn't show up drivers which are compiled into the kernel directly. Mike> 2. if the driver does not show up in lsmod, how do i know if Mike> its loaded? Check the output of the 'dmesg' command after a full reboot with your driver. You should at least see something about that driver, whether or not it detects any devices. Mike> 3. weather it's a built in driver or a module, how do i Mike> associate the driver (or module) with a particular device? It depends on the driver, but generally they go by PCI device ID to determine which hardware they can access. Mike> 4. if the device does not have a driver in the kernel, I cannot Mike> build a custom kernel to include it, nor can I build it as a Mike> module from the kernel source. So: This makes no sense here. Of course you can build a custom kernel with a driver shipped outside of the normal linux kernel. Mike> 5. if I get the driver from the vendor, it will build a module Mike> for me, based on my kernel-source or kernel-headers??? Then Mike> what? again, see #3: how do i associate the module with my Mike> device? If you are given vendor provided driver, you can have several issues to address here. One, it needs to match your running kernel image if it's a completely binary only module. Not a great idea in my book. If there is a binary core, but an source code wrapper section, then you'll need to compile the module against the installed kernel's headers. Not hard, the vendor should go into all these details. Mike> This is a general linux quandry, but this time i have a debian Mike> stable install and have inserted a QLogic HBA. lsmod does show Mike> qla2xxx, but it doesn't seem to be functioning as it isn't Mike> logging into the fiber switch. Check the output of 'dmesg' and see what it says. You might need to check the logs on the switch as well to make sure that you're allowing the system holding the adapter is bringing it online and that the switch is seeing it try to login. Feel free to post details and such here, the more the better! John
participants (5)
-
Jeff Moyer
-
John Stoffel
-
Lee Keyser-Allen
-
Mike Leo
-
Theo Van Dinter