DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Yuanhan Liu <yuanhan.liu@linux.intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 3/7] vhost: refactor source code structure
Date: Wed, 24 Aug 2016 09:53:31 +0200	[thread overview]
Message-ID: <06fb8327-b71c-f816-a91c-4297ea7654d0@redhat.com> (raw)
In-Reply-To: <1471510123-4984-4-git-send-email-yuanhan.liu@linux.intel.com>



On 08/18/2016 10:48 AM, Yuanhan Liu wrote:
> The code structure is a bit messy now. For example, vhost-user message
> handling is spread to three different files:
>
>     vhost-net-user.c  virtio-net.c  virtio-net-user.c
>
> Where, vhost-net-user.c is the entrance to handle all those messages
> and then invoke the right method for a specific message. Some of them
> are stored at virtio-net.c, while others are stored at virtio-net-user.c.
>
> The truth is all of them should be in one file, vhost_user.c.
>
> So this patch refactors the source code structure: mainly on renaming
> files and moving code from one file to another file that is more suitable
> for storing it. Thus, no functional changes are made.
>
> After the refactor, the code structure becomes to:
>
> - socket.c      handles all vhost-user socket file related stuff, such
>                 as, socket file creation for server mode, reconnection
>                 for client mode.
>
> - vhost.c       mainly on stuff like vhost device creation/destroy/reset.
>                 Most of the vhost API implementation are there, too.
>
> - vhost_user.c  all stuff about vhost-user messages handling goes there.
>
> - virtio_net.c  all stuff about virtio-net should go there. It has virtio
>                 net Rx/Tx implementation only so far: it's just a rename
>                 from vhost_rxtx.c
>
> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> ---
>  lib/librte_vhost/Makefile                          |    6 +-
>  lib/librte_vhost/{vhost-net-user.c => socket.c}    |  209 +---
>  lib/librte_vhost/vhost.c                           |  409 ++++++++
>  lib/librte_vhost/{vhost-net.h => vhost.h}          |   24 +-
>  lib/librte_vhost/vhost_user.c                      | 1040 ++++++++++++++++++++
>  .../{vhost-net-user.h => vhost_user.h}             |   17 +-
>  lib/librte_vhost/virtio-net-user.c                 |  470 ---------
>  lib/librte_vhost/virtio-net-user.h                 |   62 --
>  lib/librte_vhost/virtio-net.c                      |  847 ----------------
>  lib/librte_vhost/{vhost_rxtx.c => virtio_net.c}    |    4 +-
>  10 files changed, 1489 insertions(+), 1599 deletions(-)
>  rename lib/librte_vhost/{vhost-net-user.c => socket.c} (71%)
>  create mode 100644 lib/librte_vhost/vhost.c
>  rename lib/librte_vhost/{vhost-net.h => vhost.h} (92%)
>  create mode 100644 lib/librte_vhost/vhost_user.c
>  rename lib/librte_vhost/{vhost-net-user.h => vhost_user.h} (87%)
>  delete mode 100644 lib/librte_vhost/virtio-net-user.c
>  delete mode 100644 lib/librte_vhost/virtio-net-user.h
>  delete mode 100644 lib/librte_vhost/virtio-net.c
>  rename lib/librte_vhost/{vhost_rxtx.c => virtio_net.c} (99%)

The structure is much cleaner now, and thanks for the detailed
information.

I didn't catch any error, and agree on the change:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

  reply	other threads:[~2016-08-24  7:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18  8:48 [dpdk-dev] [PATCH 0/7] vhost: vhost-cuse removal and code path refactoring Yuanhan Liu
2016-08-18  8:48 ` [dpdk-dev] [PATCH 1/7] vhost: remove vhost-cuse Yuanhan Liu
2016-08-22 13:46   ` Thomas Monjalon
2016-08-22 14:09     ` Yuanhan Liu
2016-08-29  6:45     ` Yuanhan Liu
2016-08-24  7:42   ` Maxime Coquelin
2016-08-18  8:48 ` [dpdk-dev] [PATCH 2/7] vhost: remove sub source dir Yuanhan Liu
2016-08-24  7:44   ` Maxime Coquelin
2016-08-18  8:48 ` [dpdk-dev] [PATCH 3/7] vhost: refactor source code structure Yuanhan Liu
2016-08-24  7:53   ` Maxime Coquelin [this message]
2016-08-18  8:48 ` [dpdk-dev] [PATCH 4/7] vhost: fold common message handlers Yuanhan Liu
2016-08-24  8:01   ` Maxime Coquelin
2016-08-18  8:48 ` [dpdk-dev] [PATCH 5/7] vhost: unify function names Yuanhan Liu
2016-08-24  8:02   ` Maxime Coquelin
2016-08-18  8:48 ` [dpdk-dev] [PATCH 6/7] vhost: get device once Yuanhan Liu
2016-08-24  8:04   ` Maxime Coquelin
2016-08-18  8:48 ` [dpdk-dev] [PATCH 7/7] vhost: simplify features set/get Yuanhan Liu
2016-08-24  8:11   ` Maxime Coquelin
2016-08-25  3:03     ` Yuanhan Liu
2016-08-25  7:18       ` Maxime Coquelin
2016-08-25  8:36         ` Xu, Qian Q
2016-08-25  9:10           ` Maxime Coquelin
2016-08-26  4:15         ` Yuanhan Liu
2016-08-24  7:30 ` [dpdk-dev] [PATCH 0/7] vhost: vhost-cuse removal and code path refactoring Xu, Qian Q
2016-08-24  7:47   ` 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=06fb8327-b71c-f816-a91c-4297ea7654d0@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=yuanhan.liu@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).