Thread (19 messages) flat view 19 messages, 3 authors, 2018-11-27

Re: [RFC v4 3/5] vxlan: add support for underlay in non-default VRF

From: Alexis Bauvin <hidden>
Date: 2018-11-27 03:28:56

Le 22 nov. 2018 à 18:19, David Ahern [off-list ref] a écrit :
On 11/21/18 6:07 PM, Alexis Bauvin wrote:
quoted
Creating a VXLAN device with is underlay in the non-default VRF makes
egress route lookup fail or incorrect since it will resolve in the
default VRF, and ingress fail because the socket listens in the default
VRF.

This patch binds the underlying UDP tunnel socket to the l3mdev of the
lower device of the VXLAN device. This will listen in the proper VRF and
output traffic from said l3mdev, matching l3mdev routing rules and
looking up the correct routing table.

When the VXLAN device does not have a lower device, or the lower device
is in the default VRF, the socket will not be bound to any interface,
keeping the previous behaviour.

The underlay l3mdev is deduced from the VXLAN lower device
(IFLA_VXLAN_LINK).

+----------+                         +---------+
|          |                         |         |
| vrf-blue |                         | vrf-red |
|          |                         |         |
+----+-----+                         +----+----+
    |                                    |
    |                                    |
+----+-----+                         +----+----+
|          |                         |         |
| br-blue  |                         | br-red  |
|          |                         |         |
+----+-----+                         +---+-+---+
    |                                   | |
    |                             +-----+ +-----+
    |                             |             |
+----+-----+                +------+----+   +----+----+
|          |  lower device  |           |   |         |
|   eth0   | <- - - - - - - | vxlan-red |   | tap-red | (... more taps)
|          |                |           |   |         |
+----------+                +-----------+   +---------+

Signed-off-by: Alexis Bauvin <redacted>
Reviewed-by: Amine Kherbouche <redacted>
Tested-by: Amine Kherbouche <redacted>
---
drivers/net/vxlan.c                           | 32 +++++--
.../selftests/net/test_vxlan_under_vrf.sh     | 90 +++++++++++++++++++
2 files changed, 114 insertions(+), 8 deletions(-)
create mode 100755 tools/testing/selftests/net/test_vxlan_under_vrf.sh
Reviewed-by: David Ahern <redacted>

Thanks for adding the test case; I'll try it out next week (after the
holidays).
Thanks for the review. I’ll send a v5 if you have no other comment on
this version!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help