All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: Changpeng Liu <changpeng.liu@intel.com>,
	dev@dpdk.org, james.r.harris@intel.com
Subject: Re: [PATCH] vhost: change the vhost library to a common framework which can support more VIRTIO devices
Date: Tue, 13 Sep 2016 21:49:59 +0800	[thread overview]
Message-ID: <20160913134959.GU23158@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <1658535.WKSzKSSpe0@xps13>

On Tue, Sep 13, 2016 at 03:24:53PM +0200, Thomas Monjalon wrote:
> 2016-09-13 20:58, Yuanhan Liu:
> > rte_virtio_net.h is the header file will be exported for applications.
> > Every change there would mean either an API or ABI breakage. Thus, we
> > should try to avoid touching it. Don't even to say you added yet another
> > header file, rte_virtio_dev.h.
> > 
> > I confess that the rte_virtio_net.h filename isn't that right: it sticks
> > to virtio-net so tightly. We may could rename it to rte_vhost.h, but I
> > doubt it's worthwhile: as said, it breaks the API.
> > 
> > The fortunate thing about this file is that, the context is actually not
> > sticking to virtio-net too much. I mean, all the APIs are using the "vid",
> > which is just a number. Well, except the virtio_net_device_ops() structure,
> > which also should be renamed to vhost_device_ops(). Besides that, the
> > three ops, "new_device", "destroy_device" and "vring_state_changed", are
> > actually not limited to virtio-net device.
> > 
> > That is to say, we could have two options here:
> > 
> > - rename the header file and the structure properly, to not limited to
> >   virtio-net
> > 
> > - live with it, let it be a legacy issue, and document it at somewhere,
> >   say, "due to history reason, that virtio-net is the first one supported
> >   in DPDK, we kept the header filename as rte_virtio_net.h, but not ..."
> > 
> > I personally would prefer the later one, which saves us from breaking
> > applications again. I don't have strong objection to the first one though.
> > 
> > Thomas, any comments?
> 
> I don't think keeping broken names for historical reasons is a good
> long term maintenance.

Good point.

> It could be a FIXME comment that we would fix when we have other reasons
> to break the API.
> However, in this case, it is easy to keep the compatibility, I think,
> by including rte_virtio.h in rte_virtio_net.h.

Nice trick!

> Note: renames can also generally be managed with symlinks.
> 
> I also don't really understand why this file name is rte_virtio_net.h and
> not rte_vhost_net.h.

No idea. It's just named so since the beginning. Also I missed this file
while doing the ABI/API refactoring, otherwise, it would be no pain at
this stage.

	--yliu

  reply	other threads:[~2016-09-13 13:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 12:07 [PATCH] vhost: change the vhost library to a common framework which can support more VIRTIO devices Changpeng Liu
2016-09-13 12:58 ` Yuanhan Liu
2016-09-13 13:24   ` Thomas Monjalon
2016-09-13 13:49     ` Yuanhan Liu [this message]
2016-09-14  0:20 ` [PATCH v2 1/2] " Changpeng Liu
2016-09-14  0:20   ` [PATCH v2 2/2] vhost: add vhost-scsi support to vhost library Changpeng Liu
2016-09-14  3:28     ` Yuanhan Liu
2016-09-14  4:46       ` Liu, Changpeng
2016-09-14  5:48         ` Yuanhan Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160913134959.GU23158@yliu-dev.sh.intel.com \
    --to=yuanhan.liu@linux.intel.com \
    --cc=changpeng.liu@intel.com \
    --cc=dev@dpdk.org \
    --cc=james.r.harris@intel.com \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.