From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH 3/7] vhost: refactor source code structure Date: Wed, 24 Aug 2016 09:53:31 +0200 Message-ID: <06fb8327-b71c-f816-a91c-4297ea7654d0@redhat.com> References: <1471510123-4984-1-git-send-email-yuanhan.liu@linux.intel.com> <1471510123-4984-4-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit To: Yuanhan Liu , dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id BE3AA532E for ; Wed, 24 Aug 2016 09:53:34 +0200 (CEST) In-Reply-To: <1471510123-4984-4-git-send-email-yuanhan.liu@linux.intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 > --- > 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 Thanks, Maxime