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 B506D5F72 for ; Tue, 10 Jul 2018 23:48:16 +0200 (CEST) Received: by mail-pl0-f67.google.com with SMTP id t6-v6so8194444plo.7 for ; Tue, 10 Jul 2018 14:48:16 -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=f0NYKTPKdPHyQS1jVIsZjvr28sIW2hnWva5TpwYofdE=; b=M5r+h9NvHBKVd+SXAc6HAQ2C0lNLl5rs0goULB6EtC1PSIV4twDEUop9EAatwrijPD kA/V1Rk9/0Nv/lgQT71froLSG7HL4pwvyybfcCoBXMQxtHC5/0dDyuj76aEFzN2jZ5r4 uCWY3bgbKLjPZ3r/zwlChnajmBJSITziasl0nvQCrvvejh2flryMFtT+Z3vb8e9i4O1m milbl5pwCsweC0TpJG65psu4t/5ERWtLC5Zak9QiGBkQyTs85CjUDM7LBTCaUqlyfeBU qMcsUJ2UzdXNu6Wc7Oih7KtR3yTMHCXNkrDtrzTCFw1ZDHyHt8IyDNlOnu6VauOR5XAc 6ayw== 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=f0NYKTPKdPHyQS1jVIsZjvr28sIW2hnWva5TpwYofdE=; b=R98zqAySOfnkP8Qb+SaVv6dsFDcMd7LTHzMdC4x8TlGMa6A/6od2BylmHDKNLtB1pw Os4aNMlEX5sMabgDBCsCpeaJ1Hb8pr3V+E+cAOlwBum8z0tsLhKFii1lmUa5IMrH39EY pYsIXDSWzv2I7hpo7lipT+VEwoCVCtwSo6MBBec084v3y5la0f/hliIPTa0L2BEYQYiq 3Q8PfwEJ69bxPn1I7OEvY03Ys4e2rTR0/D/Y8PJVelt6LeIZpxYI05PUluuTmDaSO10y ZwnI8/2dTqGmAV8bhKgd4Kmav0qynXTsvq8JgTrGTiPJU3qgdrC5A7DN2wB3toLMA9zN eOfA== X-Gm-Message-State: APt69E1FVHjel6A9wuhk+H3tQfeUF3Udjq+LWzdhJJo7yU6US2jdWWFW HM/W/Tu/U3Ne8onRo+qFWZ1JjQ== X-Google-Smtp-Source: AAOMgpdiWJOTXalwgb2Z00q9+zcDv7HOVph3QjKx3HMuDl95uS3azRrEqH3js/nQ/Qm5WqbUuq3Jdg== X-Received: by 2002:a17:902:d218:: with SMTP id t24-v6mr26573076ply.63.1531259295951; Tue, 10 Jul 2018 14:48:15 -0700 (PDT) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 16-v6sm6193683pfp.6.2018.07.10.14.48.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Jul 2018 14:48:15 -0700 (PDT) Date: Tue, 10 Jul 2018 14:48:13 -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: <20180710144813.2d08babf@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:48:17 -0000 On Tue, 10 Jul 2018 19:03:27 +0800 Jeff Guo wrote: > > +/* uio pci device state */ > +enum rte_udev_state { > + RTE_UDEV_PROBED, > + RTE_UDEV_OPENNED, > + RTE_UDEV_RELEASED, > + RTE_UDEV_REMOVED, > +}; > + The states here are a little confusing. especially since pci_release seems to take different actions based on the state. And there is nothing preventing races between unexpected removal (PCI), and removing the device from being used by igb_uio. Would it be possible to only use state variable from the kernel PCI layer where the value is consistent? Also there is refcounting in PCI layer (and locking). Could that be used instead?