From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Xie, Huawei" Subject: Re: [PATCH v2] virtio: Fix crash issue for secondary process Date: Fri, 27 Mar 2015 07:37:46 +0000 Message-ID: References: <1426729537-24892-1-git-send-email-changchun.ouyang@intel.com> <1427438150-6673-1-git-send-email-changchun.ouyang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev-VfR2kkLFssw@public.gmane.org" To: "Ouyang, Changchun" Return-path: Content-Language: en-US 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" On 3/27/2015 2:35 PM, Ouyang, Changchun wrote:=0A= > It needs Rx function even in the case of secondary process, and it also n= eeds check if=0A= > it supports mergeable feature or not.=0A= >=0A= > Signed-off-by: Changchun Ouyang =0A= > ---=0A= >=0A= > Changes in v2:=0A= > -- Check if it supports mergeable or not for the secondary process.=0A= >=0A= > lib/librte_pmd_virtio/virtio_ethdev.c | 7 ++++++-=0A= > 1 file changed, 6 insertions(+), 1 deletion(-)=0A= >=0A= > diff --git a/lib/librte_pmd_virtio/virtio_ethdev.c b/lib/librte_pmd_virti= o/virtio_ethdev.c=0A= > index 603be2d..0156b56 100644=0A= > --- a/lib/librte_pmd_virtio/virtio_ethdev.c=0A= > +++ b/lib/librte_pmd_virtio/virtio_ethdev.c=0A= > @@ -1115,8 +1115,13 @@ eth_virtio_dev_init(struct rte_eth_dev *eth_dev)= =0A= > eth_dev->dev_ops =3D &virtio_eth_dev_ops;=0A= > eth_dev->tx_pkt_burst =3D &virtio_xmit_pkts;=0A= > =0A= > - if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY)=0A= > + if (rte_eal_process_type() =3D=3D RTE_PROC_SECONDARY) {=0A= > + if (vtpci_with_feature(hw, VIRTIO_NET_F_MRG_RXBUF))=0A= > + eth_dev->rx_pkt_burst =3D &virtio_recv_mergeable_pkts;=0A= > + else=0A= > + eth_dev->rx_pkt_burst =3D &virtio_recv_pkts;=0A= > return 0;=0A= > + }=0A= > =0A= > /* Allocate memory for storing MAC addresses */=0A= > eth_dev->data->mac_addrs =3D rte_zmalloc("virtio", ETHER_ADDR_LEN, 0);= =0A= Acked-by: Huawei Xie =0A= =0A=