Created attachment 148740 [details]
patch aonet.c to compile with -DVIMAGE, does not work!
When building the net/aoe kernel module, loading it into a kernel with VIMAGE support results in the following dmesg error message:
link_elf_obj: symbol ifnet undefined
linker_load_file: Unsupported file type
Of course, kldload is not successful.
I then added to the Makefile of net/aoe (just as a quick try)
and patched aoenet.c to make it compile again, see attachment. This gives the following dmesg output when loading:
aoe: aoenet_init: ifp->if_input != ether_input
aoe: aoe_loader: AoE version 1.2.0 initialized
But after some minutes, the system crashes and reboots. So far, I was not able to get a kernel error message. If anyone knows how to patch aoenet.c properly to work with -DVIMAGE, this would help I guess. I'm just a FreeBSD beginner!
By the way: I'm doing this on a FreeNAS 126.96.36.199 machine (based on FreeBSD 9.2.1), since aoe would be nice there...
*** Bug 194665 has been marked as a duplicate of this bug. ***
Created attachment 148765 [details]
Makefile for net/aoe with VIMAGE option
Created attachment 148766 [details]
Patch for aoeblk.c, use disk_create version info 01
Necessary change to make the AoE device appear on FreeBSD 9.2
Created attachment 148767 [details]
Patch for aoenet.c, makes it VIMAGE aware
This actually fixes the reported problem. But I don't know if this is the correct solution which is future-proof.
I just added the necessary file changes to the net/aoe ports directory. The patch-*.c files and the Makefile should replace the exisiting ones. You'll then have to select the VIMAGE option to create a kernel module which works on VIMAGE-enable kernels.
I did not figure out how to detect if the VIMAGE option is enabled in the provided kernel sources. So there the Makefile could be improved!
Furthermore, the patch is tested so far that using a device via AoE on FreeNAS works with respect to creating a Zvol out of it. I'll report further problems.
assigning to maintainer -- somehow the auto-assigner failed.
Created attachment 149076 [details]
Patch for aoe.h
Created attachment 149077 [details]
Patch for aoeblk.c
Created attachment 149078 [details]
Patch for aoecmd.c
Created attachment 149079 [details]
Patch for aoedev.c
Created attachment 149080 [details]
Patch for aoenet.c
In the current patch set, I worked on the following additional things:
- The handling of the function pointer hook in aonet.c was not optimal if some other network interfaces are present. Especially when playing around with net.aoe.iflist sysctl.
- The maximum number of AoE minor devices was increased to 64. This may break current systems if they rely on the unit number of the created /dev/aoed?? device.
- Silenced some IPRINTK statements, which appear in huge number but actually just mean some deferred transaction (in my opinion).
- Other things I forgot right now, have a look at the patches :)
In general, those patches make it work with one network interface on my Coraid machine. However, I don't know how to extend the kernel module to handle AoE devices which are offered on two network devices simultaneously. In order to get this to work, one certainly needs to redesign the module I guess. At least the current patches ensure that the modules does not behave weirdly (double adding devices and such) if that's the case.
Is this still relevant?
AFAIK those patches are still relevant in-so-far that Coraid machines mit ATA over Ethernet are still in use. As written in my previous comments, I'm not an expert in FreeBSD kernel development, so the patches may serve as a starting point to properly fix the net/aoe kernel module.
However, as I moved on from university (where I had access to a Coraid system in 2014), I cannot provide any testing support anymore. Anyhow, with modern FreeBSD kernels the net/aoe in its current state is unusable. And the attached patches make it at least somehow work again.
Okay, thanks for reply.