From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.sandvine.com (mail1.sandvine.com [64.7.137.165]) by dpdk.org (Postfix) with ESMTP id DA5515A95 for ; Fri, 26 Feb 2016 17:46:43 +0100 (CET) Received: from WTL-EXCHP-2.sandvine.com ([fe80::68ac:f071:19ff:3455]) by WTL-EXCHP-3.sandvine.com ([fe80::3c39:d305:d721:f00a%15]) with mapi id 14.03.0195.001; Fri, 26 Feb 2016 11:46:46 -0500 From: Kyle Larose To: "dev@dpdk.org" Thread-Topic: client_server example application crash with virtio Thread-Index: AdFwtURe5TRTF3iSSUupXoxFtx4Kag== Date: Fri, 26 Feb 2016 16:46:45 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.200.51] x-c2processedorg: b2f06e69-072f-40ee-90c5-80a34e700794 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [dpdk-dev] client_server example application crash with virtio X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Feb 2016 16:46:44 -0000 I just ran into an issue trying to run the client server example applicatio= n using virito. Whenever the client (running as a secondary process) tried = to send packets, it would crash. I traced the issue to an invalid vtpci_ops= structure: (gdb) p *vq->hw->vtpci_ops $6 =3D { read_dev_cfg =3D 0x756d2073726f7470, write_dev_cfg =3D 0x6562206562207473, reset =3D 0x6425206e65657774, get_status =3D 0x20642520646e6120, set_status =3D 0x766973756c636e69, get_features =3D 0x7561666544202e65, set_features =3D 0xa5d64255b20746c, get_isr =3D 0x0, set_config_irq =3D 0x657472203a444d50, get_queue_num =3D 0x705f65626778635f, setup_queue =3D 0x203a7325203a646d, del_queue =3D 0x20746b702078616d, notify_queue =3D 0x7473756d206e656c } It looks like this is not being initialized in secondary processes, because= we short-circuit the ethdev init here, before we call vtpci_init. if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) { rx_func_get(eth_dev); return 0; } Has anyone submitted a patch to fix this? I found that the following seemed to make it work, though I'm not sure it's= appropriate. I can submit it as a patch if nobody else has done so yet. (I= 'd clean it up to return an error code if the init fails). git diff drivers/net/virtio/virtio_ethdev.c diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio= _ethdev.c index caa970c..5002847 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1002,6 +1002,8 @@ rx_func_get(struct rte_eth_dev *eth_dev) eth_dev->rx_pkt_burst =3D &virtio_recv_mergeable_pkts; else eth_dev->rx_pkt_burst =3D &virtio_recv_pkts; + + vtpci_init(eth_dev->pci_dev, (struct virtio_hw*)eth_dev->data->dev_pri= vate); } /* Thanks, Kyle