-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
In bpfman, 0 is a valid priority:
[root@centos9-bpfman bpfman]# target/debug/bpfman load image --image-url quay.io/bpfman-bytecode/xdp_pass:lat
est --programs xdp:pass --application XdpPassProgram
Bpfman State
BPF Function: pass
Program Type: xdp
Image URL: quay.io/bpfman-bytecode/xdp_pass:latest
Pull Policy: IfNotPresent
Global: None
Metadata: bpfman_application=XdpPassProgram
Map Pin Path: /run/bpfman/fs/maps/262
Map Owner ID: None
Maps Used By: 262
Links: None
Kernel State
Program ID: 262
BPF Function: pass
Kernel Type: xdp
Loaded At: 2025-10-21T10:27:16-0400
Tag: 4b9d1b2c140e87ce
GPL Compatible: true
Map IDs: [45]
BTF ID: 120
Size Translated (bytes): 96
JITted: true
Size JITted: 68
Kernel Allocated Memory (bytes): 4096
Verified Instruction Count: 9
[root@centos9-bpfman bpfman]# target/debug/bpfman attach 262 xdp --iface eth1 --priority 0
Bpfman State
BPF Function: pass
Program Type: xdp
Program ID: 262
Link ID: 3765691113
Interface: eth1
Priority: 0
Position: 0
Proceed On: pass, dispatcher_return
Network Namespace: None
Metadata: bpfman_application=XdpPassProgram
[root@centos9-bpfman bpfman]# target/debug/bpfman list programs
Program ID Application Type Function Name Links
262 XdpPassProgram xdp pass (1) 3765691113
[root@centos9-bpfman bpfman]# target/debug/bpfman unload 262
[root@centos9-bpfman bpfman]# target/debug/bpfman list links
Program ID Link ID Application Type Function Name Attachment
[root@centos9-bpfman bpfman]# target/debug/bpfman list programs
Program ID Application Type Function Name Links
Applying with bpfman-operator - -1 is correctly rejected.
[root@centos9-bpfman bpfman]# kubectl apply -f /root/bytecode.yaml
The ClusterBpfApplication "go-xdp-counter-example" is invalid: spec.programs[0].xdp.links[0].priority: Invalid value: -1: spec.programs[0].xdp.links[0].priority in body should be greater than or equal to 0
Applying with priority 0:
[root@centos9-bpfman bpfman]# vim /root/bytecode.yaml
[root@centos9-bpfman bpfman]# cat /root/bytecode.yaml
---
apiVersion: bpfman.io/v1alpha1
kind: ClusterBpfApplication
metadata:
labels:
app.kubernetes.io/name: xdpprogram
name: go-xdp-counter-example
spec:
# Select all nodes
nodeSelector: {}
byteCode:
image:
url: quay.io/bpfman-bytecode/go-xdp-counter:latest
programs:
- name: xdp_stats
type: XDP
xdp:
links:
- interfaceSelector:
primaryNodeInterface: true
priority: 0
[root@centos9-bpfman bpfman]# kubectl apply -f /root/bytecode.yaml
Yields priority 1000, though:
[root@centos9-bpfman bpfman]# kubectl get clusterbpfapplicationstate -o yaml
apiVersion: v1
items:
- apiVersion: bpfman.io/v1alpha1
kind: ClusterBpfApplicationState
metadata:
creationTimestamp: "2025-10-21T15:49:22Z"
finalizers:
- bpfman.io.clbpfapplicationcontroller/finalizer
generation: 1
labels:
bpfman.io/ownedByProgram: go-xdp-counter-example
kubernetes.io/hostname: bpfman-deployment-control-plane
name: go-xdp-counter-example-0526083e
ownerReferences:
- apiVersion: bpfman.io/v1alpha1
blockOwnerDeletion: true
controller: true
kind: ClusterBpfApplication
name: go-xdp-counter-example
uid: 5ae63c5a-8f5e-4e45-ad2f-51f51fd5cb6d
resourceVersion: "1162"
uid: ec4250f8-1105-40c4-8b3d-58b4da3284de
status:
appLoadStatus: LoadSuccess
conditions:
- lastTransitionTime: "2025-10-21T15:49:33Z"
message: The BPF application has been successfully loaded and attached
reason: Success
status: "True"
type: Success
node: bpfman-deployment-control-plane
programs:
- name: xdp_stats
programId: 1050
programLinkStatus: Success
type: XDP
xdp:
links:
- interfaceName: eth0
linkId: 873034001
linkStatus: Attached
priority: 1000
proceedOn:
- Pass
- DispatcherReturn
shouldAttach: true
uuid: 21f86d63-9bd6-41cb-b1ee-9340f4a16ab3
updateCount: 2
kind: List
metadata:
resourceVersion: ""
From the container:
root@bpfman-deployment-control-plane:/# ./bpfman get link 873034001
Bpfman State
BPF Function: xdp_stats
Program Type: xdp
Program ID: 1050
Link ID: 873034001
Interface: eth0
Priority: 1000
Position: 0
Proceed On: pass, dispatcher_return
Network Namespace: None
Metadata: bpfman.io/uuid=21f86d63-9bd6-41cb-b1ee-9340f4a16ab3
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
🆕 New