From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id EBA80A6A for ; Mon, 23 Mar 2015 15:33:18 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 23 Mar 2015 07:33:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,452,1422950400"; d="scan'208";a="702823789" Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98]) by orsmga002.jf.intel.com with ESMTP; 23 Mar 2015 07:33:17 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 23 Mar 2015 22:33:15 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.36]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.111]) with mapi id 14.03.0224.002; Mon, 23 Mar 2015 22:33:14 +0800 From: "Xie, Huawei" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH] virtio: Fix crash issue for secondary process Thread-Index: AdBldkq2A0UtQbqxTSuxek4H+BtiJg== Date: Mon, 23 Mar 2015 14:33:13 +0000 Message-ID: References: <1426729537-24892-1-git-send-email-changchun.ouyang@intel.com> <2258736.A24vDFQUbz@xps13> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] virtio: Fix crash issue for secondary process 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: Mon, 23 Mar 2015 14:33:19 -0000 On 3/21/2015 5:59 AM, Thomas Monjalon wrote: 2015-03-19 09:45, Ouyang Changchun: It definitely needs Rx function even in the case of secondary process, so p= ut the assignment a bit earlier to make sure of it. Signed-off-by: Changchun Ouyang --- lib/librte_pmd_virtio/virtio_ethdev.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virtio/= virtio_ethdev.c index 603be2d..ad24cf2 100644 --- a/lib/librte_pmd_virtio/virtio_ethdev.c +++ b/lib/librte_pmd_virtio/virtio_ethdev.c @@ -1113,6 +1113,7 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) RTE_BUILD_BUG_ON(RTE_PKTMBUF_HEADROOM < sizeof(struct virtio_net_hd= r)); eth_dev->dev_ops =3D &virtio_eth_dev_ops; + eth_dev->rx_pkt_burst =3D &virtio_recv_pkts; eth_dev->tx_pkt_burst =3D &virtio_xmit_pkts; if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) @@ -1148,10 +1149,8 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev) if (vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF)) { eth_dev->rx_pkt_burst =3D &virtio_recv_mergeable_pkts; Why the mergeable buffers case is not handled for secondary processes? Forgot to CC my comment to dpdk.org. There are many parts of eth_dev for the secondary process still uninitialized, even like eth_dev->data->mac_addrs isn't allocated., also like mergeable, feature, etc. Secondary process will not work unless they never touch those fields. Prefer we have a clean fix. Customer could apply that one line of fix if they need this urgently. I am wondering whether other PMDS have the same issue for the second proces= s. hw->vtnet_hdr_size =3D sizeof(struct virtio_net_hdr_mrg_rxb= uf); - } else { - eth_dev->rx_pkt_burst =3D &virtio_recv_pkts; + } else hw->vtnet_hdr_size =3D sizeof(struct virtio_net_hdr); - } /* Copy the permanent MAC address to: virtio_hw */ virtio_get_hwaddr(hw);