From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 840542C38; Mon, 23 Jan 2017 08:58:06 +0100 (CET) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C031185541; Mon, 23 Jan 2017 07:58:06 +0000 (UTC) Received: from [10.36.116.152] (ovpn-116-152.ams2.redhat.com [10.36.116.152]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0N7w4MN019018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Jan 2017 02:58:05 -0500 To: Yuanhan Liu , dev@dpdk.org References: <1485074820-8956-1-git-send-email-yuanhan.liu@linux.intel.com> <1485074820-8956-4-git-send-email-yuanhan.liu@linux.intel.com> Cc: stable@dpdk.org From: Maxime Coquelin Message-ID: <5ca00f93-413a-9540-4598-4467592cc9ba@redhat.com> Date: Mon, 23 Jan 2017 08:58:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1485074820-8956-4-git-send-email-yuanhan.liu@linux.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 23 Jan 2017 07:58:06 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 3/3] net/virtio: fix crash when number of virtio devices > 1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2017 07:58:06 -0000 On 01/22/2017 09:47 AM, Yuanhan Liu wrote: > The vtpci_ops assignment needs the 'hw->port_id' as an input parameter. > That said, we should set 'hw->port_id' firstly, then do the vtpci_ops > assignment, while the code does reversely. That would result to a crash > when more than one virtio devices are used, because we keep assigning > proper vtpci_ops to virtio_hw_internal[0]->vtpci_ops, leaving the pointer > for other ports being NULL. > > Reverse the order fixes this issue. > > Fixes: 9470427c88e1 ("net/virtio: do not store PCI device pointer at shared memory") > > Cc: stable@dpdk.org > Reported-by: Lei Yao > Signed-off-by: Yuanhan Liu > --- > drivers/net/virtio/virtio_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Maxime Coquelin Thanks, Maxime