From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f65.google.com (mail-pg0-f65.google.com [74.125.83.65]) by dpdk.org (Postfix) with ESMTP id 7D1C0160 for ; Tue, 19 Dec 2017 16:39:04 +0100 (CET) Received: by mail-pg0-f65.google.com with SMTP id j4so10681191pgp.1 for ; Tue, 19 Dec 2017 07:39:04 -0800 (PST) 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=Kwn7MCt0xCsyKpMBnspCWiB/NPrJW9mLyT3WTcWD5Zw=; b=pbny6Y0m9tPY4juZWcqCwtfLq0uG3Dgunt1xMI71XDsqV+VHVKU0/W+hd2Rx6gpbGu nGg0PIDgVxeuIXT97AltBjiXhHNuQFEoEkJgyIi5xxEUiRmUVfIKq4wrDcGfetyaixY3 A/yNj2Nqwx8VBdH3Gj4x80rIBLKNLvSFbDntq2si95knin+pkcX3oZ5jIl1cm7gmtsvu Cfnzj0riOms9tpSjpzDm3W0wCPmEhhtZo+on1UkdnXnpMGJs8PmRz4Tex/k0z7apaFii fjLL6wVyay61cuQmwo/ncUNHBfnSZs6OODpGFZn3OWSEET2GQkfCM3th/SLdLLQ+4Iwx deeA== 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=Kwn7MCt0xCsyKpMBnspCWiB/NPrJW9mLyT3WTcWD5Zw=; b=hKPzanGKLF+c0qFqEezwztaTcCnX3h/m6C0WdrFvFrpckGYyx8DdwgmBJ3uYtOcL3a SxLP9aVOBXL8QdiitYKPQavBDddXR0FrEjdaxZqT1HvbNJPK6wLmAtdvi95xi3TuFZGB KyiPuR9hWVdjdSJCwmq0fNWe+n4vKTUIUY6BlKCufsiQukUW/WSw9zE9eRLOslt1wnh5 WRhQyk+/M5bco5a4c0c6ghICWSQPg6l2+OqGR3yiGnxg1XHO3KJPNsKAoFUvI5j+bBvP zgHDJVYA7HGwV9v69Hmb6bwbOD+F5LjHjfGSuRR4Br6718CIV9rRvkHnekMjEbF/Blxm Rovg== X-Gm-Message-State: AKGB3mLWIu9tvxN7sqVxcF3+TdIWx+9UJ7jaGc5HDMyvWEBPNee71AQl CisKkZPHOkqI6PxH0nStv7Tq3g== X-Google-Smtp-Source: ACJfBovLUGRqc4UISvLhOg7vhf/R6CDgGho5T7sHGvzd4DHZV0e/6oIkbKfHUiNPfv2s7LKXHkGhZw== X-Received: by 10.101.85.15 with SMTP id f15mr3430782pgr.63.1513697943694; Tue, 19 Dec 2017 07:39:03 -0800 (PST) Received: from xeon-e3 (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id e190sm29019507pfe.15.2017.12.19.07.39.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Dec 2017 07:39:03 -0800 (PST) Date: Tue, 19 Dec 2017 07:39:01 -0800 From: Stephen Hemminger To: Xiao Wang Cc: ferruh.yigit@intel.com, dev@dpdk.org Message-ID: <20171219073901.6d048a47@xeon-e3> In-Reply-To: <1513698140-92837-1-git-send-email-xiao.w.wang@intel.com> References: <1512784653-128951-1-git-send-email-xiao.w.wang@intel.com> <1513698140-92837-1-git-send-email-xiao.w.wang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] igb_uio: allow multi-process access 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, 19 Dec 2017 15:39:04 -0000 On Tue, 19 Dec 2017 07:42:20 -0800 Xiao Wang wrote: > + atomic_dec(&udev->refcnt); > + if (atomic_read(&udev->refcnt) > 0) > + return 0; > + The point of using atomic functions is to do atomic operations. You need to use atomic_dec_and_test here.