On Mon, Feb 24, 2020 at 06:49:18PM -0600, Shiraz Saleem wrote: > +/** > + * i40iw_get_rdma_features - get RDMA features > + * @dev - sc device struct > + */ > +enum i40iw_status_code i40iw_get_rdma_features(struct i40iw_sc_dev *dev) > +{ > + enum i40iw_status_code ret_code; > + struct i40iw_dma_mem feat_buf; > + u64 temp; > + u16 byte_idx, feat_type, feat_cnt; > + > + ret_code = i40iw_allocate_dma_mem(dev->hw, > + &feat_buf, > + I40IW_FEATURE_BUF_SIZE, > + I40IW_FEATURE_BUF_ALIGNMENT); > + > + if (ret_code) > + return I40IW_ERR_NO_MEMORY; > + > + ret_code = i40iw_sc_query_rdma_features(dev->cqp, &feat_buf, 0); > + if (!ret_code) > + ret_code = i40iw_sc_query_rdma_features_done(dev->cqp); > + > + if (ret_code) > + goto exit; > + > + get_64bit_val(feat_buf.va, 0, &temp); > + feat_cnt = (u16)RS_64(temp, I40IW_FEATURE_CNT); Please don't include these casts, demotion to u16 is implicit. > +++ b/drivers/infiniband/hw/i40iw/i40iw_d.h > @@ -370,6 +370,13 @@ > #define I40IW_AEQE_VALID_SHIFT 63 > #define I40IW_AEQE_VALID_MASK (1ULL << I40IW_AEQE_VALID_SHIFT) > > +#define FW_MAJOR_VER(dev) \ > + ((u16)RS_64((dev)->feature_info[I40IW_FEATURE_FW_INFO], \ > + I40IW_FW_VER_MAJOR)) > +#define FW_MINOR_VER(dev) \ > + ((u16)RS_64((dev)->feature_info[I40IW_FEATURE_FW_INFO], \ > + I40IW_FW_VER_MINOR)) Use static inline for function like things. > + > /* CQP SQ WQES */ > #define I40IW_QP_TYPE_IWARP 1 > #define I40IW_QP_TYPE_UDA 2 > @@ -403,7 +410,7 @@ > #define I40IW_CQP_OP_MANAGE_ARP 0x0f > #define I40IW_CQP_OP_MANAGE_VF_PBLE_BP 0x10 > #define I40IW_CQP_OP_MANAGE_PUSH_PAGES 0x11 > -#define I40IW_CQP_OP_MANAGE_PE_TEAM 0x12 > +#define I40IW_CQP_OP_QUERY_RDMA_FEATURES 0x12 > #define I40IW_CQP_OP_UPLOAD_CONTEXT 0x13 > #define I40IW_CQP_OP_ALLOCATE_LOC_MAC_IP_TABLE_ENTRY 0x14 > #define I40IW_CQP_OP_MANAGE_HMC_PM_FUNC_TABLE 0x15 > @@ -431,6 +438,24 @@ > #define I40IW_CQP_OP_SHMC_PAGES_ALLOCATED 0x2b > #define I40IW_CQP_OP_SET_HMC_RESOURCE_PROFILE 0x2d > > +#define I40IW_FEATURE_BUF_SIZE (8 * I40IW_MAX_FEATURES) > + > +#define I40IW_FW_VER_MINOR_SHIFT 0 > +#define I40IW_FW_VER_MINOR_MASK \ > + (0xffffULL << I40IW_FW_VER_MINOR_SHIFT) > + > +#define I40IW_FW_VER_MAJOR_SHIFT 16 > +#define I40IW_FW_VER_MAJOR_MASK \ > + (0xffffULL << I40IW_FW_VER_MAJOR_SHIFT) > + > +#define I40IW_FEATURE_INFO_SHIFT 0 > +#define I40IW_FEATURE_INFO_MASK \ > + (0xffffULL << I40IW_FEATURE_INFO_SHIFT) > + > +#define I40IW_FEATURE_CNT_SHIFT 32 > +#define I40IW_FEATURE_CNT_MASK \ > + (0xffffULL << I40IW_FEATURE_CNT_SHIFT) Can you make sure to use the generic GENMASK/etc in your new driver please? See the recent EFA series for how this should look. Jason