Commit Graph

24 Commits

Author SHA1 Message Date
Maxim Levitsky f445ac57f9 RDMA/mana_ib: Allocate PAGE aligned doorbell index
JIRA: https://issues.redhat.com/browse/RHEL-80098

commit 29b7bb98234cc287cebef9bccf638c2e3f39be71
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Wed Feb 5 02:30:05 2025 -0800

    RDMA/mana_ib: Allocate PAGE aligned doorbell index

    Allocate a PAGE aligned doorbell index to ensure each process gets a
    separate PAGE sized doorbell area space remapped to it in mana_ib_mmap

    Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
    Signed-off-by: Shiraz Saleem <shirazsaleem@microsoft.com>
    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://patch.msgid.link/1738751405-15041-1-git-send-email-kotaranov@linux.microsoft.com
    Reviewed-by: Long Li <longli@microsoft.com>
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2025-03-03 18:20:01 -05:00
Maxim Levitsky a0396af58c RDMA/mana_ib: use the correct page size for mapping user-mode doorbell page
JIRA: https://issues.redhat.com/browse/RHEL-80098

commit 4a3b99bc04e501b816db78f70064e26a01257910
Author: Long Li <longli@microsoft.com>
Date:   Fri Aug 30 08:16:33 2024 -0700

    RDMA/mana_ib: use the correct page size for mapping user-mode doorbell page

    When mapping doorbell page from user-mode, the driver should use the system
    page size as this memory is allocated via mmap() from user-mode.

    Cc: stable@vger.kernel.org
    Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
    Signed-off-by: Long Li <longli@microsoft.com>
    Link: https://patch.msgid.link/1725030993-16213-2-git-send-email-longli@linuxonhyperv.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2025-03-03 18:20:01 -05:00
Maxim Levitsky b3a1289e49 RDMA/mana_ib: use the correct page table index based on hardware page size
JIRA: https://issues.redhat.com/browse/RHEL-80098

commit 9e517a8e9d9a303bf9bde35e5c5374795544c152
Author: Long Li <longli@microsoft.com>
Date:   Fri Aug 30 08:16:32 2024 -0700

    RDMA/mana_ib: use the correct page table index based on hardware page size

    MANA hardware uses 4k page size. When calculating the page table index,
    it should use the hardware page size, not the system page size.

    Cc: stable@vger.kernel.org
    Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
    Signed-off-by: Long Li <longli@microsoft.com>
    Link: https://patch.msgid.link/1725030993-16213-1-git-send-email-longli@linuxonhyperv.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2025-03-03 18:20:01 -05:00
Maxim Levitsky 3ba4167410 RDMA/mana_ib: Process QP error events in mana_ib
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 2a1251e3dbb2995100b6f351c2452228895386a5
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Fri Jun 7 03:08:17 2024 -0700

    RDMA/mana_ib: Process QP error events in mana_ib

    Process QP fatal events from the error event queue.
    For that, find the QP, using QPN from the event, and then call its
    event_handler. To find the QPs, store created RC QPs in an xarray.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1717754897-19858-1-git-send-email-kotaranov@linux.microsoft.com
    Reviewed-by: Wei Hu <weh@microsoft.com>
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 11:32:03 +03:00
Maxim Levitsky 8f5152914d RDMA/mana_ib: extend query device
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit c8683b995d8aba9d5b4e2368fedad83508882d84
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Thu May 30 04:55:17 2024 -0700

    RDMA/mana_ib: extend query device

    Fill in properties of the ib device.
    Order the assignment in the order of fields in the struct ib_device_attr.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1717070117-1234-3-git-send-email-kotaranov@linux.microsoft.com
    Reviewed-by: Long Li <longli@microsoft.com>
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 11:32:03 +03:00
Maxim Levitsky 4fa733cdb0 RDMA/mana_ib: Create and destroy RC QP
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 53657a0419ef443f9d17ee035ca9980572736d0a
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Wed May 22 01:24:00 2024 -0700

    RDMA/mana_ib: Create and destroy RC QP

    Implement HW requests to create and destroy an RC QP.
    An RC QP may have 5 queues.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1716366242-558-2-git-send-email-kotaranov@linux.microsoft.com
    Reviewed-by: Long Li <longli@microsoft.com>
    Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 11:32:02 +03:00
Maxim Levitsky 74dd9d3383 RDMA/mana_ib: create and destroy RNIC cqs
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 5843415916852983d3aaddc87b57630af9b0adad
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Fri Apr 26 06:12:37 2024 -0700

    RDMA/mana_ib: create and destroy RNIC cqs

    Implement RNIC requests for creation and destruction of RNIC CQs.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1714137160-5222-3-git-send-email-kotaranov@linux.microsoft.com
    Reviewed-by: Long Li <longli@microsoft.com>
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 01:06:39 +03:00
Maxim Levitsky c944a99b76 RDMA/mana_ib: create EQs for RNIC CQs
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit e73c882f0a0149d8cad79f87b28cbbc9b4ed9ebe
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Fri Apr 26 06:12:36 2024 -0700

    RDMA/mana_ib: create EQs for RNIC CQs

    Create EQs within mana_ib device. Such EQs are required
    for creation of RNIC CQs.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1714137160-5222-2-git-send-email-kotaranov@linux.microsoft.com
    Reviewed-by: Long Li <longli@microsoft.com>
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 01:06:39 +03:00
Maxim Levitsky e7ccf6d3e0 RDMA/mana_ib: Configure mac address in RNIC
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 8859f009ace237ffc165c95edcc113d3824b9bf3
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Wed Apr 10 01:42:31 2024 -0700

    RDMA/mana_ib: Configure mac address in RNIC

    Set local mac address in RNIC, which is required by the HW.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1712738551-22075-7-git-send-email-kotaranov@linux.microsoft.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Conflicts:
    include the etherdevice.h explicitly

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 01:06:04 +03:00
Maxim Levitsky 65f627d265 RDMA/mana_ib: Adding and deleting GIDs
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit faafb8b126ad6043663a77e6b234bca932f60694
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Wed Apr 10 01:42:30 2024 -0700

    RDMA/mana_ib: Adding and deleting GIDs

    Implement add_gid and del_gid for RNIC.
    IPv4 and IPv6 addresses are supported.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1712738551-22075-6-git-send-email-kotaranov@linux.microsoft.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 00:40:08 +03:00
Maxim Levitsky 14b7db4020 RDMA/mana_ib: Enable RoCE on port 1
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 8b184e4f1c328d9b37994f66224550befdefe49b
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Wed Apr 10 01:42:29 2024 -0700

    RDMA/mana_ib: Enable RoCE on port 1

    Set netdev and RoCEv2 flag to enable GID population on port 1.
    Use GIDs of the master netdev. As mc->ports[] stores slave devices,
    use a helper to get the master netdev.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1712738551-22075-5-git-send-email-kotaranov@linux.microsoft.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 00:40:08 +03:00
Maxim Levitsky 82f5c55cd3 RDMA/mana_ib: Implement port parameters
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 4bda1d5332ec1b00262ad53f6a4cfa88190a048d
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Wed Apr 10 01:42:28 2024 -0700

    RDMA/mana_ib: Implement port parameters

    Implement port parameters for RNIC:
    1) extend query_port() method
    2) implement get_link_layer()
    3) implement query_pkey()

    Only port 1 can store GIDs.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1712738551-22075-4-git-send-email-kotaranov@linux.microsoft.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 00:40:08 +03:00
Maxim Levitsky 4d2d230764 RDMA/mana_ib: Create and destroy rnic adapter
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 1a79c2b9d4a08788cf1554981f10d23fbad77d11
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Wed Apr 10 01:42:27 2024 -0700

    RDMA/mana_ib: Create and destroy rnic adapter

    Add functions for RNIC creation and destruction.
    If creation fails, the ib_probe fails as well.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1712738551-22075-3-git-send-email-kotaranov@linux.microsoft.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 00:40:08 +03:00
Maxim Levitsky b402d36f58 RDMA/mana_ib: Add EQ creation for rnic adapter
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 98b889c43935c43ad15783dbfb1e59b4ee7f4a56
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Wed Apr 10 01:42:26 2024 -0700

    RDMA/mana_ib: Add EQ creation for rnic adapter

    Create an error EQ for the RNIC adapter.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1712738551-22075-2-git-send-email-kotaranov@linux.microsoft.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 00:40:08 +03:00
Maxim Levitsky db4da1109c RDMA/mana_ib: remove useless return values from dbg prints
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit c8fc935f4b198dc6e9871b29f4f3360631d90c8e
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Tue Apr 9 07:21:05 2024 -0700

    RDMA/mana_ib: remove useless return values from dbg prints

    Remove printing ret value on success as it was always 0.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1712672465-29960-1-git-send-email-kotaranov@linux.microsoft.com
    Reviewed-by: Long Li <longli@microsoft.com>
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 00:40:07 +03:00
Maxim Levitsky 0b6cf8d492 RDMA/mana_ib: Introduce helpers to create and destroy mana queues
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 46f5be7cd4bceb3a503c544b3dab7b75fe4bb96b
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Tue Mar 26 13:08:05 2024 -0700

    RDMA/mana_ib: Introduce helpers to create and destroy mana queues

    Intoduce helpers to work with mana ib queues (struct mana_ib_queue).
    A queue always consists of umem, gdma_region, and id.
    A queue can become a WQ or a CQ.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1711483688-24358-2-git-send-email-kotaranov@linux.microsoft.com
    Reviewed-by: Long Li <longli@microsoft.com>
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 00:40:06 +03:00
Maxim Levitsky 6e0dc975a5 RDMA/mana_ib: Use virtual address in dma regions for MRs
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 2d5c00815778ec4f4e0a84e405e3e157b7815db1
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Mon Mar 4 05:52:41 2024 -0800

    RDMA/mana_ib: Use virtual address in dma regions for MRs

    Introduce mana_ib_create_dma_region() to create dma regions with iova
    for MRs. It allows creating MRs with any page offset. Previously,
    only page-aligned addresses worked.

    For dma regions that must have a zero dma offset (e.g., for queues),
    mana_ib_create_zero_offset_dma_region() is added.
    To get the zero offset, ib_umem_find_best_pgoff() is used with zero
    pgoff_bitmask.

    Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1709560361-26393-3-git-send-email-kotaranov@linux.microsoft.com
    Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 00:40:06 +03:00
Maxim Levitsky da068a8ef1 RDMA/mana_ib: Fix bug in creation of dma regions
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit e02497fb654689049ba8b46f098f17d5f19e0b3c
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Mon Mar 4 05:52:40 2024 -0800

    RDMA/mana_ib: Fix bug in creation of dma regions

    Use ib_umem_dma_offset() helper to calculate correct dma offset.

    Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1709560361-26393-2-git-send-email-kotaranov@linux.microsoft.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-15 00:40:05 +03:00
Maxim Levitsky 0a1b33959d RDMA/mana_ib: Introduce mana_ib_get_netdev helper function
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 3b73eb3a4acdf563de49d825968bb5f10300acd4
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Mon Jan 22 15:23:00 2024 -0800

    RDMA/mana_ib: Introduce mana_ib_get_netdev helper function

    Use a helper function to access netdevs using a port number.
    This patch removes code repetitions as well as removes the need
    to explicitly use gdma_dev, which was error-prone.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1705965781-3235-3-git-send-email-kotaranov@linux.microsoft.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-14 21:04:34 +03:00
Maxim Levitsky aedb3e6895 RDMA/mana_ib: Introduce mdev_to_gc helper function
JIRA: https://issues.redhat.com/browse/RHEL-54330

commit 71c8cbfcdc8f1dc651b976d4c12dc9b9fce675c1
Author: Konstantin Taranov <kotaranov@microsoft.com>
Date:   Mon Jan 22 15:22:59 2024 -0800

    RDMA/mana_ib: Introduce mdev_to_gc helper function

    Use a helper function to access gdma_context from mana_ib_dev.
    This patch removes code repetitions as well as removes the need
    to explicitly use gdma_dev, which was error-prone.

    Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com>
    Link: https://lore.kernel.org/r/1705965781-3235-2-git-send-email-kotaranov@linux.microsoft.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-08-14 21:04:28 +03:00
