Bug 244004 - vxlan(4) does not support setting of tunnelfib
Summary: vxlan(4) does not support setting of tunnelfib
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Many People
Assignee: Bryan Venteicher
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2020-02-09 13:53 UTC by Luiz Amaral
Modified: 2023-01-13 05:04 UTC (History)
3 users (show)

See Also:


Attachments
Patch for vxlan tunnelfib support (2.07 KB, text/plain)
2020-02-09 13:53 UTC, Luiz Amaral
no flags Details
Patch for vxlan tunnelfib support (2.07 KB, patch)
2020-02-09 18:57 UTC, Luiz Amaral
no flags Details | Diff
VXLAN Tunnelfib patch with fib_lookup logic (2.15 KB, patch)
2021-09-23 20:01 UTC, Luiz Amaral
no flags Details | Diff
VXLAN Tunnelfib patch with fib_lookup logic (2.61 KB, patch)
2021-09-23 20:08 UTC, Luiz Amaral
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luiz Amaral 2020-02-09 13:53:03 UTC
Created attachment 211511 [details]
Patch for vxlan tunnelfib support

I have a FreeBSD router that heavily relies on two different FIBs to do its job.

I needed my vxlan interface to use a different FIB for the outgoing packets encapsulated by the interface, but I discovered that it wasn't implemented yet. 

I implemented this featured based on what was done for the gre(4) and gif(4) interfaces.
Comment 1 Luiz Amaral 2020-02-09 18:57:50 UTC
Created attachment 211517 [details]
Patch for vxlan tunnelfib support
Comment 2 Luiz Amaral 2021-03-18 19:25:01 UTC
Any progress on this issue?

Can I help with anything else here?
Comment 3 Zhenlei Huang freebsd_committer freebsd_triage 2021-07-27 03:51:25 UTC
Hi Luiz Amaral,
Some logic are missing in your patch 'Patch for vxlan tunnelfib support'. See https://cgit.freebsd.org/src/tree/sys/net/if_vxlan.c#n2536 and https://cgit.freebsd.org/src/tree/sys/net/if_vxlan.c#n2648 .
It looks good if 'fib[4,6]_lookup()' is fixed as well.

@CC Bryan Venteicher
Comment 4 Luiz Amaral 2021-09-23 20:01:00 UTC
Created attachment 228139 [details]
VXLAN Tunnelfib patch with fib_lookup logic

Hi Zhenlei,

The old patch was done against 12.1 and it looks like some things got reworked in 13.0.

I redid the patch against CURRENT and included the changes on the fib[4,6]_lookup functions. 

I did some testing on my machines and it works as expected when tunnelfib is set to a non-default FIB. 

Let me know what you think. 

Luiz
Comment 5 Luiz Amaral 2021-09-23 20:08:52 UTC
Created attachment 228140 [details]
VXLAN Tunnelfib patch with fib_lookup logic

I forgot to include the manpage on the previous patch. This one has it.
Comment 6 Zhenlei Huang freebsd_committer freebsd_triage 2021-09-24 08:31:49 UTC
(In reply to Luiz Amaral from comment #5)
The patch looks good to me now.
PS: Since STABLE/13 the routing part has changed significantly, see the release note: https://www.freebsd.org/releases/13.0R/relnotes/#network-routing
Comment 7 Luiz Amaral 2021-10-13 16:56:50 UTC
(In reply to Zhenlei Huang from comment #6)
Thank you!

Do I need to do anything else now or do we just wait for Bryan's review?
Comment 8 Zhenlei Huang freebsd_committer freebsd_triage 2021-11-03 12:22:32 UTC
(In reply to Luiz Amaral from comment #7)
It seems Bryan is out of bandwidth.

Created code review request with slight modification. See https://reviews.freebsd.org/D32820
Comment 9 commit-hook freebsd_committer freebsd_triage 2022-07-08 18:19:14 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=7f7a804ae077a0c43d8c3f1444f90bdfb841c6b1

commit 7f7a804ae077a0c43d8c3f1444f90bdfb841c6b1
Author:     Zhenlei Huang <zlei.huang@gmail.com>
AuthorDate: 2022-07-08 18:12:14 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2022-07-08 18:14:19 +0000

    vxlan: Add support for socket ioctls SIOC[SG]TUNFIB

    Submitted by: Luiz Amaral <email@luiz.eng.br>
    PR: 244004
    Differential Revision:  https://reviews.freebsd.org/D32820
    MFC after:      2 weeks

 sbin/ifconfig/ifconfig.8 |  5 +++--
 sys/net/if_vxlan.c       | 27 +++++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 4 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-01-11 10:40:27 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8819353dd0dfddb9bcd156a2773efc3770d09eff

commit 8819353dd0dfddb9bcd156a2773efc3770d09eff
Author:     Zhenlei Huang <zlei.huang@gmail.com>
AuthorDate: 2022-07-08 18:12:14 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-01-11 10:35:59 +0000

    vxlan: Add support for socket ioctls SIOC[SG]TUNFIB

    Submitted by: Luiz Amaral <email@luiz.eng.br>
    PR:     244004
    Reviewed by:    gbe (manpages), melifaro, pauamma (manpages)
    Approved by:    kp (mentor)
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D32820

    (cherry picked from commit 7f7a804ae077a0c43d8c3f1444f90bdfb841c6b1)

 sbin/ifconfig/ifconfig.8 |  5 +++--
 sys/net/if_vxlan.c       | 27 +++++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 4 deletions(-)
Comment 11 commit-hook freebsd_committer freebsd_triage 2023-01-13 04:34:19 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=40beb4ae59ce85c3139539d87ad52a777ee2cbf4

commit 40beb4ae59ce85c3139539d87ad52a777ee2cbf4
Author:     Zhenlei Huang <zlei.huang@gmail.com>
AuthorDate: 2022-07-08 18:12:14 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-01-13 04:30:20 +0000

    vxlan: Add support for socket ioctls SIOC[SG]TUNFIB

    Submitted by: Luiz Amaral <email@luiz.eng.br>
    PR:     244004
    Reviewed by:    gbe (manpages), melifaro, pauamma (manpages)
    Approved by:    kp (mentor)
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D32820

    (cherry picked from commit 7f7a804ae077a0c43d8c3f1444f90bdfb841c6b1)
    (cherry picked from commit 8819353dd0dfddb9bcd156a2773efc3770d09eff)

 sbin/ifconfig/ifconfig.8 |  5 +++--
 sys/net/if_vxlan.c       | 26 +++++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 3 deletions(-)