From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 12D4FDE3; Thu, 24 May 2018 09:39:05 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9D8E7401EF00; Thu, 24 May 2018 07:39:04 +0000 (UTC) Received: from [10.36.112.48] (ovpn-112-48.ams2.redhat.com [10.36.112.48]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4EED42166BB2; Thu, 24 May 2018 07:39:03 +0000 (UTC) To: zhiyong.yang@intel.com, dev@dpdk.org Cc: stable@dpdk.org, tiwei.bie@intel.com, lei.a.yao@intel.com, ferruh.yigit@intel.com References: <20180524130423.15554-1-zhiyong.yang@intel.com> From: Maxime Coquelin Message-ID: <589a8666-198a-945f-c669-83f51d31ea48@redhat.com> Date: Thu, 24 May 2018 09:39:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180524130423.15554-1-zhiyong.yang@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 24 May 2018 07:39:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 24 May 2018 07:39:04 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH] net/virtio-user: fix add pointer checking for rxvq X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2018 07:39:05 -0000 Hi, I would use net/virtio prefix instead, as IIUC, the impacted code can also be called by Virtio PMD. On 05/24/2018 03:04 PM, zhiyong.yang@intel.com wrote: > For virtio-user server mode, One use case comes across segmentation fault. > step 1: Launch vhost side as client firstly. > step 2: launch virtio-user side as server. > > The cause is: after registering virtio_interrupt_handler into > eal-intr-thread, two threads (main thread and eal-intr-thread) have > sync issues, so add rxvq pointer checking in function virtio_notify_peers > to decide if the code can continue. > > Fixes: bd8f50a45d0f ("net/virtio-user: support server mode") > Cc: stable@dpdk.org > Cc: maxime.coquelin@redhat.com > Cc: tiwei.bie@intel.com > Cc: lei.a.yao@intel.com > Cc: ferruh.yigit@intel.com > > Signed-off-by: Zhiyong Yang > --- > drivers/net/virtio/virtio_ethdev.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > index 5833dad73..df50a571a 100644 > --- a/drivers/net/virtio/virtio_ethdev.c > +++ b/drivers/net/virtio/virtio_ethdev.c > @@ -1245,6 +1245,9 @@ virtio_notify_peers(struct rte_eth_dev *dev) > return; > > rxvq = dev->data->rx_queues[0]; > + if (!rxvq) > + return; > + Other than that, it looks good to me: Reviewed-by: Maxime Coquelin Thanks, Maxime > rarp_mbuf = rte_net_make_rarp_packet(rxvq->mpool, > (struct ether_addr *)hw->mac_addr); > if (rarp_mbuf == NULL) { >