From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] virtio: Fix crash issue for secondary process Date: Fri, 20 Mar 2015 22:58:01 +0100 Message-ID: <2258736.A24vDFQUbz@xps13> References: <1426729537-24892-1-git-send-email-changchun.ouyang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Ouyang Changchun Return-path: In-Reply-To: <1426729537-24892-1-git-send-email-changchun.ouyang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 2015-03-19 09:45, Ouyang Changchun: > It definitely needs Rx function even in the case of secondary process, so put > 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_hdr)); > > eth_dev->dev_ops = &virtio_eth_dev_ops; > + eth_dev->rx_pkt_burst = &virtio_recv_pkts; > eth_dev->tx_pkt_burst = &virtio_xmit_pkts; > > if (rte_eal_process_type() == 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 = &virtio_recv_mergeable_pkts; Why the mergeable buffers case is not handled for secondary processes? > hw->vtnet_hdr_size = sizeof(struct virtio_net_hdr_mrg_rxbuf); > - } else { > - eth_dev->rx_pkt_burst = &virtio_recv_pkts; > + } else > hw->vtnet_hdr_size = sizeof(struct virtio_net_hdr); > - } > > /* Copy the permanent MAC address to: virtio_hw */ > virtio_get_hwaddr(hw);