From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id 148FF19F5 for ; Thu, 15 Mar 2018 16:47:39 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 24B092119B; Thu, 15 Mar 2018 11:47:38 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 15 Mar 2018 11:47:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=3higiku0q5uENyEHKr6jlW46Hs BXpliwxcAqf2AU18E=; b=gF46HzpOtL+9lLCtTPBXZTZKBo7Et9DrDN0i/4cDna JxVqjkrAi0hoTowNa34rZorpBCtJXBwwYjDuW1IfQHzFdshOBFucIvgsZ6AZ9mxY DqkRZF8Vik6M78XQIgu3T//Xf6sKF+ngjzVqbWI+c4HdEqZNJtDlqqKtN9k0LOxM 8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=3higik u0q5uENyEHKr6jlW46HsBXpliwxcAqf2AU18E=; b=QY7yPybPc4ibsM/h1x/+HV /otmtj77wB85PWF20BAS89/R28Yc7ACPP5iQ04DzjmH4L69jB9kBGonmPqDx/jBz /SPcOLjwZ20dTF4VNEMApEHUnn8+38Cc/T1kSRp8TFFl7BJAARNodi0fl0eXnYmW HVl+gl6Oy9iwnCMF+mv65qL9SeKbgphVPTk2zFdNRvnC5+9FT0V9yC3WaubNQSQx TJuk0Wv7J66z7j4wddy38et9t3QHuv9oVEmvmogcKpzaVLzRnM88jnyTf6tI93F9 noXzAlzh7TKaca7Y4Rp58Op3yQzg976mkPXQKv/p2YfOHHbFDIkyqMAfNfTIZLgQ == X-ME-Sender: Received: from xps.localnet (unknown [193.47.165.251]) by mail.messagingengine.com (Postfix) with ESMTPA id 138E97E1FF; Thu, 15 Mar 2018 11:47:35 -0400 (EDT) From: Thomas Monjalon To: "Yang, Zhiyong" Cc: "Tan, Jianfeng" , Maxime Coquelin , "dev@dpdk.org" , "yliu@fridaylinux.org" , "Bie, Tiwei" , "Wang, Zhihong" , "Wang, Dong1" Date: Thu, 15 Mar 2018 10:32:40 +0100 Message-ID: <4377329.31r3eYUQgx@xps> In-Reply-To: References: <20180214145330.4679-1-zhiyong.yang@intel.com> <9059097.ABoCBN0gVk@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Thu, 15 Mar 2018 15:47:39 -0000 13/03/2018 10:50, Yang, Zhiyong: > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > 13/03/2018 09:46, Yang, Zhiyong: > > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > > > 05/03/2018 08:43, Yang, Zhiyong: > > > > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > > > > > I don't see why it should be exported outside of DPDK, except for > > PMDs. > > > > > > I would tend to keep it internal but I understand that it would > > > > > > mean duplicating some code, which is not ideal. > > > > > > Please could you show what would be the content of the .h in EAL? > > > > > > > > > > > > > > > > If needed to expose them in eal.h, I think that they should be the > > > > > whole fdset mechanism as followings. > > > > > > > > > > typedef void (*fd_cb)(int fd, void *dat, int *remove); > > > > > > > > > > struct fdentry { > > > > > int fd; /* -1 indicates this entry is empty */ > > > > > fd_cb rcb; /* callback when this fd is readable. */ > > > > > fd_cb wcb; /* callback when this fd is writeable.*/ > > > > > void *dat; /* fd context */ > > > > > int busy; /* whether this entry is being used in cb. */ > > > > > }; > > > > > > > > > > struct fdset { > > > > > struct pollfd rwfds[MAX_FDS]; > > > > > struct fdentry fd[MAX_FDS]; > > > > > pthread_mutex_t fd_mutex; > > > > > int num; /* current fd number of this fdset */ > > > > > }; > > > > > > > > > > void fdset_init(struct fdset *pfdset); (not used in the patchset) > > > > > > > > > > int fdset_add(struct fdset *pfdset, int fd, > > > > > fd_cb rcb, fd_cb wcb, void *dat); (used in this patchset) > > > > > > > > > > void *fdset_del(struct fdset *pfdset, int fd); (not used in the > > > > > patchset) > > > > > > > > > > void *fdset_event_dispatch(void *arg); (used in this patchset) > > > > > > > > > > seems that we have 4 options. > > > > > 1) expose them in librte_vhost > > > > > 2) expose them in other existing or new libs. for example, eal. > > > > > 3) duplicate the code lines at PMD layer. > > > > > 4) do it as the patch does that. > > > > > > > > It looks to be very close of the interrupt thread. > > > > Can we have all merged in an unique event dispatcher thread? > > > > > > If I understand right, do you mean that we can merge them in lib eal ? right? > > > > Yes merge with interrupt thread in EAL. > > I didn't look at the details, but it seems the right place for such thing. > > > Ok, we have to expose them as new APIs. Expect that somebody as DPDK users can use and like them as well. :) I think you missed my initial question: Is it possible to merge the vhost events needs in the EAL interrupt thread?