Bug 2230001

Summary: default permissions in /etc/sysconfig/openvswith prevents dpdk from accessing hugepages
Product: Red Hat Enterprise Linux Fast Datapath Reporter: Vladimir Benes <vbenes>
Component: DPDKAssignee: Open vSwitch development team <ovs-team>
DPDK sub component: ovs-dpdk QA Contact: liting <tli>
Status: NEW --- Docs Contact:
Severity: unspecified    
Priority: unspecified CC: ctrautma, ktraynor, qding
Version: FDP 22.J   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vladimir Benes 2023-08-08 13:13:46 UTC
Description of problem:
when I have a box with two VFs switched to vfio-pci driver I cannot restart openvswitch service with default permissions in /etc/sysconfig/openvswitch (openvswitch:hugetlbfs)
but I can after changing those to root:root

The system is booted with biosdevname=1 default_hugepagesz=1G hugepagesz=1G hugepages=32 iommu=on intel_iommu=pt kernel options

Version-Release number of selected component (if applicable):
dpdk-22.11-4.el9.x86_64
openvswitch2.17-2.17.0-98.el9fdp.x86_64
kernel-5.14.0-350.el9.x86_64

How reproducible:
always

Steps to Reproduce:
[root@dell-per720-03 ~]# echo 2 > /sys/class/net/p4p1/device/sriov_numvfs
[root@dell-per720-03 ~]# dpdk-devbind.py -b vfio-pci 0000:42:10.2
[root@dell-per720-03 ~]# dpdk-devbind.py -b vfio-pci 0000:42:10.0
[root@dell-per720-03 ~]# systemctl restart openvswitch
[root@dell-per720-03 ~]# vi /etc/sysconfig/openvswitch (I've changed the permissions back to openvswitch:hugetlbfs)
[root@dell-per720-03 ~]# systemctl restart openvswitch

Actual results:
A dependency job for openvswitch.service failed. See 'journalctl -xe' for details.

Expected results:
correct openvswitch service restart

