From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tetsuya Mukawa Subject: Re: [RFC PATCH 3/7] lib/librte_vhost: Add an abstraction layer tointerpret messages Date: Mon, 10 Nov 2014 17:44:16 +0900 Message-ID: <54607AE0.1010300@igel.co.jp> References: <1415272471-3299-1-git-send-email-mukawa@igel.co.jp> <1415272471-3299-4-git-send-email-mukawa@igel.co.jp> <54604943.5030601@igel.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "nakajima.yoshihiro-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org" , "masutani.hitoshi-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org" To: "Xie, Huawei" , "dev-VfR2kkLFssw@public.gmane.org" Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hi Xie, (2014/11/10 17:07), Xie, Huawei wrote: > Here all layer 2 implementations are required to return same type of vh= ost_net_device_ops function pointers to > layer 1, so layer 1 need to do some kind of preprocessing of its messag= e or wrap some private message ctx in like vhost_device_ctx, > and then pass the message to layer2. > But as we have a more common layer 3, virtio-net layer, how about we pu= t common message handler in virtio net layer as much as possible, > and different layer 2 only do the local message preprocessing, and then= pass common message format to layer 3? > I think we at least need to define functional pointers between layer 2 = and layer 3. > Layer 1 and layer 2 actually are sub layers of the same layer. It is th= at layer(cuse/user) implementation's choice whether to provide an interf= ace between > them, and the interface could be different in terms of function prototy= pe. > Let us say we are to implement a new vhost, I only care the common int= erface provided by layer 3. I don't want to register another callbacks fo= r my driver which > are used by myself only. > Let us think more about this. With my RFC implementation, sometimes Layer1 directly calls Layer2-a or Layer2-b functions. It may be fast a bit, but may not be well abstracted because Layer1 doesn't call virtio common layer sometimes. Anyway, I guess it's nice to change implementation as you mentioned. We don't need speed while initialization. Let's take well abstracted implementation. Thanks, Tetsuya