From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 2/3] net/virtio_user: fix wrong sequence of messages Date: Fri, 5 Aug 2016 09:36:05 -0700 Message-ID: <20160805093605.25b8ab5e@xeon-e3> References: <1470397003-5782-1-git-send-email-jianfeng.tan@intel.com> <1470397003-5782-3-git-send-email-jianfeng.tan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, yuanhan.liu@linux.intel.com, zhihong.wang@intel.com, lining18@jd.com To: Jianfeng Tan Return-path: Received: from mail-pf0-f178.google.com (mail-pf0-f178.google.com [209.85.192.178]) by dpdk.org (Postfix) with ESMTP id 5DE332B9B for ; Fri, 5 Aug 2016 18:35:56 +0200 (CEST) Received: by mail-pf0-f178.google.com with SMTP id x72so98765679pfd.2 for ; Fri, 05 Aug 2016 09:35:56 -0700 (PDT) In-Reply-To: <1470397003-5782-3-git-send-email-jianfeng.tan@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 5 Aug 2016 11:36:42 +0000 Jianfeng Tan wrote: > When virtio_user is used with VPP's native vhost user, it cannot > send/receive any packets. > > The root cause is that vpp-vhost-user translates the message > VHOST_USER_SET_FEATURES as puting this device into init state, > aka, zero all related structures. However, previous code > puts this message at last in the whole initialization process, > which leads to all previous information are zeroed. Not sure what correct behavior is here. It could be that VPP native vhost user is broken. What does QEMU/KVM vhost do in this case? I would take that as the authoritative source for semantics. > To fix this issue, we rearrange the sequence of those messages. > - step 0, send VHOST_USER_SET_VRING_CALL so that vhost allocates > virtqueue structures; > - step 1, send VHOST_USER_SET_FEATURES to confirm the features; > - step 2, send VHOST_USER_SET_MEM_TABLE to share mem regions; > - step 3, send VHOST_USER_SET_VRING_NUM, VHOST_USER_SET_VRING_BASE, > VHOST_USER_SET_VRING_ADDR, VHOST_USER_SET_VRING_KICK for each > queue; > - ... > > Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")