Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Feat kind support for AF_XDP device plugin #46

Merged
merged 23 commits into from Jul 18, 2023

Conversation

maryamtahhan
Copy link
Contributor

@maryamtahhan maryamtahhan commented Mar 21, 2023

depends on #57 in order to build

  • Cleanup any dead code
  • Update the documentation
  • Re-test CNDP with a physical cluster - not needed as we removed the cluster type flag

This PR enables support for deployment of the AF_XDP device plugin in kind. It's been tested with CNDP and updated CNDP to be able to work with the current implementation of the DP.

Note: one limitation for now is that the Pod requires CAP_BPF in the Kind setup. The limitation was due to the kernel.unprivileged_bpf_disabled kernel flag being set by default in the kind node. Once this was disabled everything worked as expected.

The main value prop here is to enable the spin up of a test environment in a matter of minutes as well as being a building block towards integration with BPFd

README.md Show resolved Hide resolved
constants/constants.go Outdated Show resolved Hide resolved
examples/kind-pod-spec.yaml Show resolved Hide resolved
images/amd64.dockerfile Show resolved Hide resolved
internal/bpf/xdp-pass/Makefile Outdated Show resolved Hide resolved
internal/bpf/xdp-pass/xdp_pass.c Outdated Show resolved Hide resolved
internal/deviceplugin/config.go Outdated Show resolved Hide resolved
internal/networking/kind.go Outdated Show resolved Hide resolved
internal/networking/networking.go Outdated Show resolved Hide resolved
@maryamtahhan maryamtahhan mentioned this pull request Mar 22, 2023
3 tasks
@maryamtahhan maryamtahhan marked this pull request as ready for review March 24, 2023 11:16
@maryamtahhan
Copy link
Contributor Author

Btw the changes to the makefile allow you to type make help and you will see the following:

# make help

Usage:
  make <target>
  help             Display this help.

General Build - assumes K8s environment is already setup
  docker           Build docker image
  podman           Build podman image
  undeploy         Undeploy the Deamonset
  deploy           Deploy the Deamonset and CNI

General setup
  setup-flannel    Setup flannel
  setup-multus     Setup multus

Kind Deployment - sets up a kind cluster and deploys the plugin and CNI
  del-kind         Remove a kind cluster callled af-xdp-deployment
  setup-kind       Setup a kind cluster called af-xdp-deployment
  label-kind-nodes  label the kind worker nodes with cndp="true"
  kind-deploy      Deploy the Deamonset and CNI in Kind
  run-on-kind      Setup a kind cluster and deploy the device plugin

README.md Outdated Show resolved Hide resolved
@maryamtahhan maryamtahhan marked this pull request as draft March 24, 2023 13:33
@maryamtahhan maryamtahhan marked this pull request as ready for review March 24, 2023 13:43
@maryamtahhan
Copy link
Contributor Author

Tested with CNDP

root@cndp-0-0:~# cndpfwd -c config.jsonc -L debug drop
(_lgroup                 :  69) DEBUG: CPUs configured 4 available 4
(_lgroup                 :  69) DEBUG: CPUs configured 4 available 4
(_lgroup                 :  69) DEBUG: CPUs configured 4 available 4
(_lgroup                 :  69) DEBUG: CPUs configured 4 available 4
(_lgroup                 :  69) DEBUG: CPUs configured 4 available 4
(_lgroup                 :  69) DEBUG: CPUs configured 4 available 4
(mmap_alloc              : 203) WARNING: unable to allocate 2MB hugepages, trying 4KB pages
(cne_ring_init           : 221) DEBUG: ring is not cache aligned r=0x7f9af0f5c010 aligned=0x7f9af0f5c040
(xskdev_recv_xsk_fd      : 608) DEBUG: Received /host_ok msg
(xskdev_recv_xsk_fd      : 616) DEBUG: Sent /xsk_map_fd,veth10 msg
(xskdev_recv_xsk_fd      : 625) DEBUG: waiting for the xsk_map_fd the num of tries is 1
(xskdev_recv_xsk_fd      : 628) DEBUG: the xsk_map_fd is 4
(xskdev_socket_create    : 762) INFO: xi->xsk_map_fd = 4
libbpf: can't get next link: Operation not permitted
(xskdev_socket_create    : 910) DEBUG: Program ID 0, if_index 8, if_name 'veth10'

*** CNDPFWD Forward Application, API: XSKDEV, Mode: Drop, Burst Size: 256
   Initial Thread ID    36 on lcore 0
   Forwarding Thread ID 42 on lcore 0

@maryamtahhan
Copy link
Contributor Author

I'll have a look through the CI and try to fix

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
@maryamtahhan
Copy link
Contributor Author

maryamtahhan commented May 3, 2023

Hey @garyloug

This change has been rebased on the latest main and is ready for review. It has been tested with CNDP.

In the meantime I will move on to complete the BPF map pinning changes.

depends on #57 in order to build

Thanks

@maryamtahhan
Copy link
Contributor Author

I will cleanup the suggestions that were put forward by the linter bot...

I think that the kind configuration/support as it's used for testing only - should be limited to a single pool. I will also update the code to make this explicit...

@garyloug
Copy link
Contributor

hey @maryamtahhan - is this one still relevant or superseded by "v2" #59 ?

@maryamtahhan
Copy link
Contributor Author

This is just the kind support...
#59 builds on top of it to add bpf map pinning... up to you if you prefer to review all part of 1 change or to do things staged...

if you review the kind support here alone - the bpf map pinning changes PR will become significantly smaller

garyloug
garyloug previously approved these changes Jul 14, 2023
Add basic support to deploy in slack. TODO: enable support for
virtual interfaces.

Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
@garyloug garyloug merged commit 8b58b11 into intel:main Jul 18, 2023
6 checks passed
@maryamtahhan maryamtahhan deleted the feat_kind_support branch May 13, 2024 13:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants