RE: [RFC PATCH v5 04/16] RDMA/irdma: Add HMC backing store setup functions

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

 



> Subject: Re: [RFC PATCH v5 04/16] RDMA/irdma: Add HMC backing store setup
> functions
> 
> On Fri, Apr 17, 2020 at 10:12:39AM -0700, Jeff Kirsher wrote:
> > From: Mustafa Ismail <mustafa.ismail@xxxxxxxxx>
> >
> > HW uses host memory as a backing store for a number of protocol
> > context objects and queue state tracking.
> > The Host Memory Cache (HMC) is a component responsible for managing
> > these objects stored in host memory.
> >
> > Add the functions and data structures to manage the allocation of
> > backing pages used by the HMC for the various objects
> >
> > Signed-off-by: Mustafa Ismail <mustafa.ismail@xxxxxxxxx>
> > Signed-off-by: Shiraz Saleem <shiraz.saleem@xxxxxxxxx>
[....]

> > diff --git a/drivers/infiniband/hw/irdma/hmc.h
> > b/drivers/infiniband/hw/irdma/hmc.h
> > new file mode 100644
> > index 000000000000..6f3fbf61f048
> > --- /dev/null
> > +++ b/drivers/infiniband/hw/irdma/hmc.h
> > @@ -0,0 +1,217 @@
> > +/* SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB */
> > +/* Copyright (c) 2015 - 2019 Intel Corporation */ #ifndef IRDMA_HMC_H
> > +#define IRDMA_HMC_H
> > +
> > +#include "defs.h"
> > +
> > +#define IRDMA_HMC_MAX_BP_COUNT			512
> > +#define IRDMA_MAX_SD_ENTRIES			11
> > +#define IRDMA_HW_DBG_HMC_INVALID_BP_MARK	0xca
> > +#define IRDMA_HMC_INFO_SIGNATURE		0x484d5347
> > +#define IRDMA_HMC_PD_CNT_IN_SD			512
> > +#define IRDMA_HMC_DIRECT_BP_SIZE		0x200000
> > +#define IRDMA_HMC_MAX_SD_COUNT			8192
> > +#define IRDMA_HMC_PAGED_BP_SIZE			4096
> > +#define IRDMA_HMC_PD_BP_BUF_ALIGNMENT		4096
> > +#define IRDMA_FIRST_VF_FPM_ID			8
> > +#define FPM_MULTIPLIER				1024
> > +
> > +#define IRDMA_INC_SD_REFCNT(sd_table)	((sd_table)->ref_cnt++)
> > +#define IRDMA_INC_PD_REFCNT(pd_table)	((pd_table)->ref_cnt++)
> > +#define IRDMA_INC_BP_REFCNT(bp)		((bp)->ref_cnt++)
> > +
> > +#define IRDMA_DEC_SD_REFCNT(sd_table)	((sd_table)->ref_cnt--)
> > +#define IRDMA_DEC_PD_REFCNT(pd_table)	((pd_table)->ref_cnt--)
> > +#define IRDMA_DEC_BP_REFCNT(bp)		((bp)->ref_cnt--)
> 
> It is bad for two reasons, first you obfuscated simple ++/-- and second you called
> it refcnt, while we have special type for that.
>

Agreed on all fronts. Will fix.



[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