From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 50509A0C4B; Thu, 17 Jun 2021 04:27:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D10664067A; Thu, 17 Jun 2021 04:27:35 +0200 (CEST) Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178]) by mails.dpdk.org (Postfix) with ESMTP id EC46A40150 for ; Thu, 17 Jun 2021 04:27:34 +0200 (CEST) Received: by inbox.dpdk.org (Postfix, from userid 33) id B511DA0C4C; Thu, 17 Jun 2021 04:27:34 +0200 (CEST) From: bugzilla@dpdk.org To: dev@dpdk.org Date: Thu, 17 Jun 2021 02:27:34 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: vhost/virtio X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: weix.ling@intel.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 Subject: [dpdk-dev] [Bug 741] [dpdk-21.05]vhost relaunch meet Segmentation fault issue when virtio queues larger than vhost queues X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" https://bugs.dpdk.org/show_bug.cgi?id=3D741 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.ling@intel.com Target Milestone: --- Issue discription=EF=BC=9A 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=3Dv= host=20 --vdev 'net_vhost0,iface=3D/tmp/s0,client=3D1,queues=3D1' --vdev 'net_vhost1,iface=3D/tmp/s1,client=3D1,queues=3D1' -- -i --nb-cores=3D1 --t= xd=3D1024 --rxd=3D1024 testpmd>start 2. launch one virtio-user: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 5-6 --no-pci --file-prefix=3Dvirtio0 \ --vdev=3Dnet_virtio_user0,mac=3D00:01:02:03:04:05,path=3D/tmp/s0,server=3D1= ,mrg_rxbuf=3D0,in_order=3D0,queues=3D1 \ -- -i --tx-offloads=3D0x0 --enable-hw-vlan-strip --nb-cores=3D1 --txd=3D1024 --rxd=3D1024 testpmd>start 3. launch another virtio-user with queue number=3D8: ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -n 4 -l 7-8 --no-pci --file-prefix=3Dvirtio1 \ --vdev=3Dnet_virtio_user1,mac=3D00:01:02:03:04:55,path=3D/tmp/s1,server=3D1= ,mrg_rxbuf=3D0,in_order=3D0,queues=3D8 \ -- -i --tx-offloads=3D0x0 --enable-hw-vlan-strip --nb-cores=3D1 --txd=3D1024 --rxd=3D1024 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=3Dv= host=20 --vdev 'net_vhost0,iface=3D/tmp/s0,client=3D1,queues=3D1' --vdev 'net_vhost1,iface=3D/tmp/s1,client=3D1,queues=3D1' -- -i --nb-cores=3D1 --t= xd=3D1024 --rxd=3D1024 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=20 commit 7804bbd13aa583e3a28b08557f7a98fcbe7fc8a8 (HEAD -> main) Author: Maxime Coquelin 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: stable@dpdk.org Reported-by: Yu Jiang Signed-off-by: Maxime Coquelin Reviewed-by: David Marchand Tested-by: Yu Jiang --=20 You are receiving this mail because: You are the assignee for the bug.=