https://bugs.dpdk.org/show_bug.cgi?id=741
Bug ID: 741 Summary: [dpdk-21.05]vhost relaunch meet Segmentation fault issue when virtio queues larger than vhost queues Product: DPDK Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: Normal Component: vhost/virtio Assignee: dev@dpdk.org Reporter: weix.l...@intel.com Target Milestone: --- Issue discription: vhost relaunch meet segment fault issue from when virtio queues larger than vhost queues. Test Environment: DPDK version: DPDK v21.05 OS: Linux 5.4 Compiler: gcc 9.3 CPU: 8280m The reproduce step is : 1. launch two vhost ports : ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,client=1,queues=1' --vdev 'net_vhost1,iface=/tmp/s1,client=1,queues=1' -- -i --nb-cores=1 --txd=1024 --rxd=1024 testpmd>start 2. launch one virtio-user: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=virtio0 \ --vdev=net_virtio_user0,mac=00:01:02:03:04:05,path=/tmp/s0,server=1,mrg_rxbuf=0,in_order=0,queues=1 \ -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 testpmd>start 3. launch another virtio-user with queue number=8: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 7-8 --no-pci --file-prefix=virtio1 \ --vdev=net_virtio_user1,mac=00:01:02:03:04:55,path=/tmp/s1,server=1,mrg_rxbuf=0,in_order=0,queues=8 \ -- -i --tx-offloads=0x0 --enable-hw-vlan-strip --nb-cores=1 --txd=1024 --rxd=1024 testpmd>start tx_first 32 4. relaunch two vhost ports : ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 2-4 --file-prefix=vhost --vdev 'net_vhost0,iface=/tmp/s0,client=1,queues=1' --vdev 'net_vhost1,iface=/tmp/s1,client=1,queues=1' -- -i --nb-cores=1 --txd=1024 --rxd=1024 Result: Checking link statuses... VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE VHOST_CONFIG: set queue enable: 0 to qp idx: 0 VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE VHOST_CONFIG: set queue enable: 0 to qp idx: 0 VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE VHOST_CONFIG: set queue enable: 0 to qp idx: 1 VHOST_CONFIG: read message VHOST_USER_SET_VRING_ENABLE VHOST_CONFIG: set queue enable: 0 to qp idx: 1 VHOST_CONFIG: read message VHOST_USER_GET_VRING_BASE VHOST_CONFIG: vring base idx:0 file:0 VHOST_CONFIG: read message VHOST_USER_GET_VRING_BASE VHOST_CONFIG: vring base idx:0 file:0 VHOST_CONFIG: read message VHOST_USER_GET_VRING_BASE VHOST_CONFIG: vring base idx:1 file:0 VHOST_CONFIG: read message VHOST_USER_GET_VRING_BASE VHOST_CONFIG: vring base idx:1 file:0 VHOST_CONFIG: read message VHOST_USER_GET_FEATURES VHOST_CONFIG: read message VHOST_USER_GET_VRING_BASE Segmentation fault Expected Result: vhost port can relaunch success and 1 queue can wok. Is this issue a regression: Y Version the regression was introduced: Specify git id if known. root@dpdk:~/dpdk# git bisect bad commit 7804bbd13aa583e3a28b08557f7a98fcbe7fc8a8 (HEAD -> main) Author: Maxime Coquelin <maxime.coque...@redhat.com> Date: Fri Nov 6 15:47:44 2020 +0100 vhost: fix virtqueue initialization This patches fixes virtqueue initialization issue causing segfault or file descriptor being closed unexpectedly. The wrong index was passed to init_vring_queue() by alloc_vring_queue() when a hole in the virtqueue array was met. Fixes: 8acd7c213353 ("vhost: fix virtqueues metadata allocation") Cc: sta...@dpdk.org Reported-by: Yu Jiang <yux.ji...@intel.com> Signed-off-by: Maxime Coquelin <maxime.coque...@redhat.com> Reviewed-by: David Marchand <david.march...@redhat.com> Tested-by: Yu Jiang <yux.ji...@intel.com> -- You are receiving this mail because: You are the assignee for the bug.