From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id CF55B2BC7 for ; Wed, 28 Feb 2018 09:45:30 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C5FCEB6F0; Wed, 28 Feb 2018 08:45:30 +0000 (UTC) Received: from [10.36.112.52] (ovpn-112-52.ams2.redhat.com [10.36.112.52]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF03E213AEF5; Wed, 28 Feb 2018 08:45:28 +0000 (UTC) To: "Yang, Zhiyong" , "dev@dpdk.org" , "yliu@fridaylinux.org" , "Tan, Jianfeng" , "Bie, Tiwei" , "Wang, Zhihong" Cc: "Wang, Dong1" References: <20180214145330.4679-1-zhiyong.yang@intel.com> <20180214145330.4679-2-zhiyong.yang@intel.com> <05ac437d-fb8d-30b9-a3fc-a59b648a5a2a@redhat.com> From: Maxime Coquelin Message-ID: Date: Wed, 28 Feb 2018 09:45:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 28 Feb 2018 08:45:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 28 Feb 2018 08:45:30 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH 1/4] vhost: move fdset functions from fd_man.c to fd_man.h X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Feb 2018 08:45:31 -0000 On 02/28/2018 02:36 AM, Yang, Zhiyong wrote: > > >> -----Original Message----- >> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com] >> Sent: Wednesday, February 28, 2018 1:52 AM >> To: Yang, Zhiyong ; dev@dpdk.org; >> yliu@fridaylinux.org; Tan, Jianfeng ; Bie, Tiwei >> ; Wang, Zhihong >> Cc: Wang, Dong1 >> Subject: Re: [PATCH 1/4] vhost: move fdset functions from fd_man.c to >> fd_man.h >> >> Hi Zhiyong, >> >> On 02/14/2018 03:53 PM, Zhiyong Yang wrote: >>> The patch moves fdset related funcitons from fd_man.c to fd_man.h in >>> order to reuse these funcitons from the perspective of PMDs. >>> >>> Signed-off-by: Zhiyong Yang >>> --- >>> lib/librte_vhost/Makefile | 3 +- >>> lib/librte_vhost/fd_man.c | 274 ---------------------------------------------- >>> lib/librte_vhost/fd_man.h | 258 >> +++++++++++++++++++++++++++++++++++++++++-- >>> 3 files changed, 253 insertions(+), 282 deletions(-) >>> delete mode 100644 lib/librte_vhost/fd_man.c >> >> I disagree with the patch. >> It is a good thing to reuse the code, but to do it, you need to extend the >> vhost lib API. >> >> New API need to be prefixed with rte_vhost_, and be declared in >> rte_vhost.h. >> >> And no need to move the functions from the .c to the .h file, as it moreover >> makes you inline them, which is not necessary here. > > Thanks for your reviewing the series firstly, Maxime. :) > > I considered to do it as you said. However I still preferred this one at last. > Here are my reasons. > 1) As far as I know, this set of functions are used privately in librte_vhost before this feature. > No strong request from the perspective of DPDK application. If I understand well, It is enough to expose the functions to all PMDs > And it is better to keep internal use in DPDK. But what the patch is doing is adding fd_man.h to the API, without doing it properly. fd_man.h will be installed with other header files, and any external application can use it. > > 2) These functions help to implement vhost user, but they are not strongly related to other APIs of vhost user which have already exposed. > if we want to expose them as APIs at lib layer, many functions and related data structure has to be exposed in rte_vhost.h. it looks messy. > Your opinion? Yes, it is not really vhost-related, it could be part of a more generic library. It is maybe better to duplicate these lines, or to move this code in a existing or new library. Cheers, Maxime > thanks > Zhiyong >