Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-62718

[OCP][Container][SR-IOV] CNI plugin type="sriov" name="sriov-net" failed (add): failed to settle addresses for "eth0": link eth0 still has tentative addresses after 5000000000 seconds

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • 4.20, 4.21
    • Networking / SR-IOV
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • 0.3
    • Critical
    • Yes
    • x86_64
    • None
    • Rejected
    • None
    • In Progress
    • Release Note Not Required
    • None
    • None
    • None
    • None
    • None

      Description of problem:

          

      Version-Release number of selected component (if applicable):

      commit f6521457ddbea722336fd00b0f409143c11ee918
      Merge: c0811bb 2ab90d2
      Author: openshift-merge-bot[bot] <148852131+openshift-merge-bot[bot]@users.noreply.github.com>
      Date:   Wed Aug 20 07:32:40 2025 +0000
      
          Merge pull request #157 from SchSeba/merge-bot-master
          
          Merge https://github.com/k8snetworkplumbingwg/sriov-cni:master into main
      
      
      
          

      How reproducible:

      Always
          

      Steps to Reproduce:

      ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
      ::   oc_container_spoofchk_on
      ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
      
      x86_64
      :: [ 11:24:41 ] :: [  BEGIN   ] :: Running 'oc_container_spoofchk_on'
      oc_container_spoofchk_on()...
      ++ [[ spoof checking == mtu ]]
      ++ ip li set ens6f0 mtu 1500
      ++ ip li set ens6f1 mtu 1500
      ++ set +x
      Start Creating 1 VF of ens6f0, driver is ice
      PF PCI: 0000:98:00.0
      echo 1 > /sys/class/net/ens6f0/device/sriov_numvfs
      1
      10: ens6f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 50:7c:6f:3e:90:2a brd ff:ff:ff:ff:ff:ff promiscuity 0 allmulti 0 minmtu 68 maxmtu 9702 numtxqueues 80 numrxqueues 80 gso_max_size 65536 gso_max_segs 65535 tso_max_size 131072 tso_max_segs 65535 gro_max_size 65536 gso_ipv4_max_size 65536 gro_ipv4_max_size 65536 portname p0 switchid 507c6fffff3e902a parentbus pci parentdev 0000:98:00.0 
          vf 0     link/ether 0e:e9:e2:60:de:eb brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
          altname enp152s0f0
      Complete creating VF
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      2: eno8303: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
          link/ether c8:4b:d6:7b:a3:6e brd ff:ff:ff:ff:ff:ff
          altname enp4s0f0
      3: eno8403: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether c8:4b:d6:7b:a3:6f brd ff:ff:ff:ff:ff:ff
          altname enp4s0f1
      6: ens3f0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether a0:36:9f:f5:b2:04 brd ff:ff:ff:ff:ff:ff
          altname enp75s0f0
      7: ens3f1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether a0:36:9f:f5:b2:05 brd ff:ff:ff:ff:ff:ff
          altname enp75s0f1
      8: ens4f4: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 00:07:43:80:34:00 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f4
      9: ens4f4d1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 00:07:43:80:34:08 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f4d1
      10: ens6f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 50:7c:6f:3e:90:2a brd ff:ff:ff:ff:ff:ff
          vf 0     link/ether 0e:e9:e2:60:de:eb brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
          altname enp152s0f0
      11: ens6f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 50:7c:6f:3e:90:2b brd ff:ff:ff:ff:ff:ff
          altname enp152s0f1
      12: ens6f0v0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 0e:e9:e2:60:de:eb brd ff:ff:ff:ff:ff:ff
          altname enp152s0f0v0
      ++ [[ ice == cxgb4 ]]
      +++ ethtool -i ens6f0
      +++ grep bus-info
      +++ awk '{print $2}'
      ++ local pf_bus_info=0000:98:00.0
      ++ set +x
      0000:98:01.0
      Current VF name ens6f0v0
      ++ [[ ice == cxgb4 ]]
      +++ ls /sys/bus/pci/devices/0000:98:00.0/net/
      ++ local pf_name=ens6f0
      ++ ip li set ens6f0 vf 0 mac 52:54:00:11:8f:ee
      ++ sleep 1
      ++ ip li set ens6f0v0 address 52:54:00:11:8f:ee
      ++ ip li
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      2: eno8303: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
          link/ether c8:4b:d6:7b:a3:6e brd ff:ff:ff:ff:ff:ff
          altname enp4s0f0
      3: eno8403: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether c8:4b:d6:7b:a3:6f brd ff:ff:ff:ff:ff:ff
          altname enp4s0f1
      6: ens3f0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether a0:36:9f:f5:b2:04 brd ff:ff:ff:ff:ff:ff
          altname enp75s0f0
      7: ens3f1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether a0:36:9f:f5:b2:05 brd ff:ff:ff:ff:ff:ff
          altname enp75s0f1
      8: ens4f4: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 00:07:43:80:34:00 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f4
      9: ens4f4d1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 00:07:43:80:34:08 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f4d1
      10: ens6f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 50:7c:6f:3e:90:2a brd ff:ff:ff:ff:ff:ff
          vf 0     link/ether 52:54:00:11:8f:ee brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
          altname enp152s0f0
      11: ens6f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 50:7c:6f:3e:90:2b brd ff:ff:ff:ff:ff:ff
          altname enp152s0f1
      12: ens6f0v0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 52:54:00:11:8f:ee brd ff:ff:ff:ff:ff:ff
          altname enp152s0f0v0
      ++ sleep 1
      ++ sed -i s/%VF_ID%/0000:98:01.0/g /etc/cni/net.d/1-sriov-net-attach-def.conf
      ++ sed -i s/%feature_setup%/on/g /etc/cni/net.d/1-sriov-net-attach-def.conf
      ++ cat /etc/cni/net.d/1-sriov-net-attach-def.conf
      {
      "cniVersion":"0.3.1",
      "name":"sriov-net",
      "type":"sriov",
      "spoofchk": "on",
      "ipam": {
      "type":"host-local",
      "ranges":[
      [
      {
      "subnet":"192.168.111.0/24",
      "rangeStart":"192.168.111.10",
      "rangeEnd":"192.168.111.11",
      "routes":[{"dst":"0.0.0.0/0"}],
      "gateway":"192.168.111.254"
      }
      ],
      [
      {"subnet": "2001::0/64"}
      ]
      ]
      },
      "deviceID": "0000:98:01.0"
      }
      ++ set +x
      vf_driver is iavf
      temp_uuid : 54f4c3c0b6b3449b8421f46e0
      POD_ID is: 1ac7a906d7ba5132d7bbea48fa5d1fc99c6dc3d1ee3e8fa9e9709e7aef2dc3dd
      temp_name : 16f4
      PULL Image start
      CONTAINER_IMAGE : quay.io/rhn_support_hewang/container-sriov-rhel9-x86_64
      Trying to pull quay.io/rhn_support_hewang/container-sriov-rhel9-x86_64:latest...
      Getting image source signatures
      Copying blob sha256:d77aa8574845b508d5fa16c7d0d6fbfc3bd0bb3c4d68b0cf4ea6bf3f20a1b3c5
      Copying blob sha256:bfb121b74d60397e98f6a3cffdb66b045957cfab4f1d621ba2d100963084e9e1
      Copying config sha256:d26866faa541705d9683f31b5cd075b4e03197bbb31d10249a37464084950416
      Writing manifest to image destination
      d26866faa541705d9683f31b5cd075b4e03197bbb31d10249a37464084950416
      PULL Image end
      time="2025-08-29T11:25:22Z" level=warning msg="The input device is not a TTY. The --tty and --interactive flags might not work properly"
      ContainerID : 21eefdb91b28fde5416c1f1d8917bd4f87c60836b349d295eeddcae0132b7b75
      container_pid : 6411
      lrwxrwxrwx. 1 root root 0 Aug 29 11:25 /proc/6411/ns/net -> net:[4026534254]
      total 0
      drwxr-xr-x.  2 root root   60 Aug 29 11:25 .
      drwxr-xr-x. 43 root root 1100 Aug 29 11:25 ..
      lrwxrwxrwx.  1 root root   17 Aug 29 11:25 6411 -> /proc/6411/ns/net
      /var/usr/local/bin/cnitool
      plugin type="sriov" name="sriov-net" failed (add): failed to settle addresses for "eth0": link eth0 still has tentative addresses after 5000000000 seconds
      CONTAINER ID  IMAGE                                                           COMMAND     CREATED        STATUS        PORTS       NAMES
      d0eea0c270df  localhost/podman-pause:5.4.0-1750848143                                     8 seconds ago  Up 6 seconds              1ac7a906d7ba-infra
      21eefdb91b28  quay.io/rhn_support_hewang/container-sriov-rhel9-x86_64:latest  /bin/bash   5 seconds ago  Up 6 seconds              16f4
      Device "eth0" does not exist.
      Cannot get driver information: No such device
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
          inet 127.0.0.1/8 scope host lo
             valid_lft forever preferred_lft forever
          inet6 ::1/128 scope host 
             valid_lft forever preferred_lft forever
      Cannot get driver information: No such device
      Container driver is 
      Container is not using the vf driver!
      Device "eth0" does not exist.
          vf 0     link/ether 52:54:00:11:8f:ee brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
      10: ens6f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 50:7c:6f:3e:90:2a brd ff:ff:ff:ff:ff:ff
          vf 0     link/ether 52:54:00:11:8f:ee brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
          altname enp152s0f0
      1ac7a906d7ba5132d7bbea48fa5d1fc99c6dc3d1ee3e8fa9e9709e7aef2dc3dd
      1ac7a906d7ba5132d7bbea48fa5d1fc99c6dc3d1ee3e8fa9e9709e7aef2dc3dd
      Start Creating 0 VF of ens6f0, driver is ice
      PF PCI: 0000:98:00.0
      echo 0 > /sys/class/net/ens6f0/device/sriov_numvfs
      0
      10: ens6f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 50:7c:6f:3e:90:2a brd ff:ff:ff:ff:ff:ff promiscuity 0 allmulti 0 minmtu 68 maxmtu 9702 numtxqueues 80 numrxqueues 80 gso_max_size 65536 gso_max_segs 65535 tso_max_size 131072 tso_max_segs 65535 gro_max_size 65536 gso_ipv4_max_size 65536 gro_ipv4_max_size 65536 portname p0 switchid 507c6fffff3e902a parentbus pci parentdev 0000:98:00.0 
          altname enp152s0f0
      Complete creating VF
      :: [ 11:26:00 ] :: [   FAIL   ] :: Command 'oc_container_spoofchk_on' (Expected 0, got 1)
      :: [ 11:26:00 ] :: [  BEGIN   ] :: Running 'update_case_item_result oc_container_spoofchk_on 1'
      /var/mnt/tests/netqe-bj.usersys.redhat.com/share/kernel-master.tar.gz/networking/ocp/container/sriov /var/mnt/tests/netqe-bj.usersys.redhat.com/share/kernel-master.tar.gz/networking/ocp/container/sriov
      /var/mnt/tests/netqe-bj.usersys.redhat.com/share/kernel-master.tar.gz/networking/ocp/container/sriov
      
                  bkr job-results J:11600287 --no-logs --prettyxml | grep path=\"oc_container_spoofchk_on\" | tail -n 1 | grep -o -E id=\"[0-9]+\" | tr -d 'id' | tr -d '="'
                  
      
                  bkr job-logs J:11600287 | grep 
                  
      :: [ 11:26:00 ] :: [   PASS   ] :: Command 'update_case_item_result oc_container_spoofchk_on 1' (Expected 0, got 0)
      :: [ 11:26:00 ] :: [  BEGIN   ] :: Running 'sleep 10'
      :: [ 11:26:10 ] :: [   PASS   ] :: Command 'sleep 10' (Expected 0, got 0)
      ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
      ::   Duration: 89s
      ::   Assertions: 2 good, 1 bad
      ::   RESULT: FAIL (oc_container_spoofchk_on)
      
      
          

      Actual results:

      failed (add): failed to settle addresses for "eth0": link eth0 still has tentative addresses after 5000000000 seconds
          

      Expected results:

      It works fine 
      
          

      Additional info:

      with below commit 
      commit 1848287cb5c7775938212c246ea946f2e0cd3b2b
      Merge: 91f918a d7b660f
      Author: openshift-merge-bot[bot] <148852131+openshift-merge-bot[bot]@users.noreply.github.com>
      Date:   Fri May 9 05:31:10 2025 +0000
      
          Merge pull request #153 from SchSeba/merge-bot-master
          
          Merge https://github.com/k8snetworkplumbingwg/sriov-cni:master into main
      
      It works fine .
          

      Here are the failed jobs
      The models are
      e810_2cqda2
      e810_xxvda2
      https://beaker.engineering.redhat.com/jobs/11599476
      https://beaker.engineering.redhat.com/jobs/11599477
      https://beaker.engineering.redhat.com/jobs/11599512
      https://beaker.engineering.redhat.com/jobs/11599513

       

       

       

       

       

       
      https://github.com/openshift/sriov-network-operator/commit/b279c18cfb32d21a69f7dd1fdce39d1e71629eeb
       
      https://github.com/openshift/sriov-network-operator/blob/release-4.20/deploy/configmap.yaml

       

      https://docs.google.com/spreadsheets/d/109YC5YNxUflpmtMv1QxAeEQ7NRYc6bLPHnbJE9Bc75I/edit?gid=0#gid=0 

      https://docs.google.com/spreadsheets/d/109YC5YNxUflpmtMv1QxAeEQ7NRYc6bLPHnbJE9Bc75I/edit?gid=795191772#gid=795191772&range=A1

       

      What’s the regression, when was it introduced (especially since we did pretty thorough testing)

       

       

       

      wsfd-advnetlab153.anl.eng.rdu2.dc.redhat.comroot/100yard-
      [root@wsfd-advnetlab153 sriov]# pwd
      /mnt/tests/netqe-bj.usersys.redhat.com/share/kernel-master.tar.gz/networking/ocp/container/sriov[root@wsfd-advnetlab153 sriov]# cat repro.sh
      #!/bin/bash
      NIC_LIST=("enp202s0" "enp205s0")
      TEST_DRIVER=ice
      FUNCNAME=oc_container_spoofchk_on
      result=0
      feature="spoof checking"
      arg="on"
      X_VERSION=9
      
      op_vf()
      {
          local driver=$1
          local vf_num=$2
          local nic=$3
          local result=0
      
          sleep 5
      
          echo "Start Creating $vf_num VF of $nic, driver is $driver"
          local pci=$(ethtool -i $nic | grep bus-info | awk '{print $2}')
          echo "PF PCI: $pci"
          echo "echo $vf_num > /sys/class/net/$nic/device/sriov_numvfs"
          echo $vf_num > /sys/class/net/$nic/device/sriov_numvfs
          cat /sys/class/net/$nic/device/sriov_numvfs
          sleep 20
      
          created_vf=$(ip -d link show $nic | grep vf | wc -l)
          if [[ $created_vf != $vf_num ]]
          then
              ((result+=1))
          fi
      
      
          ip -d link show $nic
          ip link set $nic up
      
          echo "Complete creating VF"
      
          return $result
      }
      
      
      create_pod_with_container()
      {
          local result=0
      
          # vf driver var only used for check the container's nic driver
          local pf_driver=$1
          local pf=$2
      
          local vf_driver=iavf
      
          echo "vf_driver is $vf_driver"
      
          #Generate pod config
          temp_uuid=$(cat /proc/sys/kernel/random/uuid | sed 's/-//g' | cut -c 1-25)
          echo "temp_uuid : "${temp_uuid}
      
          # Create pod
          #local all_iso_cpus=$(cat /etc/tuned/cpu-partitioning-variables.conf | awk -F '=' '{print $NF}')
          POD_ID=$(podman pod create --network=none ${temp_uuid}) || ((result+=1))
          echo "POD_ID is: ${POD_ID}"
      
          #create container config
          temp_name=$(cat /proc/sys/kernel/random/uuid | sed 's/-//g' | cut -c 1-4)
          echo "temp_name : "${temp_name}
      
          #Get the container image
          echo "PULL Image start"
          arch_info=$(uname -m)
          CONTAINER_IMAGE="quay.io/rhn_support_hewang/container-sriov-rhel${X_VERSION}-${arch_info}"
          echo "CONTAINER_IMAGE : "${CONTAINER_IMAGE}
          podman pull ${CONTAINER_IMAGE}|| { echo "Pull container image fail"; ((result+=1)); }
          echo "PULL Image end"
      
          #Create container and pod
          CONTAINER_ID=$(
          podman run --pod ${POD_ID} -it -d --privileged \
          --name ${temp_name} \
          -v /sys/bus/pci/drivers:/sys/bus/pci/drivers \
          -v /sys/kernel/mm/hugepages:/sys/kernel/mm/hugepages \
          -v /sys/devices/system/node:/sys/devices/system/node \
          -v /dev:/dev \
          -v /lib:/lib \
          ${CONTAINER_IMAGE})
          echo "ContainerID : "${CONTAINER_ID}
      
          container_pid=$(podman inspect -f '{{.State.Pid}}' ${CONTAINER_ID})
          echo "container_pid : "${container_pid}
          mkdir -p /var/run/netns
          rm -f /var/run/netns/${container_pid}
          ls -al  /proc/${container_pid}/ns/net
          ln -s /proc/${container_pid}/ns/net /var/run/netns/${container_pid}
          ls -al /var/run/netns
      
          which cnitool || go_install_cnitool
          CNI_PATH=/var/opt/cni/bin/ cnitool add sriov-net /var/run/netns/${container_pid}
      
          # Option validation
          podman ps --all
          podman exec ${CONTAINER_ID} ip link show eth0
          podman exec ${CONTAINER_ID} ethtool -i eth0
          podman exec ${CONTAINER_ID} ip add
          container_driver=$(podman exec ${CONTAINER_ID} ethtool -i eth0 | grep "driver" | awk '{print $2}' )
          echo "Container driver is $container_driver"
          if [[ $vf_driver != $container_driver ]]
          then
              echo "Container is not using the vf driver!"
              ((result+=1))
          fi
          return $result
      }
      
      
      cat <<-EOF > /etc/cni/net.d/1-sriov-net-attach-def.conf
      {
      "cniVersion":"0.3.1",
      "name":"sriov-net",
      "type":"sriov",
      "spoofchk": "%feature_setup%",
      "ipam": {
      "type":"host-local",
      "ranges":[
      [
      {
      "subnet":"192.168.111.0/24",
      "rangeStart":"192.168.111.10",
      "rangeEnd":"192.168.111.11",
      "routes":[{"dst":"0.0.0.0/0"}],
      "gateway":"192.168.111.254"
      }
      ],
      [
      {"subnet": "2001::0/64"}
      ]
      ]
      },
      "deviceID": "%VF_ID%"
      }
      EOF
      
      
      ip li set ${NIC_LIST[0]} mtu 1500
      ip li set ${NIC_LIST[1]} mtu 1500
      op_vf ${TEST_DRIVER} 1 ${NIC_LIST[0]} || { echo "Create VF fail in test ${FUNCNAME}"; ((result+=1)); }
      ip link show
      pf_bus_info=$(ethtool -i ${NIC_LIST[0]} | grep 'bus-info'| awk '{print $2}')
      
      sleep 5
      vf_pci=$(ls -l /sys/bus/pci/devices/${pf_bus_info}/virtfn* | awk '{print $NF}' | sed 's/..\///')
      sleep 5
      echo ${vf_pci}
      
      vf_ifname=$(ls /sys/bus/pci/devices/${vf_pci}/net/)
      
      echo "Current VF name "${vf_ifname}
      nic_driver=$(ethtool -i ${NIC_LIST[0]} | grep driver | awk '{print $2}')
      
      pf_name=$(ls /sys/bus/pci/devices/${pf_bus_info}/net/)
      
      ip li set ${pf_name} vf 0 mac 52:54:00:11:8f:ee
      sleep 1
      ip li set ${vf_ifname} address 52:54:00:11:8f:ee
      ip li
      
      sed -i "s/%VF_ID%/${vf_pci}/g" /etc/cni/net.d/1-sriov-net-attach-def.conf
      sed -i "s/%feature_setup%/${arg}/g" /etc/cni/net.d/1-sriov-net-attach-def.conf
      cat /etc/cni/net.d/1-sriov-net-attach-def.conf
      
      create_pod_with_container ${TEST_DRIVER} ${NIC_LIST[0]} || ((result+=1)) # define CONTAINER_ID, POD_ID
      container_ip=$(podman exec $CONTAINER_ID ip add show eth0 | grep 192.168 | awk '{print $2}' | awk -F '/' '{print $1}')
      
      ip link show ${NIC_LIST[0]} | grep "${feature} ${arg}" || { echo "Fail to set ${feature} to ${arg}"; ((result+=1)); }
      ip link show ${NIC_LIST[0]}
      
      
      ~~~~~~~~~~~~~~~~~~~~~~~The logs of my run:
      [root@wsfd-advnetlab153 sriov]# bash -x repro.sh
      + NIC_LIST=("enp202s0" "enp205s0")
      + TEST_DRIVER=ice
      + FUNCNAME=oc_container_spoofchk_on
      + result=0
      + feature='spoof checking'
      + arg=on
      + X_VERSION=9
      + cat
      + ip li set enp202s0 mtu 1500
      + ip li set enp205s0 mtu 1500
      + op_vf ice 1 enp202s0
      + local driver=ice
      + local vf_num=1
      + local nic=enp202s0
      + local result=0
      + sleep 5
      + echo 'Start Creating 1 VF of enp202s0, driver is ice'
      Start Creating 1 VF of enp202s0, driver is ice
      ++ ethtool -i enp202s0
      ++ grep bus-info
      ++ awk '{print $2}'
      + local pci=0000:ca:00.0
      + echo 'PF PCI: 0000:ca:00.0'
      PF PCI: 0000:ca:00.0
      + echo 'echo 1 > /sys/class/net/enp202s0/device/sriov_numvfs'
      echo 1 > /sys/class/net/enp202s0/device/sriov_numvfs
      + echo 1
      + cat /sys/class/net/enp202s0/device/sriov_numvfs
      1
      + sleep 20
      ++ ip -d link show enp202s0
      ++ grep vf
      ++ wc -l
      + created_vf=1
      + [[ 1 != 1 ]]
      + ip -d link show enp202s0
      22: enp202s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 40:a6:b7:7c:85:fc brd ff:ff:ff:ff:ff:ff promiscuity 0 allmulti 0 minmtu 68 maxmtu 9702 numtxqueues 112 numrxqueues 112 gso_max_size 65536 gso_max_segs 65535 tso_max_size 131072 tso_max_segs 65535 gro_max_size 65536 gso_ipv4_max_size 65536 gro_ipv4_max_size 65536 portname p0 switchid 40a6b7ffff7c85fc parentbus pci parentdev 0000:ca:00.0
          vf 0     link/ether 52:54:00:11:8f:ee brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
      + ip link set enp202s0 up
      + echo 'Complete creating VF'
      Complete creating VF
      + return 0
      + ip link show
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      2: eno8303: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
          link/ether b0:7b:25:d4:74:3e brd ff:ff:ff:ff:ff:ff
          altname enp4s0f0
      3: eno8403: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether b0:7b:25:d4:74:3f brd ff:ff:ff:ff:ff:ff
          altname enp4s0f1
      4: eno12399np0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether e4:3d:1a:03:8b:90 brd ff:ff:ff:ff:ff:ff
          altname enp50s0f0np0
      5: eno12409np1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether e4:3d:1a:03:8b:91 brd ff:ff:ff:ff:ff:ff
          altname enp50s0f1np1
      6: ens4f0np0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 84:16:0c:64:20:50 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f0np0
      7: ens4f1np1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 84:16:0c:64:20:51 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f1np1
      8: ens4f2np2: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 84:16:0c:64:20:52 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f2np2
      9: ens4f3np3: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 84:16:0c:64:20:53 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f3np3
      14: ibs3f0: <BROADCAST,MULTICAST> mtu 4092 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/infiniband 00:00:00:71:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a3:28:88 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff
          altname ibp75s0f0
      17: ibs3f1: <BROADCAST,MULTICAST> mtu 4092 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/infiniband 00:00:01:dd:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a3:28:89 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff
          altname ibp75s0f1
      18: ens2f0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether b4:96:91:dc:72:e0 brd ff:ff:ff:ff:ff:ff
          altname enp23s0f0
      19: ens2f1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether b4:96:91:dc:72:e1 brd ff:ff:ff:ff:ff:ff
          altname enp23s0f1
      20: ens2f2: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether b4:96:91:dc:72:e2 brd ff:ff:ff:ff:ff:ff
          altname enp23s0f2
      21: ens2f3: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether b4:96:91:dc:72:e3 brd ff:ff:ff:ff:ff:ff
          altname enp23s0f3
      22: enp202s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 40:a6:b7:7c:85:fc brd ff:ff:ff:ff:ff:ff
          vf 0     link/ether 52:54:00:11:8f:ee brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
      23: enp205s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 40:a6:b7:7c:85:f8 brd ff:ff:ff:ff:ff:ff
      25: enp202s0v0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 52:54:00:11:8f:ee brd ff:ff:ff:ff:ff:ff
      ++ ethtool -i enp202s0
      ++ grep bus-info
      ++ awk '{print $2}'
      + pf_bus_info=0000:ca:00.0
      + sleep 5
      ++ ls -l /sys/bus/pci/devices/0000:ca:00.0/virtfn0
      ++ awk '{print $NF}'
      ++ sed 's/..\///'
      + vf_pci=0000:ca:01.0
      + sleep 5
      + echo 0000:ca:01.0
      0000:ca:01.0
      ++ ls /sys/bus/pci/devices/0000:ca:01.0/net/
      + vf_ifname=enp202s0v0
      + echo 'Current VF name enp202s0v0'
      Current VF name enp202s0v0
      ++ ethtool -i enp202s0
      ++ grep driver
      ++ awk '{print $2}'
      + nic_driver=ice
      ++ ls /sys/bus/pci/devices/0000:ca:00.0/net/
      + pf_name=enp202s0
      + ip li set enp202s0 vf 0 mac 52:54:00:11:8f:ee
      + sleep 1
      + ip li set enp202s0v0 address 52:54:00:11:8f:ee
      + ip li
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
      2: eno8303: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
          link/ether b0:7b:25:d4:74:3e brd ff:ff:ff:ff:ff:ff
          altname enp4s0f0
      3: eno8403: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether b0:7b:25:d4:74:3f brd ff:ff:ff:ff:ff:ff
          altname enp4s0f1
      4: eno12399np0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether e4:3d:1a:03:8b:90 brd ff:ff:ff:ff:ff:ff
          altname enp50s0f0np0
      5: eno12409np1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether e4:3d:1a:03:8b:91 brd ff:ff:ff:ff:ff:ff
          altname enp50s0f1np1
      6: ens4f0np0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 84:16:0c:64:20:50 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f0np0
      7: ens4f1np1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 84:16:0c:64:20:51 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f1np1
      8: ens4f2np2: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 84:16:0c:64:20:52 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f2np2
      9: ens4f3np3: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 84:16:0c:64:20:53 brd ff:ff:ff:ff:ff:ff
          altname enp177s0f3np3
      14: ibs3f0: <BROADCAST,MULTICAST> mtu 4092 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/infiniband 00:00:00:71:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a3:28:88 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff
          altname ibp75s0f0
      17: ibs3f1: <BROADCAST,MULTICAST> mtu 4092 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/infiniband 00:00:01:dd:fe:80:00:00:00:00:00:00:24:8a:07:03:00:a3:28:89 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff
          altname ibp75s0f1
      18: ens2f0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether b4:96:91:dc:72:e0 brd ff:ff:ff:ff:ff:ff
          altname enp23s0f0
      19: ens2f1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether b4:96:91:dc:72:e1 brd ff:ff:ff:ff:ff:ff
          altname enp23s0f1
      20: ens2f2: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether b4:96:91:dc:72:e2 brd ff:ff:ff:ff:ff:ff
          altname enp23s0f2
      21: ens2f3: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether b4:96:91:dc:72:e3 brd ff:ff:ff:ff:ff:ff
          altname enp23s0f3
      22: enp202s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 40:a6:b7:7c:85:fc brd ff:ff:ff:ff:ff:ff
          vf 0     link/ether 52:54:00:11:8f:ee brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
      23: enp205s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 40:a6:b7:7c:85:f8 brd ff:ff:ff:ff:ff:ff
      25: enp202s0v0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 52:54:00:11:8f:ee brd ff:ff:ff:ff:ff:ff
      + sed -i s/%VF_ID%/0000:ca:01.0/g /etc/cni/net.d/1-sriov-net-attach-def.conf
      + sed -i s/%feature_setup%/on/g /etc/cni/net.d/1-sriov-net-attach-def.conf
      + cat /etc/cni/net.d/1-sriov-net-attach-def.conf
      {
      "cniVersion":"0.3.1",
      "name":"sriov-net",
      "type":"sriov",
      "spoofchk": "on",
      "ipam": {
      "type":"host-local",
      "ranges":[
      [
      {
      "subnet":"192.168.111.0/24",
      "rangeStart":"192.168.111.10",
      "rangeEnd":"192.168.111.11",
      "routes":[{"dst":"0.0.0.0/0"}],
      "gateway":"192.168.111.254"
      }
      ],
      [
      {"subnet": "2001::0/64"}
      ]
      ]
      },
      "deviceID": "0000:ca:01.0"
      }
      + create_pod_with_container ice enp202s0
      + local result=0
      + local pf_driver=ice
      + local pf=enp202s0
      + local vf_driver=iavf
      + echo 'vf_driver is iavf'
      vf_driver is iavf
      ++ cat /proc/sys/kernel/random/uuid
      ++ sed s/-//g
      ++ cut -c 1-25
      + temp_uuid=8c3f1c8d37614e688b50ae341
      + echo 'temp_uuid : 8c3f1c8d37614e688b50ae341'
      temp_uuid : 8c3f1c8d37614e688b50ae341
      ++ podman pod create --network=none 8c3f1c8d37614e688b50ae341
      + POD_ID=b258747b2ad7077ea2bf7279c5600f1cd464c5fa60d4c1312ca8c9c6201b5449
      + echo 'POD_ID is: b258747b2ad7077ea2bf7279c5600f1cd464c5fa60d4c1312ca8c9c6201b5449'
      POD_ID is: b258747b2ad7077ea2bf7279c5600f1cd464c5fa60d4c1312ca8c9c6201b5449
      ++ cat /proc/sys/kernel/random/uuid
      ++ sed s/-//g
      ++ cut -c 1-4
      + temp_name=4b3c
      + echo 'temp_name : 4b3c'
      temp_name : 4b3c
      + echo 'PULL Image start'
      PULL Image start
      ++ uname -m
      + arch_info=x86_64
      + CONTAINER_IMAGE=quay.io/rhn_support_hewang/container-sriov-rhel9-x86_64
      + echo 'CONTAINER_IMAGE : quay.io/rhn_support_hewang/container-sriov-rhel9-x86_64'
      CONTAINER_IMAGE : quay.io/rhn_support_hewang/container-sriov-rhel9-x86_64
      + podman pull quay.io/rhn_support_hewang/container-sriov-rhel9-x86_64
      Trying to pull quay.io/rhn_support_hewang/container-sriov-rhel9-x86_64:latest...
      Getting image source signatures
      Copying blob bfb121b74d60 skipped: already exists  
      Copying blob d77aa8574845 skipped: already exists  
      Copying config d26866faa5 done   |
      Writing manifest to image destination
      d26866faa541705d9683f31b5cd075b4e03197bbb31d10249a37464084950416
      + echo 'PULL Image end'
      PULL Image end
      ++ podman run --pod b258747b2ad7077ea2bf7279c5600f1cd464c5fa60d4c1312ca8c9c6201b5449 -it -d --privileged --name 4b3c -v /sys/bus/pci/drivers:/sys/bus/pci/drivers -v /sys/kernel/mm/hugepages:/sys/kernel/mm/hugepages -v /sys/devices/system/node:/sys/devices/system/node -v /dev:/dev -v /lib:/lib quay.io/rhn_support_hewang/container-sriov-rhel9-x86_64
      + CONTAINER_ID=519c6ff4f71036c512aeae992a27f241a2886e32846c4e05d016ae2e026d74d1
      + echo 'ContainerID : 519c6ff4f71036c512aeae992a27f241a2886e32846c4e05d016ae2e026d74d1'
      ContainerID : 519c6ff4f71036c512aeae992a27f241a2886e32846c4e05d016ae2e026d74d1
      ++ podman inspect -f '{{.State.Pid}}' 519c6ff4f71036c512aeae992a27f241a2886e32846c4e05d016ae2e026d74d1
      + container_pid=24757
      + echo 'container_pid : 24757'
      container_pid : 24757
      + mkdir -p /var/run/netns
      + rm -f /var/run/netns/24757
      + ls -al /proc/24757/ns/net
      lrwxrwxrwx. 1 root root 0 Sep 30 14:30 /proc/24757/ns/net -> 'net:[4026538250]'
      + ln -s /proc/24757/ns/net /var/run/netns/24757
      + ls -al /var/run/netns
      total 0
      drwxr-xr-x.  2 root root  140 Sep 30 14:30 .
      drwxr-xr-x. 42 root root 1120 Sep 30 11:33 ..
      lrwxrwxrwx.  1 root root   18 Sep 30 12:43 21810 -> /proc/21810/ns/net
      lrwxrwxrwx.  1 root root   18 Sep 30 12:55 22404 -> /proc/22404/ns/net
      lrwxrwxrwx.  1 root root   18 Sep 30 14:08 23010 -> /proc/23010/ns/net
      lrwxrwxrwx.  1 root root   18 Sep 30 14:29 24189 -> /proc/24189/ns/net
      lrwxrwxrwx.  1 root root   18 Sep 30 14:30 24757 -> /proc/24757/ns/net
      + which cnitool
      + alias
      + eval declare -f
      ++ declare -f
      + /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot cnitool
      /var/usr/local/bin/cnitool
      + CNI_PATH=/var/opt/cni/bin/
      + cnitool add sriov-net /var/run/netns/24757
      plugin type="sriov" name="sriov-net" failed (add): failed to settle addresses for "eth0": link eth0 still has tentative addresses after 5000000000 seconds
      + podman ps --all
      CONTAINER ID  IMAGE                                                           COMMAND     CREATED             STATUS             PORTS       NAMES
      d0355837e37b                                                                              About a minute ago  Up About a minute              4e7abe115ebb-infra
      8225f66f52c0  quay.io/rhn_support_hewang/container-sriov-rhel9-x86_64:latest  /bin/bash   About a minute ago  Up About a minute              3a58
      84864b54a8e4                                                                              5 seconds ago       Up 6 seconds                   b258747b2ad7-infra
      519c6ff4f710  quay.io/rhn_support_hewang/container-sriov-rhel9-x86_64:latest  /bin/bash   5 seconds ago       Up 6 seconds                   4b3c
      + podman exec 519c6ff4f71036c512aeae992a27f241a2886e32846c4e05d016ae2e026d74d1 ip link show eth0
      Device "eth0" does not exist.
      + podman exec 519c6ff4f71036c512aeae992a27f241a2886e32846c4e05d016ae2e026d74d1 ethtool -i eth0
      Cannot get driver information: No such device
      + podman exec 519c6ff4f71036c512aeae992a27f241a2886e32846c4e05d016ae2e026d74d1 ip add
      1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
          link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
          inet 127.0.0.1/8 scope host lo
             valid_lft forever preferred_lft forever
          inet6 ::1/128 scope host
             valid_lft forever preferred_lft forever
      ++ podman exec 519c6ff4f71036c512aeae992a27f241a2886e32846c4e05d016ae2e026d74d1 ethtool -i eth0
      ++ grep driver
      ++ awk '{print $2}'
      Cannot get driver information: No such device
      + container_driver=
      + echo 'Container driver is '
      Container driver is
      + [[ iavf != '' ]]
      + echo 'Container is not using the vf driver!'
      Container is not using the vf driver!
      + (( result+=1 ))
      + return 1
      + (( result+=1 ))
      ++ podman exec 519c6ff4f71036c512aeae992a27f241a2886e32846c4e05d016ae2e026d74d1 ip add show eth0
      ++ grep 192.168
      ++ awk '{print $2}'
      ++ awk -F / '{print $1}'
      Device "eth0" does not exist.
      + container_ip=
      + ip link show enp202s0
      + grep 'spoof checking on'
          vf 0     link/ether 52:54:00:11:8f:ee brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
      + ip link show enp202s0
      22: enp202s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
          link/ether 40:a6:b7:7c:85:fc brd ff:ff:ff:ff:ff:ff
          vf 0     link/ether 52:54:00:11:8f:ee brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
      [root@wsfd-advnetlab153 sriov]#  

              bnemeth@redhat.com Balazs Nemeth
              rhn-support-hewang Hekai Wang
              None
              None
              Zhiqiang Fang Zhiqiang Fang
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: