From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4vNS44UFIjnZyDE1hTmR3fB81BP5T2yl7IEHaVrRPzs=; b=iJQpQSEAqae8G/+cAB/5oW21UcieoZyixz0NJpArgDU3DAsl7fUQy8ojCO430DVxf9 Xtq9EICGDUCQ3x+qXIgNRCKQswSNMiqraZUFC6XyqfwQV66Mot8wzbvRUdXwYbYhDvhF Zjz3nAc2ahLKL5UBaMUe8OeIgaH7BsiVWP9cSyQZlz66H9B6skCVAfhJARBo025kJlVh TPoT2+XBVZP7GijQ0FceZ0LzFv0RzrJCbU4fJQyfGyHcULwsOcWLuqiR/2y+WVfLqRmT 5hb4xOSQtuNzkFyd1fxmgM9k/JP4v+YLCGnX2iIJj+OJ0h9B2iMfA6zVnHORzb3plJMa eFcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4vNS44UFIjnZyDE1hTmR3fB81BP5T2yl7IEHaVrRPzs=; b=bFdmCvkF+NKMXFhELYsVmT3zRNa+0QxNEpYVuNC7xvw5y+vdD47mtJEs/IxbZtTsxl M0+LbSajAT5K2mgiAgdFhwpw7FzMKqa/HRMSq8yifsVYZ4mY4ssTk2sn3StQeDcCNdWH jknWml4ayZCsGiqFoqGDrXc21jkwr+kBYHaryW6w1Le5N474g61ftVgbJHeXOGPchCSY 9WpqiSIMCdLXWvqG58wU1JrHTVq3TqGMHhfMGXDFgR1628oFq91UYI21lob95xCsp9s+ cCTsJU14fRHvHkHToFfEgKFKUygM4w+tEa+bUyeb2/hQCXmUbfdZL1TFKry9TsTmeS4v BbcA== X-Gm-Message-State: AEkoout7pPIJN67qKXgaF66bwy9IE+0lo2tNI4Fp44nVn6fjFaCmCI4GTm7yQYfl/OzA4A== X-Received: by 10.98.33.147 with SMTP id o19mr132521190pfj.8.1470414955740; Fri, 05 Aug 2016 09:35:55 -0700 (PDT) Received: from xeon-e3 (static-50-53-69-251.bvtn.or.frontiernet.net. [50.53.69.251]) by smtp.gmail.com with ESMTPSA id u7sm29281051paz.45.2016.08.05.09.35.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Aug 2016 09:35:55 -0700 (PDT) Date: Fri, 5 Aug 2016 09:36:05 -0700 From: Stephen Hemminger To: Jianfeng Tan Cc: dev@dpdk.org, yuanhan.liu@linux.intel.com, zhihong.wang@intel.com, lining18@jd.com Message-ID: <20160805093605.25b8ab5e@xeon-e3> In-Reply-To: <1470397003-5782-3-git-send-email-jianfeng.tan@intel.com> 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 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: Fri, 05 Aug 2016 16:35:56 -0000 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")