Maxim Levitsky bd3e849591 RDMA/mana_ib: query device capabilities
JIRA: https://issues.redhat.com/browse/RHEL-23420

commit 2c20e20b22d9fc64072e3445ae3ca244cbd523a2
Author: Long Li <longli@microsoft.com>
Date:   Fri Dec 15 18:04:14 2023 -0800

    RDMA/mana_ib: query device capabilities

    With RDMA device registered, use it to query on hardware capabilities and
    cache this information for future query requests to the driver.

    Signed-off-by: Long Li <longli@microsoft.com>
    Link: https://lore.kernel.org/r/1702692255-23640-3-git-send-email-longli@linuxonhyperv.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-01-31 18:38:02 -05:00
Maxim Levitsky 7b9f3e7e80 RDMA/mana_ib: register RDMA device with GDMA
JIRA: https://issues.redhat.com/browse/RHEL-23420

commit a7f0636d223ca9d074eb5b4ae71425e082c5c1e1
Author: Long Li <longli@microsoft.com>
Date:   Fri Dec 15 18:04:13 2023 -0800

    RDMA/mana_ib: register RDMA device with GDMA

    Software client needs to register with the RDMA management interface on
    the SoC to access more features, including querying device capabilities
    and RC queue pair.

    Signed-off-by: Long Li <longli@microsoft.com>
    Link: https://lore.kernel.org/r/1702692255-23640-2-git-send-email-longli@linuxonhyperv.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
2024-01-30 20:38:24 -05:00
Kamal Heib 7b017271c1 RDMA/mana_ib: Fix a bug when the PF indicates more entries for registering memory on first packet
Bugzilla: https://bugzilla.redhat.com/2189296

commit 89d42b8c85b4c67d310c5ccaf491acbf71a260c3
Author: Long Li <longli@microsoft.com>
Date:   Wed Feb 15 16:32:02 2023 -0800

    RDMA/mana_ib: Fix a bug when the PF indicates more entries for registering memory on first packet

    When registering memory in a large chunk that doesn't fit into a single PF
    message, the PF may return GDMA_STATUS_MORE_ENTRIES on the first message if
    there are more messages needed for registering more chunks.

    Fix the VF to make it process the correct return code.

    Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
    Link: https://lore.kernel.org/r/1676507522-21018-1-git-send-email-longli@linuxonhyperv.com
    Signed-off-by: Long Li <longli@microsoft.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

Signed-off-by: Kamal Heib <kheib@redhat.com>
2023-05-08 08:20:26 -04:00
Kamal Heib cba7f40b30 RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter
Bugzilla: https://bugzilla.redhat.com/2189296
Conflicts:
- ib_user_ioctl_verbs.h: Context diff due to the missing of erdma,
  Added reservations to keep UAPI compatible with upstream.
- MAINTAINERS: Context diff due to the unupdated file.

commit 0266a177631d4c6b963b5b12dd986a8c5abdbf06
Author: Long Li <longli@microsoft.com>
Date:   Thu Nov 3 12:16:30 2022 -0700

    RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter

    Add a RDMA VF driver for Microsoft Azure Network Adapter (MANA).

    Co-developed-by: Ajay Sharma <sharmaajay@microsoft.com>
    Signed-off-by: Ajay Sharma <sharmaajay@microsoft.com>
    Reviewed-by: Dexuan Cui <decui@microsoft.com>
    Signed-off-by: Long Li <longli@microsoft.com>
    Link: https://lore.kernel.org/r/1667502990-2559-13-git-send-email-longli@linuxonhyperv.com
    Signed-off-by: Leon Romanovsky <leon@kernel.org>

Signed-off-by: Kamal Heib <kheib@redhat.com>
2023-05-08 08:20:25 -04:00