Container support for TSN: time sync stopped when nic is pci-passthrogh into container

Bug #1838744 reported by XuYizhou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Invalid
Low
Brent Rowsell

Bug Description

Brief Description
-----------------
There is conflict between applying PCI passthrough for TSN Nic to run TSN application in container workload with STX current support for PTP: STX run p4p4l and phc2sys in host and the system time can be used by container directly while after applying PCI-pt, ptp4l and phc2sys cannot run in host.

Severity
--------

Steps to Reproduce
------------------
# create pod for TSN application
kubectl -f apply tsn_pod.yaml

# get PID of tsn contanier
PID=sudo docker inspect -f '{{.State.Pid}}' $container_id

# create network namespace entry for host
sudo ln -sf /proc/$PID/ns/net "/var/run/netns/tsn_pod_from_k8s"

# move tsn_nic(enp2s0) to container namespace
sudo ip link set enp2s0 netns tsn_pod_from_k8s

# see the tsn nic from internal of container
kubectl exec -it tsn_pod bash
(tsn_pod_Internal):/ ip a
.....
.....
.....
98: enp2s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:1b:21:00:00:00 brd ff:ff:ff:ff:ff:ff
.....
.....

Expected Behavior
------------------
host can still sync with PTP grandmaster clock outside/ or serve as grandmaster clock

Actual Behavior
----------------
sync stopped

Reproducibility
---------------
100% reproducible

System Configuration
--------------------
AIO node

Branch/Pull Time/Commit
-----------------------
iso version:20190607T142331Z

Last Pass
---------
None

Timestamp/Logs
--------------
content of tsn_pod.yaml
''''
apiVersion: v1
kind: Pod
metadata:
  name: tsn-pod-priviledge
spec:
  containers:
  - name: tsn-pod
    image: ubuntu:19.04
    args:
    - sleep
    - "1000000"
    securityContext:
      privileged: true
''''
Test Activity
-------------
Other?
[Sanity, Feature Testing, Regression Testing, Developer Testing, Evaluation, Other - Please specify]

Story Page: https://storyboard.openstack.org/#!/story/2005516

XuYizhou (xyz4berserk)
tags: removed: container for support tsn
Revision history for this message
Brent Rowsell (brent-rowsell) wrote :

Which NIC interface are you moving to the container ?
This is not the right way to expose a PCI device to a container. Please refer to sriov-cni/device plugin.

Changed in starlingx:
status: New → Incomplete
Revision history for this message
XuYizhou (xyz4berserk) wrote :

The nic i moved into container is just for ptp sync.it didn't have any other role to play in stalingX.
Is sriov the only way for pci-passthrough in stx? The nic i used (Intel I210) didn't support sriov.

Revision history for this message
XuYizhou (xyz4berserk) wrote :

Since it's related to TSN application enable for container workload, suggest to postpone in STX3.0 version.

Revision history for this message
Brent Rowsell (brent-rowsell) wrote :

You would configure the interface through sysinv as pci-passthrough. You can expose to the container using the same mechanism as sr-iov.

There is no bug here, if changes are required it would need to be done under a feature to support TSN within a container.

Changed in starlingx:
status: Incomplete → Invalid
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
assignee: nobody → Brent Rowsell (brent-rowsell)
tags: added: stx.containers
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.