Discuss:

    Two Things That Don't Work Together:  Tap and Tap-inject

In today's world of discord, we often stray into territory that seems
benign and harmless;  a world that should be harmonious and
fruitful.  Yet, a cursory inspection yields quizzical behavior, mysterious
happenings, and hidden messages.  This is the world of Tap and
Tap-injection after lifting the rock cap hiding them.

A simplistic approach would start with the tried-and-true invocation of
VPP using an interactive unix clause.  For those not in the know, who
suspect an arcane craft is at work, the following could be used:

    $ vppctl unix { interactive cli-listen /run/vpp/cli.sock gid vpp }

Lo!  The hidden messages are quick to appear!  Some of the most unusual
are these:

    0: tap_inject_is_config_enabled:140: tap_inject_is_config_enabled:
Value of im->flags is 0
    0: tap_inject_sw_interface_add_del:706:
tap_inject_sw_interface_add_del: tap_inject is disabled in config

The astute would be quick to see that the messages appear for each interface
configured on the system.  And that they pertain to the mysteries at hand:
Tap-injection.

To verify that all is well, invoke the powerful VPP controller and create a
tap!

    vpp# create tap host-if-name bob id 23
    0: tap_inject_is_config_enabled:140: tap_inject_is_config_enabled:
Value of im->flags is 0
    0: tap_inject_sw_interface_add_del:706:
tap_inject_sw_interface_add_del: tap_inject is disabled in config
    vpp#

As if my magic call-backs, the same messages appear again on the VPP
console.
Do not be lured into a false sense of security, believing all is puppies and
pink unicorns.  There is hidden woe here.

And here is the ominous part.  Enable tap-inject.  All should be well,
right?
All the taps and tap-derivatives should be aware and pleased with each
other.
But no.

    vpp# enable tap-inject

Argh!  Ho. Ly. Cow!  There are more hidden messages!  A lot!

0: tap_inject_iface_isr:572: tap_inject_iface_isr: Enable: sw_if_index 1
0: tap_inject_iface_isr:611: tap_inject_iface_isr: creating host intf for
sw_if_index 1
0: tap_inject_tap_connect:151: tap_inject_tap_connect: sw_if_index 1 thread
0 fd 35
0: tap_inject_tap_connect:168: tap_inject_tap_connect: Found fd 35 for
thread 0
0: tap_inject_tap_connect:197: tap_inject_tap_connect: Setting hardware
address : 0:8:162:11:33:50
0: tap_inject_tap_connect:221: tap_inject_tap_connect: tap_if_index is 401
0: tap_inject_tap_connect:224: tap_inject_tap_connect: Mapping sw_if_index
1 tap_fd 35 tap_if_index 401 thread 0
0: tap_inject_iface_isr:572: tap_inject_iface_isr: Enable: sw_if_index 2
0: tap_inject_iface_isr:611: tap_inject_iface_isr: creating host intf for
sw_if_index 2
0: tap_inject_tap_connect:151: tap_inject_tap_connect: sw_if_index 2 thread
0 fd 36
0: tap_inject_tap_connect:168: tap_inject_tap_connect: Found fd 36 for
thread 0
0: tap_inject_tap_connect:197: tap_inject_tap_connect: Setting hardware
address : 0:8:162:11:33:51
0: tap_inject_tap_connect:221: tap_inject_tap_connect: tap_if_index is 402
0: tap_inject_tap_connect:224: tap_inject_tap_connect: Mapping sw_if_index
2 tap_fd 36 tap_if_index 402 thread 0
0: tap_inject_iface_isr:572: tap_inject_iface_isr: Enable: sw_if_index 3
0: tap_inject_iface_isr:611: tap_inject_iface_isr: creating host intf for
sw_if_index 3
0: tap_inject_tap_connect:151: tap_inject_tap_connect: sw_if_index 3 thread
0 fd 37
0: tap_inject_tap_connect:168: tap_inject_tap_connect: Found fd 37 for
thread 0
0: tap_inject_tap_connect:197: tap_inject_tap_connect: Setting hardware
address : 0:8:162:11:33:52
0: tap_inject_tap_connect:221: tap_inject_tap_connect: tap_if_index is 403
0: tap_inject_tap_connect:224: tap_inject_tap_connect: Mapping sw_if_index
3 tap_fd 37 tap_if_index 403 thread 0
0: tap_inject_iface_isr:572: tap_inject_iface_isr: Enable: sw_if_index 4
0: tap_inject_iface_isr:611: tap_inject_iface_isr: creating host intf for
sw_if_index 4
0: tap_inject_tap_connect:151: tap_inject_tap_connect: sw_if_index 4 thread
0 fd 38
0: tap_inject_tap_connect:168: tap_inject_tap_connect: Found fd 38 for
thread 0
0: tap_inject_tap_connect:197: tap_inject_tap_connect: Setting hardware
address : 0:8:162:11:33:53
0: tap_inject_tap_connect:221: tap_inject_tap_connect: tap_if_index is 404
0: tap_inject_tap_connect:224: tap_inject_tap_connect: Mapping sw_if_index
4 tap_fd 38 tap_if_index 404 thread 0
0: tap_inject_iface_isr:572: tap_inject_iface_isr: Enable: sw_if_index 5
0: tap_inject_iface_isr:611: tap_inject_iface_isr: creating host intf for
sw_if_index 5
0: tap_inject_tap_connect:151: tap_inject_tap_connect: sw_if_index 5 thread
0 fd 39
0: tap_inject_tap_connect:168: tap_inject_tap_connect: Found fd 39 for
thread 0
0: tap_inject_tap_connect:197: tap_inject_tap_connect: Setting hardware
address : 2:254:145:56:99:30
0: tap_inject_tap_connect:221: tap_inject_tap_connect: tap_if_index is 405
0: tap_inject_tap_connect:224: tap_inject_tap_connect: Mapping sw_if_index
5 tap_fd 39 tap_if_index 405 thread 0

But that is expected, right Padawan?  All those interfaces now have new
knobs
and taps.  Some might even have complete tap and die sets; who knows!

However, at this point, the trap has been spring!

    vpp# create tap host-if-name alice id 101
    create tap: bind: Address already in use

There it is.  The missing proof that Tap and Tap-inject are not quite the
bosom buddies we'd like to think they are.  It's a grim situation.   Ask me
"How grim is it?"  It is this grim:

    vpp# disable tap-inject
    0: tap_inject_disable:221: tap-inject is not actually disabled.

There is no return, no recovery.  It is very grim.

And so ends this tale of two taps, locked together in a grisly fate.
If only there was some hope, some ray of light, some bug-fix on
the horizon.  Yes, then the two taps, Tap and Tap-inject, could live
together in the same application.  Surely peace and harmony, kittens
and pink unicorns would frolic, and all would well again.

Perhaps the truth is out there somewhere.

jdl

Reply via email to