Konstantin Taranov
d4293f96ce
RDMA/mana_ib: unify mana_ib functions to support any gdma device
...
Use the installed gdma_device instead of hard-coded device
in requests to the HW.
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com >
Link: https://patch.msgid.link/1746633545-17653-4-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Long Li <longli@microsoft.com >
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2025-05-12 06:44:52 -04:00
Konstantin Taranov
0c55174524
RDMA/mana_ib: Fix integer overflow during queue creation
...
Check queue size during CQ creation for users to prevent
overflow of u32.
Fixes: bec127e45d ("RDMA/mana_ib: create kernel-level CQs")
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com >
Link: https://patch.msgid.link/1742312744-14370-1-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Long Li <longli@microsoft.com >
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2025-03-19 04:38:58 -04:00
Konstantin Taranov
cfef452592
RDMA/mana_ib: polling of CQs for GSI/UD
...
Add polling for the kernel CQs.
Process completion events for UD/GSI QPs.
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com >
Link: https://patch.msgid.link/1737394039-28772-13-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Shiraz Saleem <shirazsaleem@microsoft.com >
Reviewed-by: Long Li <longli@microsoft.com >
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2025-02-04 08:27:03 -05:00
Konstantin Taranov
40ebdacb4e
RDMA/mana_ib: implement req_notify_cq
...
Arm a CQ when req_notify_cq is called.
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com >
Link: https://patch.msgid.link/1737394039-28772-11-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Shiraz Saleem <shirazsaleem@microsoft.com >
Reviewed-by: Long Li <longli@microsoft.com >
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2025-02-04 08:27:03 -05:00
Konstantin Taranov
bec127e45d
RDMA/mana_ib: create kernel-level CQs
...
Implement creation of CQs for the kernel.
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com >
Link: https://patch.msgid.link/1737394039-28772-5-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Shiraz Saleem <shirazsaleem@microsoft.com >
Reviewed-by: Long Li <longli@microsoft.com >
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2025-02-04 08:27:03 -05:00
Akiva Goldberger
dd6d7f8574
RDMA: Pass entire uverbs attr bundle to create cq function
...
Changes the create_cq verb signature by sending the entire uverbs attr
bundle as a parameter. This allows drivers to send driver specific attrs
through ioctl for the create_cq verb and access them in their driver
specific code.
Also adds a new enum value for driver specific ioctl attributes for
methods already supporting UHW.
Link: https://lore.kernel.org/r/ed147343987c0d43fd391c1b2f85e2f425747387.1719512393.git.leon@kernel.org
Signed-off-by: Akiva Goldberger <agoldberger@nvidia.com >
Signed-off-by: Leon Romanovsky <leonro@nvidia.com >
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com >
2024-06-27 16:28:21 -03:00
Konstantin Taranov
44b607ad4c
RDMA/mana_ib: implement uapi for creation of rnic cq
...
Enable users to create RNIC CQs using a corresponding flag.
With the previous request size, an ethernet CQ is created.
As a response, return ID of the created CQ.
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com >
Link: https://lore.kernel.org/r/1714137160-5222-6-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Long Li <longli@microsoft.com >
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2024-05-05 15:27:23 +03:00
Konstantin Taranov
f79edef79b
RDMA/mana_ib: boundary check before installing cq callbacks
...
Add a boundary check inside mana_ib_install_cq_cb to prevent index overflow.
Fixes: 2a31c5a7e0 ("RDMA/mana_ib: Introduce mana_ib_install_cq_cb helper function")
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com >
Link: https://lore.kernel.org/r/1714137160-5222-5-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Long Li <longli@microsoft.com >
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2024-05-05 15:27:23 +03:00
Konstantin Taranov
3e41105263
RDMA/mana_ib: introduce a helper to remove cq callbacks
...
Intoduce the mana_ib_remove_cq_cb helper to remove cq callbacks.
The helper removes code duplicates.
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com >
Link: https://lore.kernel.org/r/1714137160-5222-4-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Long Li <longli@microsoft.com >
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2024-05-05 15:27:23 +03:00
Konstantin Taranov
23f59f4e83
RDMA/mana_ib: Use num_comp_vectors of ib_device
...
Use num_comp_vectors of struct ib_device instead of max_num_queues
from gdma_context.
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com >
Link: https://lore.kernel.org/r/1712911656-17352-1-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Long Li <longli@microsoft.com >
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2024-04-16 13:29:47 +03:00
Konstantin Taranov
60a7ac0b8b
RDMA/mana_ib: Use struct mana_ib_queue for CQs
...
Use struct mana_ib_queue and its helpers for CQs
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com >
Link: https://lore.kernel.org/r/1711483688-24358-3-git-send-email-kotaranov@linux.microsoft.com
Reviewed-by: Long Li <longli@microsoft.com >
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2024-04-02 11:30:23 +03:00
Konstantin Taranov
2d5c008157
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: 0266a17763 ("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 >
2024-03-07 11:32:33 +02:00
Konstantin Taranov
2a31c5a7e0
RDMA/mana_ib: Introduce mana_ib_install_cq_cb helper function
...
Use a helper function to install callbacks to CQs.
This patch removes code repetition.
Signed-off-by: Konstantin Taranov <kotaranov@microsoft.com >
Link: https://lore.kernel.org/r/1705965781-3235-4-git-send-email-kotaranov@linux.microsoft.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2024-01-25 12:03:14 +02:00
Konstantin Taranov
71c8cbfcdc
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 >
2024-01-25 12:03:00 +02:00
Long Li
c15d7802a4
RDMA/mana_ib: Add CQ interrupt support for RAW QP
...
At probing time, the MANA core code allocates EQs for supporting interrupts
on Ethernet queues. The same interrupt mechanisum is used by RAW QP.
Use the same EQs for delivering interrupts on the CQ for the RAW QP.
Signed-off-by: Long Li <longli@microsoft.com >
Link: https://lore.kernel.org/r/1702692255-23640-4-git-send-email-longli@linuxonhyperv.com
Signed-off-by: Leon Romanovsky <leon@kernel.org >
2023-12-20 10:29:03 +02:00
Long Li
2c20e20b22
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 >
2023-12-20 10:25:40 +02:00
Long Li
0266a17763
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 >
2022-11-11 11:40:09 +02:00