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.
Thanks for pointing it out. Fix it in v3.
BRs,
Xiao
> -Original Message-
> From: Bie, Tiwei
> Sent: Tuesday, December 19, 2017 5:05 PM
> To: Wang, Xiao W
> Cc: Yigit, Ferruh ; dev@dpdk.org;
> step...@networkplumber.org
> Subject: Re: [dpdk-dev] [PATCH v2] igb_uio
Hi,
On Tue, Dec 19, 2017 at 07:42:20AM -0800, Xiao Wang wrote:
> @@ -336,6 +337,10 @@ struct rte_uio_pci_dev {
> struct pci_dev *dev = udev->pdev;
> int err;
>
> + atomic_inc(&udev->refcnt);
> + if (atomic_read(&udev->refcnt) > 1)
The "inc and read" should be atomic. Otherwi
3 matches
Mail list logo