From: Maxime Coquelin Subject: Re: [PATCH 3/3] net/virtio: fix crash when number of virtio devices > 1 Date: Mon, 23 Jan 2017 08:58:03 +0100 Message-ID: <5ca00f93-413a-9540-4598-4467592cc9ba@redhat.com> References: <1485074820-8956-1-git-send-email-yuanhan.liu@linux.intel.com> <1485074820-8956-4-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: stable@dpdk.org To: Yuanhan Liu , dev@dpdk.org Return-path: In-Reply-To: <1485074820-8956-4-git-send-email-yuanhan.liu@linux.intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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