aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuy Nguyen <huyn@mellanox.com>2017-08-17 11:29:52 -0400
committerDavid S. Miller <davem@davemloft.net>2017-08-18 19:15:37 -0400
commitca3d89a3ebe79367bd41b6b8ba37664478ae2dba (patch)
tree9002fac3828db98098415e2761eea302309cabee
parentb6f6d56c91f5261c55edef2df300698c4486b669 (diff)
net/mlx4_core: Enable 4K UAR if SRIOV module parameter is not enabled
enable_4k_uar module parameter was added in patch cited below to address the backward compatibility issue in SRIOV when the VM has system's PAGE_SIZE uar implementation and the Hypervisor has 4k uar implementation. The above compatibility issue does not exist in the non SRIOV case. In this patch, we always enable 4k uar implementation if SRIOV is not enabled on mlx4's supported cards. Fixes: 76e39ccf9c36 ("net/mlx4_core: Fix backward compatibility on VFs") Signed-off-by: Huy Nguyen <huyn@mellanox.com> Reviewed-by: Daniel Jurgens <danielj@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 09b9bc17bce9..5fe5cdc51357 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -432,7 +432,7 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
432 /* Virtual PCI function needs to determine UAR page size from 432 /* Virtual PCI function needs to determine UAR page size from
433 * firmware. Only master PCI function can set the uar page size 433 * firmware. Only master PCI function can set the uar page size
434 */ 434 */
435 if (enable_4k_uar) 435 if (enable_4k_uar || !dev->persist->num_vfs)
436 dev->uar_page_shift = DEFAULT_UAR_PAGE_SHIFT; 436 dev->uar_page_shift = DEFAULT_UAR_PAGE_SHIFT;
437 else 437 else
438 dev->uar_page_shift = PAGE_SHIFT; 438 dev->uar_page_shift = PAGE_SHIFT;
@@ -2277,7 +2277,7 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
2277 2277
2278 dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1; 2278 dev->caps.max_fmr_maps = (1 << (32 - ilog2(dev->caps.num_mpts))) - 1;
2279 2279
2280 if (enable_4k_uar) { 2280 if (enable_4k_uar || !dev->persist->num_vfs) {
2281 init_hca.log_uar_sz = ilog2(dev->caps.num_uars) + 2281 init_hca.log_uar_sz = ilog2(dev->caps.num_uars) +
2282 PAGE_SHIFT - DEFAULT_UAR_PAGE_SHIFT; 2282 PAGE_SHIFT - DEFAULT_UAR_PAGE_SHIFT;
2283 init_hca.uar_page_sz = DEFAULT_UAR_PAGE_SHIFT - 12; 2283 init_hca.uar_page_sz = DEFAULT_UAR_PAGE_SHIFT - 12;