Bug 1989342 - containernetworking-plugins: Add dpdk support to host-device plugin
Summary: containernetworking-plugins: Add dpdk support to host-device plugin
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Networking
Version: 4.9
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
: 4.9.0
Assignee: Douglas Smith
QA Contact: zhaozhanqi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-03 02:39 UTC by Aaron Smith
Modified: 2021-10-18 17:44 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:43:52 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift containernetworking-plugins pull 51 0 None None None 2021-08-18 20:05:06 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:44:03 UTC

Description Aaron Smith 2021-08-03 02:39:24 UTC
1. Feature Overview
    Make host-device plugin as a placeholder for a DPDK device when applications wants to attach the host-device with a pod container through network attachment definition.

Name of feature: Add DPDK support to the host-device plugin

2. Feature Details
    The feature allows PCI devices that have been bound to a non-kernel driver to be attach to a pod.  The feature skips actions tied to kernel netdev (e.g. IPAM) in a similar way as the SR-IOV CNI plugin.  Kubernetes users would not need to use a special CNI plugin (i.e. NO-OP) when using virtio-net devices bound to the vfio driver.

3. Business Justification
    Enables the use of accelerated OVS/OVN-dpdk interfaces in a Shift on Stack deployment.  

Business impact?
To be updated

The feature has already been implemented upstream and this request to include the upstream feature in the downstream release.

https://github.com/containernetworking/plugins/pull/490

Comment 2 zhaozhanqi 2021-08-23 03:19:46 UTC
Verified this bug on 4.9.0-0.nightly-2021-08-19-180334

1. setup sriov operator with 4.9 version

2. init dpdk VF with following apiVersion: sriovnetwork.openshift.io/v1
kind: SriovNetworkNodePolicy
metadata:
  name: intel-dpdk
  namespace: openshift-sriov-network-operator
spec:
  deviceType: vfio-pci
  mtu: 1700
  nicSelector:
    deviceID: "158b"
    pfNames:
      - ens1f1
    rootDevices:
      - '0000:3b:00.1'
    vendor: '8086'
  nodeSelector:
    feature.node.kubernetes.io/sriov-capable: 'true'
  numVfs: 2
  priority: 99
  resourceName: inteldpdk


3. Check the VF pciAddress

    vendor: "8086"
  - Vfs:
    - deviceID: 154c
      driver: vfio-pci
      pciAddress: 0000:3b:0a.0
      vendor: "8086"
      vfID: 0
    - deviceID: 154c
      driver: vfio-pci
      pciAddress: 0000:3b:0a.1
      vendor: "8086"
      vfID: 1


4. Create net-attach-def in namespace z1

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: host-device
spec:
  config: '{
      "cniVersion": "0.3.1",
      "type": "host-device",
      "pciBusID": "0000:3b:0a.0"
    }'

5. oc annotate net-attach-def host-device k8s.v1.cni.cncf.io/resourceName=openshift.io/inteldpdk -n z1

6. Create test pod with above net-attach-def

# cat pod/z1/intel-dpdk.yaml-hostdevice 
apiVersion: v1
kind: Pod
metadata:
  generateName: testpod1-
  labels:
    env: test
  annotations:
    k8s.v1.cni.cncf.io/networks: host-device
spec:
  containers:
  - name: appcntr1
    image: quay.io/openshifttest/hello-sdn@sha256:d5785550cf77b7932b090fcd1a2625472912fb3189d5973f177a5a2c347a1f95
    imagePullPolicy: IfNotPresent


7. Check the pod is running 

# oc get pod -n z1
NAME             READY   STATUS    RESTARTS   AGE
testpod1-lwz28   1/1     Running   0          14m

# oc rsh -n z1 testpod1-lwz28
/ # env | grep -i pci
PCIDEVICE_OPENSHIFT_IO_INTELDPDK=0000:3b:0a.1


Move this to verified.

Comment 5 errata-xmlrpc 2021-10-18 17:43:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:3759


Note You need to log in before you can comment on or make changes to this bug.