On Wed, Sep 25, 2019 at 12:05:48AM +0300, Max Gurtovoy wrote: > Use the general linux definition for 4K and retrieve the rest from it. > > Signed-off-by: Max Gurtovoy <maxg@xxxxxxxxxxxx> > Reviewed-by: Sagi Grimberg <sagi@xxxxxxxxxxx> > --- > drivers/infiniband/ulp/iser/iscsi_iser.c | 2 +- > drivers/infiniband/ulp/iser/iscsi_iser.h | 8 ++------ > drivers/infiniband/ulp/iser/iser_memory.c | 4 ++-- > drivers/infiniband/ulp/iser/iser_verbs.c | 4 ++-- > 4 files changed, 7 insertions(+), 11 deletions(-) Applied to for-next, thanks > --- a/drivers/infiniband/ulp/iser/iscsi_iser.h > +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h > @@ -96,15 +96,11 @@ > #define iser_err(fmt, arg...) \ > pr_err(PFX "%s: " fmt, __func__ , ## arg) > > -#define SHIFT_4K 12 > -#define SIZE_4K (1ULL << SHIFT_4K) > -#define MASK_4K (~(SIZE_4K-1)) > - > /* Default support is 512KB I/O size */ > #define ISER_DEF_MAX_SECTORS 1024 > -#define ISCSI_ISER_DEF_SG_TABLESIZE ((ISER_DEF_MAX_SECTORS * 512) >> SHIFT_4K) > +#define ISCSI_ISER_DEF_SG_TABLESIZE ((ISER_DEF_MAX_SECTORS * 512) >> ilog2(SZ_4K)) > /* Maximum support is 8MB I/O size */ > -#define ISCSI_ISER_MAX_SG_TABLESIZE ((16384 * 512) >> SHIFT_4K) > +#define ISCSI_ISER_MAX_SG_TABLESIZE ((16384 * 512) >> ilog2(SZ_4K)) This had some conflicts and needed some fixing: #define ISER_DEF_MAX_SECTORS 1024 #define ISCSI_ISER_DEF_SG_TABLESIZE \ - ((ISER_DEF_MAX_SECTORS * SECTOR_SIZE) >> SHIFT_4K) + ((ISER_DEF_MAX_SECTORS * SECTOR_SIZE) >> ilog2(SZ_4K)) /* Maximum support is 16MB I/O size */ -#define ISCSI_ISER_MAX_SG_TABLESIZE ((32768 * SECTOR_SIZE) >> SHIFT_4K) +#define ISCSI_ISER_MAX_SG_TABLESIZE ((32768 * SECTOR_SIZE) >> ilog2(SZ_4K)) Jason