Skip to content

Instantly share code, notes, and snippets.

@krsna1729
Last active December 5, 2022 07:51
Show Gist options
  • Save krsna1729/9646f76a9928764d66405a3d4e783dc6 to your computer and use it in GitHub Desktop.
Save krsna1729/9646f76a9928764d66405a3d4e783dc6 to your computer and use it in GitHub Desktop.
test dpdk testpmd k8s
FROM ubuntu:bionic as ubuntu-build
RUN apt-get update && \
apt-get -y install \
build-essential \
git \
libnuma-dev
ARG DPDK_VER='master'
ENV DPDK_DIR='/dpdk'
ENV RTE_TARGET='x86_64-native-linuxapp-gcc'
RUN git clone -b $DPDK_VER -q --depth 1 http://dpdk.org/git/dpdk-stable $DPDK_DIR 2>&1
RUN cd ${DPDK_DIR} && \
sed -ri 's,(IGB_UIO=).*,\1n,' config/common_linux* && \
sed -ri 's,(KNI_KMOD=).*,\1n,' config/common_linux* && \
make config T=x86_64-native-linuxapp-gcc && \
make -j $CPUS
ENV PATH="$PATH:$DPDK_DIR/build/app/"
---
apiVersion: v1
kind: Pod
metadata:
name: dpdk-1711
annotations:
k8s.v1.cni.cncf.io/networks: sriov-net-dpdk
spec:
containers:
- name: dpdk
image: krsna1729/dpdk:v17.11
command: [ "sleep", "100000" ]
securityContext:
capabilities:
add:
- IPC_LOCK
resources:
limits:
intel.com/sriov_vfio: '1'
---
apiVersion: v1
kind: Pod
metadata:
name: dpdk-1811
annotations:
k8s.v1.cni.cncf.io/networks: sriov-net-dpdk
spec:
containers:
- name: dpdk
image: krsna1729/dpdk:v18.11
command: [ "sleep", "100000" ]
securityContext:
capabilities:
add:
- IPC_LOCK
resources:
limits:
intel.com/sriov_vfio: '1'
---
apiVersion: v1
kind: Pod
metadata:
name: dpdk-1911
annotations:
k8s.v1.cni.cncf.io/networks: sriov-net-dpdk
spec:
containers:
- name: dpdk
image: krsna1729/dpdk:v19.11
command: [ "sleep", "100000" ]
securityContext:
capabilities:
add:
- IPC_LOCK
resources:
limits:
intel.com/sriov_vfio: '1'
@krsna1729
Copy link
Author

relevant kernel commandline

intel_iommu=on

@krsna1729
Copy link
Author

krsna1729 commented Jun 4, 2020

Update:

DPDK stable branches (not tags! note the absent v when passing --build-arg DPDK_VER)

NAME              READY   STATUS    RESTARTS   AGE
dpdk-1711         1/1     Running   0          3m5s
dpdk-1811         0/1     Error     0          3m5s
dpdk-1911         1/1     Running   0          3m5s
dpdk-2002         0/1     Error     0          3m5s

@krsna1729
Copy link
Author

@krsna1729
Copy link
Author

Relevant fix
http://git.dpdk.org/dpdk-stable/commit/?h=19.11&id=5732151922c287abf7c21b92291d041ef1cc0cdb

Tested with 20.02. Does not cleanly apply to 18.11

dpdk-1711         1/1     Running   0          44s
dpdk-1811         0/1     Error     0          44s
dpdk-1911         1/1     Running   0          44s
dpdk-2002         1/1     Running   0          44s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment