From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id BD7295599 for ; Mon, 10 Jul 2017 00:36:00 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 68F85205E1; Sun, 9 Jul 2017 18:36:00 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Sun, 09 Jul 2017 18:36:00 -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=lXWIHIEt2amDiHx aCqkJPRM0HcPdcmF3Tz1BHOq8YME=; b=nfg6VuXn9GFZenAbSbXpdhrCsPLcTnq 4NQQtyVWXgwLYSRNqV9jpEP41HPT+LIROp0REBYmGBzoO9Rad9L5JC0r9k4sx6DI UMusHQfbV12noXpUOQnl2XlcNsc7ItQ8lme+ZAddye9MGcIckgn6pfoACekXJ7oL U8e9DC6dJ91g= 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=lXWIHIEt2amDiHxaCqkJPRM0HcPdcmF3Tz1BHOq8YME=; b=KKAgljOp 2LYtp0NgdcPmVn3XKrhwKp08ZxeyjqJQbIACMTuA2YsIeRSr33PmZPccXtrkqx32 zfjAbLmyLI2OaHrWnbotLzWgNi3msjfaVlIes0C2yuje9XaKt6lKJ3g4cKdvRJTD HFenWRhg4prHMZwkKaMndU5dnZlSoxEZBtT2tvJj+RGqtWI7fY0v8tC8/UKHuEDe aLsLSSiG3qehN3XjvDKTGb9KoBoOjpA1J4lpJIja5Hr+fv3eCBBbXFWlzudV0+21 7Awr3KTABJZl4/8cYoRz2+qi2KbZX9LfAAw3SreJoBztorZ7m7riUvH6R0lGbrOL he3t07Q59b2VvA== X-ME-Sender: X-Sasl-enc: 4CyPqW4+BM9NOdVU4tWB0UgZBOtqZXFj9cE9CHwukjHq 1499639760 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 13DFD7E5C8; Sun, 9 Jul 2017 18:36:00 -0400 (EDT) From: Thomas Monjalon To: "Guo, Jia" Cc: dev@dpdk.org, helin.zhang@intel.com, jingjing.wu@intel.com, bruce.richardson@intel.com, konstantin.ananyev@intel.com, gaetan.rivet@6wind.com, thomas.monjalon@6wind.com, ferruh.yigit@intel.com Date: Mon, 10 Jul 2017 00:35:59 +0200 Message-ID: <6683978.dxTV7H3Ttm@xps> In-Reply-To: References: <1498648044-57541-2-git-send-email-jia.guo@intel.com> <7030258.umMgtiJvDN@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3 2/2] net/i40e: add hot plug monitor in i40e 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: Sun, 09 Jul 2017 22:36:01 -0000 07/07/2017 16:08, Guo, Jia: > > On 7/7/2017 6:17 PM, Thomas Monjalon wrote: > > 07/07/2017 09:56, Thomas Monjalon: > >> 29/06/2017 07:01, Jeff Guo: > >>> --- a/drivers/net/i40e/i40e_ethdev.c > >>> +++ b/drivers/net/i40e/i40e_ethdev.c > >>> @@ -1283,6 +1283,7 @@ static inline void i40e_GLQF_reg_init(struct i40e_hw *hw) > >>> > >>> /* enable uio intr after callback register */ > >>> rte_intr_enable(intr_handle); > >>> + > >>> /* > >>> * Add an ethertype filter to drop all flow control frames transmitted > >>> * from VSIs. By doing so, we stop VF from sending out PAUSE or PFC > >>> @@ -5832,11 +5833,29 @@ struct i40e_vsi * > >>> { > >>> struct rte_eth_dev *dev = (struct rte_eth_dev *)param; > >>> struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); > >>> + struct rte_uevent event; > >>> uint32_t icr0; > >>> + struct rte_pci_device *pci_dev; > >>> + struct rte_intr_handle *intr_handle; > >>> + > >>> + pci_dev = RTE_ETH_DEV_TO_PCI(dev); > >>> + intr_handle = &pci_dev->intr_handle; > >>> > >>> /* Disable interrupt */ > >>> i40e_pf_disable_irq0(hw); > >>> > >>> + /* check device uevent */ > >>> + if (rte_uevent_get(intr_handle->uevent_fd, &event) == 0) { > >>> + if (event.subsystem == RTE_UEVENT_SUBSYSTEM_UIO) { > >>> + if (event.action == RTE_UEVENT_REMOVE) { > >>> + _rte_eth_dev_callback_process(dev, > >>> + RTE_ETH_EVENT_INTR_RMV, NULL); > >>> + return; > >>> + } > >>> + }if > >>> + goto done; > >>> + } > >> There is nothing specific to i40e in this patch. > >> It seems wrong to add such generic code in every drivers. > > It should be managed at bus layer and not be specific to ethdev only. > if all could managed at bus layer might also be what i want to see, > but that would not so economical at currently. because of the event need > to exposure to driver to use app's callback to handle it by > detach/attach device. mlx driver also go through this path to show the > rmv event usege. we just add uevent for pci uio device. Anyway, i think > the uevent must be useful for future PF/VFIO live migration. if there > are not other concern about the other patch that added uevent api in > eal([PATCH v3 1/2] eal: add uevent api for hot plug), i suggest to merge > it at first. Then we could go next to enhancement it with the 6wind hot > plug feature. Sorry it looks wrong to apply half of this patchset, given we are not sure how the remaining part should be implemented. Let's take time for a better solution and try to gather more opinions. It will be highlighted as one of the next priorities, after the bus rework in progress.