openvswitch / ovs-issues

Issue tracker repo for Open vSwitch
10 stars 3 forks source link

package openvswitch-switch-dpdk unable support dpdk mode? #294

Closed bettswang closed 1 year ago

bettswang commented 1 year ago

Hi, everyone

I test the dpdk mode of package openvswitch-switch-dpdk on system ubuntu20.04. It seems the package don't support this mode. Is it a bug?

root@ubuntu2004:~# apt install -y openvswitch-switch-dpdk

root@ubuntu2004:~# apt list --installed | grep -i openvswitch
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
openvswitch-common/focal-updates,focal-security,now 2.13.8-0ubuntu1.2 amd64 [installed,automatic]
openvswitch-switch-dpdk/focal-updates,focal-security,now 2.13.8-0ubuntu1.2 amd64 [installed]
openvswitch-switch/focal-updates,focal-security,now 2.13.8-0ubuntu1.2 amd64 [installed,automatic]
python3-openvswitch/focal-updates,focal-security,now 2.13.8-0ubuntu1.2 all [installed,automatic]

root@ubuntu2004:~# cat /etc/default/grub | grep -e iommu
GRUB_CMDLINE_LINUX="iommu=pt intel_iommu=on pci=assign-busses"

root@ubuntu2004:~#export PATH=$PATH:/usr/share/openvswitch/scripts
root@ubuntu2004:~#export DB_SOCK=/var/run/openvswitch/db.sock
root@ubuntu2004:~#ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true
root@ubuntu2004:~#ovs-ctl --no-ovsdb-server --db-sock="$DB_SOCK" start

root@ubuntu2004:~#  ovs-vsctl get Open_vSwitch . dpdk_initialized
false

root@ubuntu2004:~# tail -f /var/log/openvswitch/ovs-vswitchd.log
2023-08-03T02:52:17.832Z|00006|bridge|INFO|ovs-vswitchd (Open vSwitch) 2.13.8
2023-08-03T02:56:37.648Z|00007|memory|INFO|13072 kB peak resident set size after 259.8 seconds
2023-08-03T02:56:49.280Z|00001|vlog|INFO|opened log file /var/log/openvswitch/ovs-vswitchd.log
2023-08-03T02:56:49.285Z|00002|ovs_numa|INFO|Discovered 8 CPU cores on NUMA node 0
2023-08-03T02:56:49.285Z|00003|ovs_numa|INFO|Discovered 1 NUMA nodes and 8 CPU cores
2023-08-03T02:56:49.285Z|00004|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connecting...
2023-08-03T02:56:49.285Z|00005|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connected
2023-08-03T02:56:49.288Z|00006|bridge|INFO|ovs-vswitchd (Open vSwitch) 2.13.8
2023-08-03T03:05:37.297Z|00007|memory|INFO|13072 kB peak resident set size after 528.0 seconds
2023-08-03T03:07:19.274Z|00008|dpdk|ERR|DPDK not supported in this copy of Open vSwitch.
igsilya commented 1 year ago

Hi. You should report this to Ubuntu instead, i.e. create a launchpad bug. They are responsible for these packages. The only thing I can suggest is to remove all openvswitch* packages and then try installing openvswitch-switch-dpdk only.

bettswang commented 1 year ago

the packages are bound together, unable to install openvswitch-switch-dpdk only. I will post this issue to Ubuntu community.Thanks for your kindly help.

bettswang commented 1 year ago

Hi. You should report this to Ubuntu instead, i.e. create a launchpad bug. They are responsible for these packages. The only thing I can suggest is to remove all openvswitch* packages and then try installing openvswitch-switch-dpdk only.

I try to compile the dpdk-switch from gittree and install local .deb install package. But it seem the same issue. Why ?

