Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AF_XDP support #849

Merged
merged 2 commits into from
Apr 25, 2023
Merged

Conversation

glazychev-art
Copy link
Contributor

@glazychev-art glazychev-art commented Apr 10, 2023

Description

This PR adds AF_XDP support for the management interface.

Main changes:

  1. eBPF program (afxdp.c) that decides whether packets are to be forwarded to user or to kernel space.
  2. VPP af_xdp API call
  3. Work with neighbors. The difficulty is that after creating the XDP interface, we no longer have the ability to redirect ARP (ND) requests to both user and kernel spaces.

Issue: #283

@glazychev-art glazychev-art force-pushed the af_xdp branch 4 times, most recently from 9be0582 to 4f1a810 Compare April 11, 2023 06:00
internal/afxdp/afxdp.c Show resolved Hide resolved
internal/afxdp/afxdp.c Show resolved Hide resolved
internal/afxdp/afxdp.c Outdated Show resolved Hide resolved
internal/vppinit/vppinit.go Outdated Show resolved Hide resolved
internal/vppinit/vppinit.go Outdated Show resolved Hide resolved
internal/vppinit/vppinit.go Outdated Show resolved Hide resolved
} else { // If we don't have a VPPAPISocket, start VPP and use that
if err = cfg.VppInit.Decode("AF_PACKET"); err != nil {

if err = cfg.VppInit.Decode("NONE"); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that this if branch comes from the main. But the decode looks unnecessary here. I think we should do decode once on env config decoding.

Copy link
Contributor Author

@glazychev-art glazychev-art Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Decode("NONE") was added for Calico-VPP.
Since forwarder uses an external VppAPISocket, Calico already created a management interface and we don't need to do it again (even if the settings has "AF_PACKET" or "AF_XDP").

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
@glazychev-art glazychev-art marked this pull request as ready for review April 24, 2023 11:31
Copy link
Member

@denis-tingaikin denis-tingaikin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edwarnicke Do you have any comments?

@denis-tingaikin
Copy link
Member

@edwarnicke Feel free to add comments on these changes and we'll consider them in separate PR.

@denis-tingaikin denis-tingaikin merged commit a15565e into networkservicemesh:main Apr 25, 2023
nsmbot pushed a commit to networkservicemesh/deployments-k8s that referenced this pull request Apr 25, 2023
…d-forwarder-vpp@main

PR link: networkservicemesh/cmd-forwarder-vpp#849

Commit: a15565e
Author: Artem Glazychev
Date: 2023-04-25 16:20:27 +0700
Message:
  - Add AF_XDP support (#849)
* Add AF_XDP support

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

* Fix review comments

Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>

---------

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit that referenced this pull request Sep 13, 2024
…k-vpp@main

PR link: networkservicemesh/sdk-vpp#849

Commit: d1cb444
Author: Nikita Skrynnik
Date: 2024-09-13 19:32:28 +0700
Message:
  - add logs before creating and deleting tap intefaces (#849)
Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants