[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D5F50672B@AcuExch.aculab.com>
Date: Mon, 1 Aug 2016 14:20:36 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Ivan Vecera' <ivecera@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "rasesh.mody@...gic.com" <rasesh.mody@...gic.com>
Subject: RE: [PATCH net-next 2/3] bna: change type of bna_id to atomic_t
From: Ivan Vecera
> Sent: 29 July 2016 18:53
> Change type of bna_id to atomic_t. The bnad_list_mutex is used to prevent
> a race when bna_id is incremented. After the change the mutex can be
> removed in the next step.
...
> -static u32 bna_id;
> +static atomic_t bna_id;
...
> bnad_lock_init(bnad);
> bnad_add_to_list(bnad);
> + bnad->id = atomic_inc_return(&bna_id) - 1;
...
Is the 'id' expected to be unique?
Looks like they get reallocated after 2^32 allocates.
David
Powered by blists - more mailing lists