root@ubuntu2004:~# ll *.deb
-rw-r--r-- 1 root root 1339628 Aug  6 15:51 openvswitch-common_3.1.90-1_amd64.deb
-rw-r--r-- 1 root root 1085524 Aug  6 15:51 openvswitch-doc_3.1.90-1_all.deb
-rw-r--r-- 1 root root   54648 Aug  6 15:51 openvswitch-ipsec_3.1.90-1_amd64.deb
-rw-r--r-- 1 root root   42852 Aug  6 15:51 openvswitch-pki_3.1.90-1_all.deb
-rw-r--r-- 1 root root 8200004 Aug  6 15:51 openvswitch-source_3.1.90-1_all.deb
-rw-r--r-- 1 root root 1696984 Aug  6 15:51 openvswitch-switch_3.1.90-1_amd64.deb
-rw-r--r-- 1 root root 1093124 Aug  6 15:51 openvswitch-switch-dpdk_3.1.90-1_amd64.deb
-rw-r--r-- 1 root root   81900 Aug  6 15:51 openvswitch-test_3.1.90-1_all.deb
-rw-r--r-- 1 root root  799864 Aug  6 15:51 openvswitch-testcontroller_3.1.90-1_amd64.deb
-rw-r--r-- 1 root root  307348 Aug  6 15:51 openvswitch-vtep_3.1.90-1_amd64.deb
-rw-r--r-- 1 root root  277876 Aug  6 15:51 python3-openvswitch_3.1.90-1_amd64.deb
root@ubuntu2004:~# apt list --installed | grep -e dpdk -e openvswitch
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
dpdk/unstable,now 22.11.2-3 amd64 [installed]
libdpdk-dev/unstable,now 22.11.2-3 amd64 [installed]
openvswitch-common/now 3.1.90-1 amd64 [installed,local]
openvswitch-switch-dpdk/now 3.1.90-1 amd64 [installed,local]
openvswitch-switch/now 3.1.90-1 amd64 [installed,local]
python3-openvswitch/now 3.1.90-1 amd64 [installed,local]
root@ubuntu2004:~# cat /var/log/openvswitch/ovs-vswitchd.log
2023-08-07T15:09:30.024Z|00002|vlog|INFO|opened log file /var/log/openvswitch/ovs-vswitchd.log
2023-08-07T15:09:30.031Z|00003|ovs_numa|INFO|Discovered 8 CPU cores on NUMA node 0
2023-08-07T15:09:30.031Z|00004|ovs_numa|INFO|Discovered 1 NUMA nodes and 8 CPU cores
2023-08-07T15:09:30.031Z|00005|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connecting...
2023-08-07T15:09:30.031Z|00006|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connected
2023-08-07T15:09:30.034Z|00007|bridge|INFO|ovs-vswitchd (Open vSwitch) 3.1.90
2023-08-07T15:10:59.493Z|00008|memory|INFO|12696 kB peak resident set size after 89.5 seconds
2023-08-07T15:10:59.493Z|00009|memory|INFO|idl-cells-Open_vSwitch:17
2023-08-07T15:10:59.493Z|00010|dpdk|ERR|DPDK not supported in this copy of Open vSwitch.
2023-08-08T09:16:51.016Z|00002|vlog|INFO|opened log file /var/log/openvswitch/ovs-vswitchd.log
2023-08-08T09:16:51.027Z|00003|ovs_numa|INFO|Discovered 8 CPU cores on NUMA node 0
2023-08-08T09:16:51.027Z|00004|ovs_numa|INFO|Discovered 1 NUMA nodes and 8 CPU cores
2023-08-08T09:16:51.027Z|00005|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connecting...
2023-08-08T09:16:51.027Z|00006|reconnect|INFO|unix:/var/run/openvswitch/db.sock: connected
2023-08-08T09:16:51.028Z|00007|dpdk|ERR|DPDK not supported in this copy of Open vSwitch.
2023-08-08T09:16:51.030Z|00008|bridge|INFO|ovs-vswitchd (Open vSwitch) 3.1.90
igsilya commented 1 year ago

Looks strange. I don't have ubuntu 23.04 handy to test the dpdk build right now. I'll upgrade one of my test VMs to try.

igsilya commented 1 year ago

OK, the issue is that debian package provides different binaries as alternatives. You need to run: update-alternatives --config ovs-vswitchd in order to choose a different binary.

bettswang commented 1 year ago

You mean that package openvswitch-switch and openvswitch-switch-dpdk are conflict. They default choose theopenvswitch-switch

bettswang commented 1 year ago

You are right. But I wonder that why ubuntu do this? the package openvswitch-switch and openvswitch-switch-dpdk are bound together to install or remove.

igsilya commented 1 year ago

openvswitch-switch-dpdk may depend on openvswitch-switch, but openvswitch-switch shouldn't depend on openvswitch-switch-dpdk. i.e. you should be able to install just the version without dpdk.

The reason for having two different binaries, I think, is that dpdk version requires building with higher architecture requirements. The normal non-dpdk package should be able to work on older hardware.

bettswang commented 1 year ago

Got. Thanks