Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mlx5: Remove redundant iseg base

iseg_base and base_addr both point to BAR0, making iseg_base redundant.
Remove iseg_base and rely on base_addr instead, reducing the size of
struct mlx5_core_dev.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Shay Drori <shayd@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260319122211.27384-2-tariqt@nvidia.com
Reviewed-by: Joe Damato <joe@dama.to>
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Parav Pandit and committed by
Leon Romanovsky
c0368933 4dd2115f

+3 -6
+1 -1
drivers/infiniband/hw/mlx5/main.c
··· 2740 2740 if (PAGE_SIZE > 4096) 2741 2741 return -EOPNOTSUPP; 2742 2742 2743 - pfn = (dev->mdev->iseg_base + 2743 + pfn = (dev->mdev->bar_addr + 2744 2744 offsetof(struct mlx5_init_seg, internal_timer_h)) >> 2745 2745 PAGE_SHIFT; 2746 2746 return rdma_user_mmap_io(&context->ibucontext, vma, pfn,
+1 -2
drivers/net/ethernet/mellanox/mlx5/core/main.c
··· 950 950 pci_enable_atomic_ops_to_root(pdev, PCI_EXP_DEVCAP2_ATOMIC_COMP128)) 951 951 mlx5_core_dbg(dev, "Enabling pci atomics failed\n"); 952 952 953 - dev->iseg_base = dev->bar_addr; 954 - dev->iseg = ioremap(dev->iseg_base, sizeof(*dev->iseg)); 953 + dev->iseg = ioremap(dev->bar_addr, sizeof(*dev->iseg)); 955 954 if (!dev->iseg) { 956 955 err = -ENOMEM; 957 956 mlx5_core_err(dev, "Failed mapping initialization segment, aborting\n");
+1 -2
drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c
··· 37 37 mdev->device = &adev->dev; 38 38 mdev->pdev = sf_dev->parent_mdev->pdev; 39 39 mdev->bar_addr = sf_dev->bar_base_addr; 40 - mdev->iseg_base = sf_dev->bar_base_addr; 41 40 mdev->coredev_type = MLX5_COREDEV_SF; 42 41 mdev->priv.parent_mdev = sf_dev->parent_mdev; 43 42 mdev->priv.adev_idx = adev->id; ··· 52 53 goto mdev_err; 53 54 } 54 55 55 - mdev->iseg = ioremap(mdev->iseg_base, sizeof(*mdev->iseg)); 56 + mdev->iseg = ioremap(mdev->bar_addr, sizeof(*mdev->iseg)); 56 57 if (!mdev->iseg) { 57 58 mlx5_core_warn(mdev, "remap error\n"); 58 59 err = -ENOMEM;
-1
include/linux/mlx5/driver.h
··· 755 755 } caps; 756 756 struct mlx5_timeouts *timeouts; 757 757 u64 sys_image_guid; 758 - phys_addr_t iseg_base; 759 758 struct mlx5_init_seg __iomem *iseg; 760 759 phys_addr_t bar_addr; 761 760 enum mlx5_device_state state;