mlx4_core: Set RAE and init mtt_sz field in FRMR MPT entries

Set the RAE (remote access enable) bit and correctly initialize the
MTT size in MPT entries being set up for fast register memory
regions. Otherwise the callers can't enable remote access and in fact
can't fast register at all (since the HCA will think no MTT entries
are allocated).

Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>

authored by Vladimir Sokolovsky and committed by Roland Dreier c9257433 1941246d

+6 -2
+6 -2
drivers/net/mlx4/mr.c
··· 67 67 #define MLX4_MPT_FLAG_PHYSICAL (1 << 9) 68 68 #define MLX4_MPT_FLAG_REGION (1 << 8) 69 69 70 - #define MLX4_MPT_PD_FLAG_FAST_REG (1 << 26) 70 + #define MLX4_MPT_PD_FLAG_FAST_REG (1 << 27) 71 + #define MLX4_MPT_PD_FLAG_RAE (1 << 28) 71 72 #define MLX4_MPT_PD_FLAG_EN_INV (3 << 24) 72 73 73 74 #define MLX4_MTT_FLAG_PRESENT 1 ··· 349 348 if (mr->mtt.order >= 0 && mr->mtt.page_shift == 0) { 350 349 /* fast register MR in free state */ 351 350 mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_FREE); 352 - mpt_entry->pd_flags |= cpu_to_be32(MLX4_MPT_PD_FLAG_FAST_REG); 351 + mpt_entry->pd_flags |= cpu_to_be32(MLX4_MPT_PD_FLAG_FAST_REG | 352 + MLX4_MPT_PD_FLAG_RAE); 353 + mpt_entry->mtt_sz = cpu_to_be32((1 << mr->mtt.order) * 354 + MLX4_MTT_ENTRY_PER_SEG); 353 355 } else { 354 356 mpt_entry->flags |= cpu_to_be32(MLX4_MPT_FLAG_SW_OWNS); 355 357 }