Bug 194663 - net/aoe and VIMAGE enabled kernel
Summary: net/aoe and VIMAGE enabled kernel
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
: 194665 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-10-28 17:10 UTC by Andreas Neiser
Modified: 2021-12-06 12:27 UTC (History)
4 users (show)

See Also:


Attachments
patch aonet.c to compile with -DVIMAGE, does not work! (1.15 KB, patch)
2014-10-28 17:10 UTC, Andreas Neiser
andreas.neiser: maintainer-approval+
Details | Diff
Makefile for net/aoe with VIMAGE option (854 bytes, text/plain)
2014-10-29 15:26 UTC, Andreas Neiser
no flags Details
Patch for aoeblk.c, use disk_create version info 01 (313 bytes, patch)
2014-10-29 15:28 UTC, Andreas Neiser
no flags Details | Diff
Patch for aoenet.c, makes it VIMAGE aware (7.71 KB, patch)
2014-10-29 15:29 UTC, Andreas Neiser
no flags Details | Diff
Patch for aoe.h (805 bytes, patch)
2014-11-05 18:06 UTC, Andreas Neiser
no flags Details | Diff
Patch for aoeblk.c (1.15 KB, patch)
2014-11-05 18:07 UTC, Andreas Neiser
no flags Details | Diff
Patch for aoecmd.c (4.28 KB, patch)
2014-11-05 18:08 UTC, Andreas Neiser
no flags Details | Diff
Patch for aoedev.c (3.84 KB, patch)
2014-11-05 18:08 UTC, Andreas Neiser
no flags Details | Diff
Patch for aoenet.c (12.32 KB, patch)
2014-11-05 18:09 UTC, Andreas Neiser
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Neiser 2014-10-28 17:10:22 UTC
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)

CFLAGS+= -DVIMAGE

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!

Thanks!

By the way: I'm doing this on a FreeNAS 9.2.1.8 machine (based on FreeBSD 9.2.1), since aoe would be nice there...
Comment 1 Andreas Neiser 2014-10-29 14:48:07 UTC
*** Bug 194665 has been marked as a duplicate of this bug. ***
Comment 2 Andreas Neiser 2014-10-29 15:26:22 UTC
Created attachment 148765 [details]
Makefile for net/aoe with VIMAGE option
Comment 3 Andreas Neiser 2014-10-29 15:28:07 UTC
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
Comment 4 Andreas Neiser 2014-10-29 15:29:50 UTC
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.
Comment 5 Andreas Neiser 2014-10-29 15:32:59 UTC
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.
Comment 6 John Marino freebsd_committer freebsd_triage 2014-11-01 09:07:08 UTC
assigning to maintainer -- somehow the auto-assigner failed.
Comment 7 Andreas Neiser 2014-11-05 18:06:41 UTC
Created attachment 149076 [details]
Patch for aoe.h
Comment 8 Andreas Neiser 2014-11-05 18:07:35 UTC
Created attachment 149077 [details]
Patch for aoeblk.c
Comment 9 Andreas Neiser 2014-11-05 18:08:13 UTC
Created attachment 149078 [details]
Patch for aoecmd.c
Comment 10 Andreas Neiser 2014-11-05 18:08:41 UTC
Created attachment 149079 [details]
Patch for aoedev.c
Comment 11 Andreas Neiser 2014-11-05 18:09:10 UTC
Created attachment 149080 [details]
Patch for aoenet.c
Comment 12 Andreas Neiser 2014-11-05 18:19:07 UTC
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.
Comment 13 Walter Schwarzenfeld freebsd_triage 2018-01-14 00:34:17 UTC
Is this still relevant?
Comment 14 Andreas Neiser 2018-01-14 09:34:45 UTC
Hi,

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.
Comment 15 Walter Schwarzenfeld freebsd_triage 2018-01-14 09:40:41 UTC
Okay, thanks for reply.
Comment 16 Li-Wen Hsu freebsd_committer freebsd_triage 2020-06-17 08:18:20 UTC
fjoe: ping?
Comment 17 Rene Ladan freebsd_committer freebsd_triage 2021-12-06 12:27:22 UTC
Maintainer reset.