From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 006B32C8 for ; Wed, 5 Jul 2017 09:32:12 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 79664209D8; Wed, 5 Jul 2017 03:32:12 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Wed, 05 Jul 2017 03:32:12 -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:x-sasl-enc; s=mesmtp; bh=8jyvIqxuhrss8ZK 4CFaTk6ec/7mtY9R7LDLg5Zx4kqM=; b=Et47DkACPwo22DZdXBc/zZxcWKVkSQo PX0tzNIGivzBlZJGs2kYlzzRMwOprEQdQXX2hQiEeRzkDuAl6joPvx4O3cGpp61Q 6nDSlpjIOodX/07+yljYNOwlynzOdUrUHja92WreZT2lot7C9FgBkYhfLOd4wpgq 2mrGg4C/lovo= 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:x-sasl-enc; s= fm1; bh=8jyvIqxuhrss8ZK4CFaTk6ec/7mtY9R7LDLg5Zx4kqM=; b=KNZiLrSq iL8qBXwd9iJSvDLsE5mSaJbIQ76lFL/07XjENWS1+8IRZmz993UhrhZtrdTwH+gd dJdDeAqDenGkPo8QJ4HTNx5mtAFvTriLXmnItZR5mDOuQkFW3R/iH/xJYTp4F1cb azoP/jb7yReUFFqSjKFACws9rVyzca0GlBNN+Z6A7Vz1IlCtNBOVZXYkvrnEoUCU Qtgf1laOjr/DIYDW+TTjoKhT4oSYT8OCMhbKVwbUtuV+mZPiHtzTicHMPcj8KCJL Zzs8tBZdhgduFAkbjQSWsLwdRNvnWRlZFiu+t7SAzait72qTnyX5MFThOk3iz7Lz j7L+dD9lF5Xi7w== X-ME-Sender: X-Sasl-enc: QdvwVM1r8tko62buZ9qDnUC6PQy8F3PAhP4XGnPmcbzG 1499239932 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 2E5A724254; Wed, 5 Jul 2017 03:32:12 -0400 (EDT) From: Thomas Monjalon To: "Guo, Jia" Cc: dev@dpdk.org, helin.zhang@intel.com, jingjing.wu@intel.com Date: Wed, 05 Jul 2017 09:32:11 +0200 Message-ID: <3931985.8o2Ck0PCcH@xps> In-Reply-To: References: <1495986280-26207-1-git-send-email-jia.guo@intel.com> <1643564.1KfnGSoeuV@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 1/2] eal: add uevent api for hot plug 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, 05 Jul 2017 07:32:13 -0000 05/07/2017 05:02, Guo, Jia: > hi, thomas > > > On 7/5/2017 7:45 AM, Thomas Monjalon wrote: > > Hi, > > > > This is an interesting step for hotplug in DPDK. > > > > 28/06/2017 13:07, Jeff Guo: > >> + netlink_fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT); > > It is monitoring the whole system... > > > >> +int > >> +rte_uevent_get(int fd, struct rte_uevent *uevent) > >> +{ > >> + int ret; > >> + char buf[RTE_UEVENT_MSG_LEN]; > >> + > >> + memset(uevent, 0, sizeof(struct rte_uevent)); > >> + memset(buf, 0, RTE_UEVENT_MSG_LEN); > >> + > >> + ret = recv(fd, buf, RTE_UEVENT_MSG_LEN - 1, MSG_DONTWAIT); > > ... and it is read from this function called by one driver. > > It cannot work without a global dispatch. > the rte_uevent-connect is called in func of pci_uio_alloc_resource, so > each socket is created by by each uio device. so i think that would not > affect each driver isolate to use it. Ah OK, I missed it. > > It must be a global mechanism, probably a service core. > > The question is also to know whether it should be a mandatory > > service in DPDK or an optional helper? > a global mechanism would be good, but so far, include mlx driver, we all > handle the hot plug event in driver by app's registered callback. maybe > a better global would be try in the future. but now is would work for all > pci uio device. mlx drivers have a special connection to the kernel through the associated mlx kernel drivers. That's why the PMD handle the events in a specific way. You are adding event handling for UIO. Now we need also VFIO. I am wondering how it could be better integrated in the bus layer. > and more, if in pci uio device to use hot plug , i think it might be > mandatory.