Additional info:
whole log here:
2023-08-08T12:37:51.918Z|00001|vlog|INFO|opened log file /var/log/openvswitch/ovs-vswitchd.log
2023-08-08T12:37:51.993Z|00002|ovs_numa|INFO|Discovered 12 CPU cores on NUMA node 1
2023-08-08T12:37:51.993Z|00003|ovs_numa|INFO|Discovered 12 CPU cores on NUMA node 0
2023-08-08T12:37:51.993Z|00004|ovs_numa|INFO|Discovered 2 NUMA nodes and 24 CPU cores
2023-08-08T12:37:51.993Z|00005|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connecting...
2023-08-08T12:37:51.993Z|00006|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connected
2023-08-08T12:37:51.997Z|00007|dpdk|INFO|Using DPDK 21.11.2
2023-08-08T12:37:51.997Z|00008|dpdk|INFO|DPDK Enabled - initializing...
2023-08-08T12:37:51.997Z|00009|dpdk|INFO|No vhost-sock-dir provided - defaulting to /var/run/openvswitch
2023-08-08T12:37:51.997Z|00010|dpdk|INFO|IOMMU support for vhost-user-client disabled.
2023-08-08T12:37:51.997Z|00011|dpdk|INFO|POSTCOPY support for vhost-user-client disabled.
2023-08-08T12:37:51.997Z|00012|dpdk|INFO|Per port memory for DPDK devices disabled.
2023-08-08T12:37:51.997Z|00013|dpdk|INFO|EAL ARGS: ovs-vswitchd --log-level=lib.eal:debug --in-memory -l 0.
2023-08-08T12:37:51.997Z|00014|dpdk|DBG|EAL: lib.eal log level changed from info to debug
2023-08-08T12:37:51.998Z|00015|dpdk|DBG|EAL: Detected lcore 0 as core 0 on socket 0
2023-08-08T12:37:51.998Z|00016|dpdk|DBG|EAL: Detected lcore 1 as core 0 on socket 1
2023-08-08T12:37:51.998Z|00017|dpdk|DBG|EAL: Detected lcore 2 as core 1 on socket 0
2023-08-08T12:37:51.998Z|00018|dpdk|DBG|EAL: Detected lcore 3 as core 1 on socket 1
2023-08-08T12:37:51.998Z|00019|dpdk|DBG|EAL: Detected lcore 4 as core 2 on socket 0
2023-08-08T12:37:51.998Z|00020|dpdk|DBG|EAL: Detected lcore 5 as core 2 on socket 1
2023-08-08T12:37:51.998Z|00021|dpdk|DBG|EAL: Detected lcore 6 as core 3 on socket 0
2023-08-08T12:37:51.998Z|00022|dpdk|DBG|EAL: Detected lcore 7 as core 3 on socket 1
2023-08-08T12:37:51.998Z|00023|dpdk|DBG|EAL: Detected lcore 8 as core 4 on socket 0
2023-08-08T12:37:51.998Z|00024|dpdk|DBG|EAL: Detected lcore 9 as core 4 on socket 1
2023-08-08T12:37:51.998Z|00025|dpdk|DBG|EAL: Detected lcore 10 as core 5 on socket 0
2023-08-08T12:37:51.999Z|00026|dpdk|DBG|EAL: Detected lcore 11 as core 5 on socket 1
2023-08-08T12:37:51.999Z|00027|dpdk|DBG|EAL: Detected lcore 12 as core 0 on socket 0
2023-08-08T12:37:51.999Z|00028|dpdk|DBG|EAL: Detected lcore 13 as core 0 on socket 1
2023-08-08T12:37:51.999Z|00029|dpdk|DBG|EAL: Detected lcore 14 as core 1 on socket 0
2023-08-08T12:37:51.999Z|00030|dpdk|DBG|EAL: Detected lcore 15 as core 1 on socket 1
2023-08-08T12:37:51.999Z|00031|dpdk|DBG|EAL: Detected lcore 16 as core 2 on socket 0
2023-08-08T12:37:51.999Z|00032|dpdk|DBG|EAL: Detected lcore 17 as core 2 on socket 1
2023-08-08T12:37:51.999Z|00033|dpdk|DBG|EAL: Detected lcore 18 as core 3 on socket 0
2023-08-08T12:37:51.999Z|00034|dpdk|DBG|EAL: Detected lcore 19 as core 3 on socket 1
2023-08-08T12:37:51.999Z|00035|dpdk|DBG|EAL: Detected lcore 20 as core 4 on socket 0
2023-08-08T12:37:51.999Z|00036|dpdk|DBG|EAL: Detected lcore 21 as core 4 on socket 1
2023-08-08T12:37:51.999Z|00037|dpdk|DBG|EAL: Detected lcore 22 as core 5 on socket 0
2023-08-08T12:37:52.000Z|00038|dpdk|DBG|EAL: Detected lcore 23 as core 5 on socket 1
2023-08-08T12:37:52.012Z|00039|dpdk|DBG|EAL: Maximum logical cores by configuration: 128
2023-08-08T12:37:52.013Z|00040|dpdk|INFO|EAL: Detected CPU lcores: 24
2023-08-08T12:37:52.013Z|00041|dpdk|INFO|EAL: Detected NUMA nodes: 2
2023-08-08T12:37:52.013Z|00042|dpdk|DBG|EAL: Checking presence of .so 'librte_eal.so.22.0'
2023-08-08T12:37:52.013Z|00043|dpdk|DBG|EAL: Checking presence of .so 'librte_eal.so.22'
2023-08-08T12:37:52.013Z|00044|dpdk|DBG|EAL: Checking presence of .so 'librte_eal.so'
2023-08-08T12:37:52.013Z|00045|dpdk|INFO|EAL: Detected static linkage of DPDK
2023-08-08T12:37:52.015Z|00046|dpdk|DBG|EAL: No shared files mode enabled, IPC will be disabled
2023-08-08T12:37:52.015Z|00047|dpdk|DBG|EAL: No shared files mode enabled, IPC is disabled
2023-08-08T12:37:52.015Z|00048|dpdk|DBG|EAL: No shared files mode enabled, IPC is disabled
2023-08-08T12:37:52.015Z|00049|dpdk|DBG|EAL: VFIO PCI modules not loaded
2023-08-08T12:37:52.055Z|00050|dpdk|INFO|EAL: rte_mem_virt2phy(): cannot open /proc/self/pagemap: Permission denied
2023-08-08T12:37:52.055Z|00051|dpdk|DBG|EAL: Bus vdev wants IOVA as 'DC'
2023-08-08T12:37:52.055Z|00052|dpdk|DBG|EAL: PCI driver net_ixgbe_vf for device 0000:42:10.0 wants IOVA as 'PA'
2023-08-08T12:37:52.055Z|00053|dpdk|DBG|EAL: PCI driver net_ixgbe_vf for device 0000:42:10.2 wants IOVA as 'PA'
2023-08-08T12:37:52.055Z|00054|dpdk|DBG|EAL: Bus pci wants IOVA as 'PA'
2023-08-08T12:37:52.055Z|00055|dpdk|DBG|EAL: Bus auxiliary wants IOVA as 'DC'
2023-08-08T12:37:52.055Z|00056|dpdk|ERR|EAL: Cannot use IOVA as 'PA' since physical addresses are not available
2023-08-08T12:37:52.055Z|00057|dpdk|EMER|Unable to initialize DPDK: Invalid argument
2023-08-08T12:37:52.844Z|00002|daemon_unix|ERR|fork child died before signaling startup (killed (signal 6), core dumped)
2023-08-08T12:37:52.844Z|00003|daemon_unix|EMER|could not detach from foreground session

Comment 1 Vladimir Benes 2023-08-08 14:35:13 UTC
and for root:root I need SELinux in the permissive mode so there is something wrong in openvswitch-selinux-extra-policy-1.0-34.el9fdp.noarch too.