Rate This Document
Findability
Accuracy
Completeness
Readability

KAE Device QoS Setting

KAE devices support the quality of service (QoS) function. You can set QoS to allocate different bandwidths for KAE devices in different containers. Setting a higher KAE QoS for high-priority containers can ensure that the KAE devices in the containers have higher bandwidth, thereby guaranteeing the service quality.

  1. Add the annotation qos.kae.kunpeng.com/hisi_hpre: "500" to the YAML file of the Pod to declare the QoS of the KAE devices. For details about how to set the QoS of other devices, see Table 1.
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    apiVersion: v1
    kind: Pod
    metadata:
      name: kae-test-qos
      annotations:
        qos.kae.kunpeng.com/hisi_hpre: "500"
    spec:
      containers:
      - name: kae-test-qos
        image: kae-test:latest
        command: ["/bin/sh", "-c", "while true; do echo hello; sleep 300000; done"]
        imagePullPolicy: IfNotPresent
        resources:
          requests:
            kae.kunpeng.com/hisi_hpre: "1"
          limits:
            kae.kunpeng.com/hisi_hpre: "1"
        volumeMounts:
          - name: local-lib
            mountPath: /usr/local
      volumes:
        - name: local-lib
          hostPath:
            path: /usr/local                                     
    
    Table 1 KAE device QoS annotations

    KAE Device

    Annotation Name

    HPRE

    qos.kae.kunpeng.com/hisi_hpre

    SEC

    qos.kae.kunpeng.com/hisi_sec2

    ZIP

    qos.kae.kunpeng.com/hisi_zip

  2. Deploy the Pod as instructed in KAE Device Passthrough.
  3. Access the container and run the following command to check whether the QoS of the KAE devices is set successfully:
    kubectl exec -it kae-test-qos -- bash
    # Execute the following command in the container:
    env

    An example command output is as follows. The PCI addresses of the KAE devices that are passed through to the container are displayed.

    Based on the PCI addresses, run the following command on the physical machine to retrieve the file to check whether the QoS value is the same as that declared in the annotation:
    cat /sys/kernel/debug/hisi_hpre/0000:3a:00.0/alg_qos

    An example command output is as follows. The result is consistent with the value declared in the annotation qos.kae.kunpeng.com/hisi_hpre: "500", indicating that the QoS setting is successful.