Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Jan 2015 18:36:00 +0300
From:      "Alexander V. Chernikov" <melifaro@yandex-team.ru>
To:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   host pipes and netmap 'emulated mode'
Message-ID:  <54A6BAE0.9020404@yandex-team.ru>

next in thread | raw e-mail | index | archive | help
Hello list.

It looks like it is impossible to use host pipes and emulated netmap
mode in some cases.

For example, if you're doing something like what traditional router do:
packet processing, with kernel-visible logical interfaces, routing
daemon running there, you can easily get a panic like this:

#0 0xffffffff8094aa76 at kdb_backtrace+0x66
#1 0xffffffff809104ee at panic+0x1ce
#2 0xffffffff80cf9660 at trap_fatal+0x290
#3 0xffffffff80cf99c1 at trap_pfault+0x211
#4 0xffffffff80cf9f89 at trap+0x329
#5 0xffffffff80ce30d3 at calltrap+0x8
#6 0xffffffff809d3b5f at ether_demux+0x6f
#7 0xffffffff809d3f34 at ether_nh_input+0x204
#8 0xffffffff809dd6d8 at netisr_dispatch_src+0x218
#9 0xffffffff8061b2b5 at netmap_send_up+0x35
#10 0xffffffff8061b3d7 at netmap_txsync_to_host+0x97
#11 0xffffffff8061b400 at netmap_txsync_to_host_compat+0x10
#12 0xffffffff8061de8c at netmap_poll+0x2fc
#13 0xffffffff807f2313 at devfs_poll_f+0x63
#14 0xffffffff8095ea3d at sys_poll+0x35d
#15 0xffffffff80cf8e0a at amd64_syscall+0x5ea
#16 0xffffffff80ce33b7 at Xfast_syscall+0xf7
Uptime: 4m21s

The problem here is the following:
netmap changes if_input() for the logical network interface and always
assumes that generic_rx_handler() is called with netmap-enabled ifp
(e.g. original inteface).
Unfortunately, there are cases where we have different ifp passed to
if_input handler. This particular case is triggered by
  (*ifp->if_input)(ifv->ifv_ifp, m);
line, where "ifp" represents netmap-enabled NIC, and ifv->ifv_ifp
represents vlan subinterface.

Then, generic_rx_handler() tries to looking NA/GNA structure but fails
since vlan subinterface is not netmap-enabled.
So, it looks like that we need a way to call original if_input() but I
can't imagine (good) one/




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54A6BAE0.9020404>