On Wed, Jan 24, 2018 at 08:40:42PM +0800, Liuyixian (Eason) wrote: > > > On 2018/1/23 19:07, Leon Romanovsky wrote: > > On Thu, Jan 18, 2018 at 10:34:30AM +0800, Yixian Liu wrote: > >> This patch updates to support rq record doorbell for > >> the kernel space. > >> > >> Signed-off-by: Yixian Liu <liuyixian@xxxxxxxxxx> > >> Signed-off-by: Lijun Ou <oulijun@xxxxxxxxxx> > >> Signed-off-by: Wei Hu (Xavier) <xavier.huwei@xxxxxxxxxx> > >> Signed-off-by: Shaobo Xu <xushaobo2@xxxxxxxxxx> > >> --- > >> drivers/infiniband/hw/hns/hns_roce_db.c | 112 ++++++++++++++++++++++++++++ > >> drivers/infiniband/hw/hns/hns_roce_device.h | 6 ++ > >> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 15 +--- > >> drivers/infiniband/hw/hns/hns_roce_main.c | 5 ++ > >> drivers/infiniband/hw/hns/hns_roce_qp.c | 18 ++++- > >> 5 files changed, 143 insertions(+), 13 deletions(-) > >> > >> diff --git a/drivers/infiniband/hw/hns/hns_roce_db.c b/drivers/infiniband/hw/hns/hns_roce_db.c > >> index 0908208..de3fa94 100644 > >> --- a/drivers/infiniband/hw/hns/hns_roce_db.c > >> +++ b/drivers/infiniband/hw/hns/hns_roce_db.c > >> @@ -92,3 +92,115 @@ void hns_roce_db_unmap_user(struct hns_roce_ucontext *context, > >> mutex_unlock(&context->db_page_mutex); > >> } > >> EXPORT_SYMBOL(hns_roce_db_unmap_user); > >> + > >> +static struct hns_roce_db_pgdir *hns_roce_alloc_db_pgdir( > >> + struct device *dma_device, gfp_t gfp) > >> +{ > >> + struct hns_roce_db_pgdir *pgdir; > >> + > >> + pgdir = kzalloc(sizeof(*pgdir), gfp); > >> + if (!pgdir) > >> + return NULL; > >> + > >> + bitmap_fill(pgdir->order1, HNS_ROCE_DB_PER_PAGE / 2); > >> + pgdir->bits[0] = pgdir->order0; > > > > order0? isn't it equal to zero? > > > > No. Here order0 is the name of a bitmap array and bits[0] points to it. pgdir was allocated with kzalloc() -> all fields are zero -> pgdir->order0 == 0 or pgdir->order0 == NULL -> What is the point in such assignment? Thanks
Attachment:
signature.asc
Description: PGP signature