From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 767632142 for ; Mon, 8 Aug 2016 03:20:04 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 07 Aug 2016 18:19:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,487,1464678000"; d="scan'208";a="1021325924" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga001.fm.intel.com with ESMTP; 07 Aug 2016 18:19:58 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 7 Aug 2016 18:19:55 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.181]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.107]) with mapi id 14.03.0248.002; Mon, 8 Aug 2016 09:19:04 +0800 From: "Tan, Jianfeng" To: Stephen Hemminger CC: "dev@dpdk.org" , "yuanhan.liu@linux.intel.com" , "Wang, Zhihong" , "lining18@jd.com" Thread-Topic: [dpdk-dev] [PATCH 2/3] net/virtio_user: fix wrong sequence of messages Thread-Index: AQHR7w21xGYQglDXQ0OIixkALL7OJ6A6CrSAgAQ53aA= Date: Mon, 8 Aug 2016 01:19:04 +0000 Message-ID: References: <1470397003-5782-1-git-send-email-jianfeng.tan@intel.com> <1470397003-5782-3-git-send-email-jianfeng.tan@intel.com> <20160805093605.25b8ab5e@xeon-e3> In-Reply-To: <20160805093605.25b8ab5e@xeon-e3> 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 Subject: Re: [dpdk-dev] [PATCH 2/3] net/virtio_user: fix wrong sequence of messages 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, 08 Aug 2016 01:20:05 -0000 Hi Stephen, > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Saturday, August 6, 2016 12:36 AM > To: Tan, Jianfeng > Cc: dev@dpdk.org; yuanhan.liu@linux.intel.com; Wang, Zhihong; > lining18@jd.com > Subject: Re: [dpdk-dev] [PATCH 2/3] net/virtio_user: fix wrong sequence o= f > messages >=20 > On Fri, 5 Aug 2016 11:36:42 +0000 > Jianfeng Tan wrote: >=20 > > 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. >=20 > 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. Below corrective message sequence is as per QEMU's behavior. One more thing= , QEMU does not have any docs for this, and it's figured out through how th= e vhost receives messages from QEMU. Thanks, Jianfeng >=20 > > 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")