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.
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
* Global variables
*/
static u32 bnad_rxqs_per_cq = 2;
* Global variables
*/
static u32 bnad_rxqs_per_cq = 2;
static struct mutex bnad_list_mutex;
static const u8 bnad_bcast_addr[] __aligned(2) =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
static struct mutex bnad_list_mutex;
static const u8 bnad_bcast_addr[] __aligned(2) =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
bnad_add_to_list(struct bnad *bnad)
{
mutex_lock(&bnad_list_mutex);
bnad_add_to_list(struct bnad *bnad)
{
mutex_lock(&bnad_list_mutex);
mutex_unlock(&bnad_list_mutex);
}
mutex_unlock(&bnad_list_mutex);
}
bnad = netdev_priv(netdev);
bnad_lock_init(bnad);
bnad_add_to_list(bnad);
bnad = netdev_priv(netdev);
bnad_lock_init(bnad);
bnad_add_to_list(bnad);
+ bnad->id = atomic_inc_return(&bna_id) - 1;
mutex_lock(&bnad->conf_mutex);
/*
mutex_lock(&bnad->conf_mutex);
/*