From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43BB437E63; Wed, 24 Aug 2016 07:53:34 +0000 (UTC) Received: from [10.36.7.65] (vpn1-7-65.ams2.redhat.com [10.36.7.65]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u7O7rWXv018255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 24 Aug 2016 03:53:33 -0400 To: Yuanhan Liu , dev@dpdk.org References: <1471510123-4984-1-git-send-email-yuanhan.liu@linux.intel.com> <1471510123-4984-4-git-send-email-yuanhan.liu@linux.intel.com> From: Maxime Coquelin Message-ID: <06fb8327-b71c-f816-a91c-4297ea7654d0@redhat.com> Date: Wed, 24 Aug 2016 09:53:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1471510123-4984-4-git-send-email-yuanhan.liu@linux.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 24 Aug 2016 07:53:34 +0000 (UTC) Subject: Re: [dpdk-dev] [PATCH 3/7] vhost: refactor source code structure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Aug 2016 07:53:35 -0000 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