Re: [PATCH 5/8] bnxt_re: Fix race between the netdev register and unregister events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2017-08-31 at 09:27 +0530, Somnath Kotur wrote:
> diff --git a/drivers/infiniband/hw/bnxt_re/bnxt_re.h
> b/drivers/infiniband/hw/bnxt_re/bnxt_re.h
> index b3ad37f..a25f9d2 100644
> --- a/drivers/infiniband/hw/bnxt_re/bnxt_re.h
> +++ b/drivers/infiniband/hw/bnxt_re/bnxt_re.h
> @@ -93,11 +93,13 @@ struct bnxt_re_dev {
>         struct ib_device                ibdev;
>         struct list_head                list;
>         unsigned long                   flags;
> -#define BNXT_RE_FLAG_NETDEV_REGISTERED 0
> -#define BNXT_RE_FLAG_IBDEV_REGISTERED  1
> -#define BNXT_RE_FLAG_GOT_MSIX          2
> -#define BNXT_RE_FLAG_RCFW_CHANNEL_EN   8
> -#define BNXT_RE_FLAG_QOS_WORK_REG      16
> +#define BNXT_RE_FLAG_NETDEV_REGISTERED         0
> +#define BNXT_RE_FLAG_IBDEV_REGISTERED          1
> +#define BNXT_RE_FLAG_GOT_MSIX                  2
> +#define BNXT_RE_FLAG_HAVE_L2_REF               3
> +#define BNXT_RE_FLAG_RCFW_CHANNEL_EN           4
> +#define BNXT_RE_FLAG_QOS_WORK_REG              5
> +#define BNXT_RE_FLAG_TASK_IN_PROG              6
>         struct net_device               *netdev;

So, this is making two changes in once and one of the changes is not
documented.  In particular, it looks like the usage of your flags
elements was originally the actual value of 1 << bit, which is the
wrong thing to pass to the *_bit() operations that want a bit number. 
So you're both adding a new used bit in your flags, but also changing
your flags to be better numbered for use with the *_bit operations.  I
did a quick check and the BNXT_RE_FLAGS* items are never used without
using the bit operations, so this change is safe.  I'm going to update
the commit log when I take this to make that clear.  Generally though,
this should have been two patches.

-- 
Doug Ledford <dledford@xxxxxxxxxx>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux