From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 2E23B2C30 for ; Wed, 27 Feb 2019 02:41:51 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2019 17:41:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,417,1544515200"; d="scan'208";a="127516593" Received: from dpdk-tbie.sh.intel.com ([10.67.104.173]) by fmsmga008.fm.intel.com with ESMTP; 26 Feb 2019 17:41:49 -0800 Date: Wed, 27 Feb 2019 09:41:49 +0800 From: Tiwei Bie To: Maxime Coquelin Cc: Ilya Maximets , "Liu, Changpeng" , "dev@dpdk.org" , "Stojaczyk, Dariusz" , "Wang, Zhihong" , Jason Wang Message-ID: <20190227014149.GA18641@dpdk-tbie.sh.intel.com> References: <1551081095-14286-1-git-send-email-changpeng.liu@intel.com> <2c1b8abc-47a9-0d0b-5056-0092fc58e310@samsung.com> <4ba6108c-78b0-c7e6-f810-3faa13c7765e@samsung.com> <60245e11-ff68-133d-2577-8526c89e6264@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] vhost: add virtio configuration space access socket messages 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: Wed, 27 Feb 2019 01:41:52 -0000 On Tue, Feb 26, 2019 at 01:32:24PM +0100, Maxime Coquelin wrote: > On 2/26/19 9:42 AM, Ilya Maximets wrote: > > On 26.02.2019 11:13, Liu, Changpeng wrote: > > > > > > > > > > -----Original Message----- > > > > From: Ilya Maximets [mailto:i.maximets@samsung.com] > > > > Sent: Tuesday, February 26, 2019 3:39 PM > > > > To: Liu, Changpeng ; dev@dpdk.org > > > > Cc: Stojaczyk, Dariusz ; > > > > maxime.coquelin@redhat.com; Bie, Tiwei ; Wang, > > > > Zhihong ; Jason Wang > > > > Subject: Re: vhost: add virtio configuration space access socket messages > > > > > > > > On 26.02.2019 10:01, Liu, Changpeng wrote: > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: Ilya Maximets [mailto:i.maximets@samsung.com] > > > > > > Sent: Monday, February 25, 2019 9:20 PM > > > > > > To: Liu, Changpeng ; dev@dpdk.org > > > > > > Cc: Stojaczyk, Dariusz ; > > > > > > maxime.coquelin@redhat.com; Bie, Tiwei ; Wang, > > > > > > Zhihong ; Jason Wang > > > > > > Subject: Re: vhost: add virtio configuration space access socket messages > > > > > > > > > > > > On 25.02.2019 10:51, Changpeng Liu wrote: > > > > > > > This patch adds new vhost user messages GET_CONFIG and SET_CONFIG > > > > > > > used to get/set virtio device's PCI configuration space. > > > > > > > > > > > > Beside the fact that some additional description and reasoning required, > > > > > > I do not see the usage of this feature. You're defining the flag > > > > > > VHOST_USER_PROTOCOL_F_CONFIG, but it's never used. So, none of dpdk > > > > vhost > > > > > > backends (vdpa, vhost-user) will use this feature. > > > > > > You, probably, missed adding it to VHOST_USER_PROTOCOL_FEATURES or > > > > > > VDPA_SUPPORTED_PROTOCOL_FEATURES. > > > > > > > > > > > > From the other side, current implementation forces application to properly > > > > > > implement the get/set_config callbacks. Otherwise, receiving of the messages > > > > > > will result in RTE_VHOST_MSG_RESULT_ERR and subsequent vhost > > > > > > disconnection. > > > > > > This looks strange, because supported protocol features normally enabled by > > > > > > default. Am I misunderstood something ? > > > > > QEMU will not send the messages if VHOST_USER_PROTOCOL_F_CONFIG > > > > wasn't enabled. > > > > > > > > So, you're going to enable it only by explicit call to > > > > 'rte_vhost_driver_set_features' ? > > > > > > > > In this case I'm assuming that you're implementing your own vhost backend. > > > > But why you're not using 'dev->extern_ops' and corresponding 'pre_msg_handle' > > > > or 'post_msg_handle' to handle your GET/SET_CONFIG messages like it does > > > > 'vhost_crypto' backend ? > > > The patch was developed one year ago, while DPDK didn't have external ops. > > > > So, maybe it's time to reconsider the implementation. > > +1 > > > > The get_config/set_config was defined for all the virtio devices, so I think it makes > > > more sense adding here. > > > > VHOST_USER_*_CRYPTO_SESSION messages are defined for all the virtio devices > > too, however they makes sense for vhost_crypto backend only. These messages > > (GET/SET_CONFIG) makes sense only when callbacks (get/set_config) are > > implemented, so IMHO it's better to implement their handlers along with the > > callbacks, i.e. inside the implementation of your vhost backend. > > > > Maxime, Tiwei, what do you think ? > > I would prefer it to be implemented in SPDK directly as a pre_handler > callback, as I don't foresee a need for it for other backends, and it > would avoid breaking the API. > > It would imply fixing the beginning of vhost_user_msg_handler() to accept > requests > VHOST_USER_MAX and add necessary check before doing > the debug logs. > > With above change we would also be able to remove VHOST_CRYPTO requests > from vhost_user.c, and we could then work on moving vhost-net bits > out of this file too. +1 > > Regards, > Maxime >