diff options
author | Yishai Hadas <yishaih@mellanox.com> | 2015-01-25 17:59:35 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-01-26 01:43:13 +0300 |
commit | 872bf2fb69d90e3619befee842fc26db39d8e475 (patch) | |
tree | cd57553d6b75b48bf75a9aa6c4358fbed88e7b4a /drivers/net/ethernet/mellanox/mlx4/pd.c | |
parent | 7aee42c6764bae75d0eb2f674f0874193de90c05 (diff) | |
download | linux-872bf2fb69d90e3619befee842fc26db39d8e475.tar.xz |
net/mlx4_core: Maintain a persistent memory for mlx4 device
Maintain a persistent memory that should survive reset flow/PCI error.
This comes as a preparation for coming series to support above flows.
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/pd.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/pd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/pd.c b/drivers/net/ethernet/mellanox/mlx4/pd.c index 74216071201f..a42b4c0a9ed9 100644 --- a/drivers/net/ethernet/mellanox/mlx4/pd.c +++ b/drivers/net/ethernet/mellanox/mlx4/pd.c @@ -151,11 +151,13 @@ int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar) return -ENOMEM; if (mlx4_is_slave(dev)) - offset = uar->index % ((int) pci_resource_len(dev->pdev, 2) / + offset = uar->index % ((int)pci_resource_len(dev->persist->pdev, + 2) / dev->caps.uar_page_size); else offset = uar->index; - uar->pfn = (pci_resource_start(dev->pdev, 2) >> PAGE_SHIFT) + offset; + uar->pfn = (pci_resource_start(dev->persist->pdev, 2) >> PAGE_SHIFT) + + offset; uar->map = NULL; return 0; } |