From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f67.google.com (mail-pl0-f67.google.com [209.85.160.67]) by dpdk.org (Postfix) with ESMTP id C588E1B058 for ; Tue, 10 Jul 2018 23:52:57 +0200 (CEST) Received: by mail-pl0-f67.google.com with SMTP id s24-v6so8195834plq.6 for ; Tue, 10 Jul 2018 14:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F5mmhiuzc0/aNWnv7Nh1qHsXsDE/xXEFZ3yi4vQd3cQ=; b=U4SlNLAqGV1KqCebBS77DesC2HjBTkhnn91Dot6pP1fySUnvqpUZI6y4OCIbTUVJG+ /EjtNS0E0jYjvGaCa1BCBZ4m/NjvRJC70EQQ4PttIUHTqv0igVudeCV3FrvaLHaLXkVy 8AE+/lhj9D1hv53bVP5XZMK7N5SjmZl0K5cHUB4Caxc6PMmS4ERiIdzecqnxfdtZdXZ4 RmSCg27Tl67BBFKHJTdu5BvQic/599/9h/WNP3ojPzfgz3kEca4e0pJXuVmEHW+eJWmo yYq+9eKLYzcIE5hnrDG9Pg4p9vcICmfnVFUYl+TjcupDZfOuV+DBcJU8qaQHAGa151rG /4iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=F5mmhiuzc0/aNWnv7Nh1qHsXsDE/xXEFZ3yi4vQd3cQ=; b=ZBYtjDy1FNRIgHmNkQPWVaNHSpSi+f6V9MvjYq32SzBoHiDLnzVGYXpfDFrfVw88Jj M/VVK1GJfWxof3DTheN0CYFA49dhQ/bSdS22b15BovhXTkKZoRkbtwYEZVEPGlEz3BHR y2JhTdgQlsdZ7NgHGB0mD5L8jZTkz53TwYeUiyNMwySn7UoH+w3zq1VFPtjeNS0AEbzi nIRv7zrQe61tdICSLUBqVK85LHutL7T1b6cN/QO4PF7mMxfQE0abs5Njmw3f9Th7Xm1W OjpSxh7HhzLWCbCb3Ala3fElgfDcfDdRT6MIzmkptUsEAh+PUKY1xo7DlQzb+Rjeiu3B fBbg== X-Gm-Message-State: APt69E3WaWvimCW8OWBSZU01DMW+6zgNYLoccPSGuPjCFMrLgU9/2A8u XykUFrvpiTvOmIRgiF7azA6lpQ== X-Google-Smtp-Source: AAOMgpeciXd9LMoUO9X/xxFRchhEMDzMHUd+8vO2R0CYG/Llre5qP/EMP+UR8FCnFoeG4kAgFqE6EQ== X-Received: by 2002:a17:902:988f:: with SMTP id s15-v6mr2497027plp.95.1531259576992; Tue, 10 Jul 2018 14:52:56 -0700 (PDT) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id h7-v6sm12262564pfd.155.2018.07.10.14.52.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Jul 2018 14:52:56 -0700 (PDT) Date: Tue, 10 Jul 2018 14:52:54 -0700 From: Stephen Hemminger To: Jeff Guo Cc: bruce.richardson@intel.com, ferruh.yigit@intel.com, konstantin.ananyev@intel.com, gaetan.rivet@6wind.com, jingjing.wu@intel.com, thomas@monjalon.net, motih@mellanox.com, matan@mellanox.com, harry.van.haaren@intel.com, qi.z.zhang@intel.com, shaopeng.he@intel.com, bernard.iremonger@intel.com, arybchenko@solarflare.com, wenzhuo.lu@intel.com, jblunck@infradead.org, shreyansh.jain@nxp.com, dev@dpdk.org, helin.zhang@intel.com Message-ID: <20180710145254.661da2cf@xeon-e3> In-Reply-To: <1531220607-2977-8-git-send-email-jia.guo@intel.com> References: <1498711073-42917-1-git-send-email-jia.guo@intel.com> <1531220607-2977-1-git-send-email-jia.guo@intel.com> <1531220607-2977-8-git-send-email-jia.guo@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v8 7/7] igb_uio: fix uio release issue for hotplug 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: Tue, 10 Jul 2018 21:52:58 -0000 On Tue, 10 Jul 2018 19:03:27 +0800 Jeff Guo wrote: > When hotplug out device, the device resource will be released in kernel. > The fd sys file will disappear, and the irq will be released. At this time, > if igb uio driver still try to release this resource, it will cause kernel > crash. On the other hand, interrupt disabling do not automatically be > processed in kernel. If not handle it, this redundancy and dirty thing will > affect the interrupt resource be used by other device. So the igb_uio > driver have to check the hotplug status, and the corresponding process > should be taken in igb uio driver. > > This patch propose to add enum rte_udev_state into struct rte_uio_pci_dev > of igb uio driver, which will record the state of uio device, such as > probed/opened/released/removed. When detect the unexpected removal which > cause of hotplug out behavior, it will corresponding disable interrupt > resource. For the part of releasement which kernel have already handle, > just skip it to avoid double free or null pointer crash issue. > > Signed-off-by: Jeff Guo The PCI hotplug management is an important and potentially error prone error of DPDK. I realize that English is not your native language, but the commit messages for this are hard to read. Perhaps you can get a volunteer or other person in the community to reword them. The commit logs and comments contain important information about the documentation of the code. How does VFIO handle hotplug? We should direct all users to use VFIO since it is supported and secure. Igb uio has always been a slightly dangerous (as they say "running with scissors") way of accessing devices.