Re: [PATCH 2/7] RDMA/bnxt_re: Add 64bit doorbells for 57500 series

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

 



On Thu, Jan 3, 2019 at 2:24 AM Jason Gunthorpe <jgg@xxxxxxxxxxxx> wrote:
>
> On Mon, Dec 31, 2018 at 01:10:02AM -0500, Devesh Sharma wrote:
>
> > +static inline void bnxt_qplib_ring_nq_db64(void __iomem *db, u32 index,
> > +                                        u16 xid, bool arm)
> > +{
> > +     struct dbc_dbc  hdr64 = { 0 };
> > +     u32 tmp = 0;
> > +     u64 *val;
> > +
> > +     hdr64.index = cpu_to_le32(index & DBC_DBC_INDEX_MASK);
> > +     tmp = xid & DBC_DBC_XID_MASK;
> > +     tmp |= DBC_DBC_PATH_ROCE;
> > +     tmp |= arm ? DBC_DBC_TYPE_NQ_ARM : DBC_DBC_TYPE_NQ;
> > +     hdr64.type_path_xid = cpu_to_le32(tmp);
> > +     val = (u64 *)&hdr64.index;
> > +     wmb();
> > +     writeq(*val, db);
>
> wmb is not needed before writeq()
Will be fixed in V2.
>
> > +static inline void bnxt_qplib_ring_creq_db64(void __iomem *db, u32 index,
> > +                                          u16 xid, bool arm)
> > +{
> > +     struct dbc_dbc  hdr64 = { 0 };
> > +     u32 tmp = 0;
> > +     u64 *val;
> > +
> > +     hdr64.index = cpu_to_le32(index & DBC_DBC_INDEX_MASK);
> > +     tmp = xid & DBC_DBC_XID_MASK;
> > +     tmp |= DBC_DBC_PATH_ROCE;
> > +     tmp |= arm ? DBC_DBC_TYPE_NQ_ARM : DBC_DBC_TYPE_NQ;
> > +     hdr64.type_path_xid = cpu_to_le32(tmp);
> > +     val = (u64 *)&hdr64.index;
> > +     wmb();
> > +     writeq(*val, db);
>
> same
done!
>
> >  #define to_bnxt_qplib(ptr, type, member)     \
> >       container_of(ptr, type, member)
>
> What a weird thing to do??
Indeed, a series of cleanup patch is required desperately!
>
> > +/* dbc_dbc (size:64b/8B) */
> > +struct dbc_dbc {
> > +     __le32  index;
> > +     #define DBC_DBC_INDEX_MASK 0xffffffUL
> > +     #define DBC_DBC_INDEX_SFT 0
> > +     __le32  type_path_xid;
> > +     #define DBC_DBC_XID_MASK          0xfffffUL
> > +     #define DBC_DBC_XID_SFT           0
> > +     #define DBC_DBC_PATH_MASK         0x3000000UL
> > +     #define DBC_DBC_PATH_SFT          24
> > +     #define DBC_DBC_PATH_ROCE           (0x0UL << 24)
> > +     #define DBC_DBC_PATH_L2             (0x1UL << 24)
> > +     #define DBC_DBC_PATH_ENGINE         (0x2UL << 24)
> > +     #define DBC_DBC_PATH_LAST          DBC_DBC_PATH_ENGINE
> > +     #define DBC_DBC_DEBUG_TRACE       0x8000000UL
> > +     #define DBC_DBC_TYPE_MASK         0xf0000000UL
> > +     #define DBC_DBC_TYPE_SFT          28
> > +     #define DBC_DBC_TYPE_SQ             (0x0UL << 28)
> > +     #define DBC_DBC_TYPE_RQ             (0x1UL << 28)
> > +     #define DBC_DBC_TYPE_SRQ            (0x2UL << 28)
> > +     #define DBC_DBC_TYPE_SRQ_ARM        (0x3UL << 28)
> > +     #define DBC_DBC_TYPE_CQ             (0x4UL << 28)
> > +     #define DBC_DBC_TYPE_CQ_ARMSE       (0x5UL << 28)
> > +     #define DBC_DBC_TYPE_CQ_ARMALL      (0x6UL << 28)
> > +     #define DBC_DBC_TYPE_CQ_ARMENA      (0x7UL << 28)
> > +     #define DBC_DBC_TYPE_SRQ_ARMENA     (0x8UL << 28)
> > +     #define DBC_DBC_TYPE_CQ_CUTOFF_ACK  (0x9UL << 28)
> > +     #define DBC_DBC_TYPE_NQ             (0xaUL << 28)
> > +     #define DBC_DBC_TYPE_NQ_ARM         (0xbUL << 28)
> > +     #define DBC_DBC_TYPE_NULL           (0xfUL << 28)
> > +     #define DBC_DBC_TYPE_LAST          DBC_DBC_TYPE_NULL
> > +};
> > +
> > +/* dbc_dbc32 (size:32b/4B) */
> > +struct dbc_dbc32 {
> > +     __le32  type_abs_incr_xid;
> > +     #define DBC_DBC32_XID_MASK 0xfffffUL
> > +     #define DBC_DBC32_XID_SFT  0
> > +     #define DBC_DBC32_PATH_MASK 0xc00000UL
> > +     #define DBC_DBC32_PATH_SFT 22
> > +     #define DBC_DBC32_PATH_ROCE  (0x0UL << 22)
> > +     #define DBC_DBC32_PATH_L2    (0x1UL << 22)
> > +     #define DBC_DBC32_PATH_LAST DBC_DBC32_PATH_L2
> > +     #define DBC_DBC32_INCR_MASK 0xf000000UL
> > +     #define DBC_DBC32_INCR_SFT 24
> > +     #define DBC_DBC32_ABS      0x10000000UL
> > +     #define DBC_DBC32_TYPE_MASK 0xe0000000UL
> > +     #define DBC_DBC32_TYPE_SFT 29
> > +     #define DBC_DBC32_TYPE_SQ    (0x0UL << 29)
> > +     #define DBC_DBC32_TYPE_LAST DBC_DBC32_TYPE_SQ
> >  };
>
> Please use some sensible choice for horizontal white space and not
> just random sprinkling.
This will be fixed in V2.
>
> Jason



[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