aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mana/device.c
Commit message (Collapse)AuthorAgeFilesLines
* RDMA/mana_ib: add support of multiple portsKonstantin Taranov2025-07-231-52/+58
| | | | | | | | | | | | If the HW indicates support of multiple ports for rdma, create an IB device with a port per netdev in the ethernet mana driver. CM is only available on port 1, but RC QPs are supported on all ports. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Add device statistics supportShiraz Saleem2025-06-121-0/+6
| | | | | | | | | | | | Add support for mana device level statistics. Co-developed-by: Solom Tamawy <[email protected]> Signed-off-by: Solom Tamawy <[email protected]> Signed-off-by: Shiraz Saleem <[email protected]> Signed-off-by: Konstantin Taranov <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Add support of mana_ib for RNIC and ETH nicKonstantin Taranov2025-05-121-85/+77
| | | | | | | | | | | | Allow mana_ib to be created over ethernet gdma device and over rnic gdma device. The HW has two devices with different capabilities and different use-cases. Initialize required resources depending on the used gdma device. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Handle net event for pointing to the current netdevLong Li2025-03-131-2/+45
| | | | | | | | | | | | | When running under Hyper-V, the master device to the RDMA device is always bonded to this RDMA device. This is not user-configurable. The master device can be unbind/bind from the kernel. During those events, the RDMA device should set to the current netdev to reflect the change of master device from those events. Signed-off-by: Long Li <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* net: mana: Change the function signature of mana_get_primary_netdev_rcuLong Li2025-03-131-4/+3
| | | | | | | | | | | | | Change mana_get_primary_netdev_rcu() to mana_get_primary_netdev(), and return the ndev with refcount held. The caller is responsible for dropping the refcount. Also drop the check for IFF_SLAVE as it is not necessary if the upper device is present. Signed-off-by: Long Li <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Implement DMABUF MR supportKonstantin Taranov2025-02-181-0/+1
| | | | | | | | | Add support of dmabuf MRs to mana_ib. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Fix error code in probe()Dan Carpenter2025-02-091-1/+3
| | | | | | | | | | Return -ENOMEM if dma_pool_create() fails. Don't return success. Fixes: df91c470d9e5 ("RDMA/mana_ib: create/destroy AH") Signed-off-by: Dan Carpenter <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Add port statistics supportShiraz Saleem2025-02-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement alloc_hw_port_stats and get_hw_stats APIs to support querying MANA VF port level statistics from rdma stat tool. Example output from rdma stat tool: $rdma statistic show link mana_0/1 -p link mana_0/1 requester_timeout 45 requester_oos_nak 0 requester_rnr_nak 0 responder_rnr_nak 0 responder_oos 0 responder_dup_request 0 requester_implicit_nak 0 requester_readresp_psn_mismatch 0 nak_inv_req 0 nak_access_error 0 nak_opp_error 0 nak_inv_read 0 responder_local_len_error 0 requestor_local_prot_error 0 responder_rem_access_error 0 responder_local_qp_error 0 responder_malformed_wqe 0 general_hw_error 6 requester_rnr_nak_retries_exceeded 0 requester_retries_exceeded 5 total_fatal_error 6 received_cnps 0 num_qps_congested 0 rate_inc_events 0 num_qps_recovered 0 current_rate 100000 Signed-off-by: Shiraz Saleem <[email protected]> Signed-off-by: Konstantin Taranov <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: polling of CQs for GSI/UDKonstantin Taranov2025-02-041-0/+1
| | | | | | | | | | | Add polling for the kernel CQs. Process completion events for UD/GSI QPs. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Shiraz Saleem <[email protected]> Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: implement req_notify_cqKonstantin Taranov2025-02-041-0/+1
| | | | | | | | | | Arm a CQ when req_notify_cq is called. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Shiraz Saleem <[email protected]> Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: UD/GSI work requestsKonstantin Taranov2025-02-041-0/+2
| | | | | | | | | | | Implement post send and post recv for UD/GSI QPs. Add information about posted requests into shadow queues. Co-developed-by: Shiraz Saleem <[email protected]> Signed-off-by: Shiraz Saleem <[email protected]> Signed-off-by: Konstantin Taranov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: create/destroy AHKonstantin Taranov2025-02-041-1/+12
| | | | | | | | | | | | | Implement create and destroy AH for kernel. In mana_ib, AV is passed as an sge in WQE. Allocate DMA memory and write an AV there. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Shiraz Saleem <[email protected]> Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: implement get_dma_mrKonstantin Taranov2025-02-031-0/+1
| | | | | | | | | | Implement allocation of DMA-mapped memory regions. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Shiraz Saleem <[email protected]> Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* module: Convert symbol namespace to string literalPeter Zijlstra2024-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up the existing export namespace code along the same lines of commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo) to __section("foo")") and for the same reason, it is not desired for the namespace argument to be a macro expansion itself. Scripted using git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file; do awk -i inplace ' /^#define EXPORT_SYMBOL_NS/ { gsub(/__stringify\(ns\)/, "ns"); print; next; } /^#define MODULE_IMPORT_NS/ { gsub(/__stringify\(ns\)/, "ns"); print; next; } /MODULE_IMPORT_NS/ { $0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g"); } /EXPORT_SYMBOL_NS/ { if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) { if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ && $0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ && $0 !~ /^my/) { getline line; gsub(/[[:space:]]*\\$/, ""); gsub(/[[:space:]]/, "", line); $0 = $0 " " line; } $0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/, "\\1(\\2, \"\\3\")", "g"); } } { print }' $file; done Requested-by: Masahiro Yamada <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc Acked-by: Greg KH <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* RDMA/mana_ib: Set correct device into ibKonstantin Taranov2024-07-141-8/+8
| | | | | | | | | | | | | | | | | | Add mana_get_primary_netdev_rcu helper to get a primary netdevice for a given port. When mana is used with netvsc, the VF netdev is controlled by an upper netvsc device. In a baremetal case, the VF netdev is the primary device. Use the mana_get_primary_netdev_rcu() helper in the mana_ib to get the correct device for querying network states. Fixes: 8b184e4f1c32 ("RDMA/mana_ib: Enable RoCE on port 1") Signed-off-by: Konstantin Taranov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Long Li <[email protected]> Reviewed-by: Zhu Yanjun <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Process QP error events in mana_ibKonstantin Taranov2024-06-091-0/+3
| | | | | | | | | | | 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Wei Hu <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: set node_guidKonstantin Taranov2024-06-021-0/+2
| | | | | | | | | Use the mac address for the node_guid of the IB device. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Fix missing ret valueKonstantin Taranov2024-04-231-0/+1
| | | | | | | | | Set ret to -ENODEV when netdev_master_upper_dev_get_rcu returns NULL. Fixes: 8b184e4f1c32 ("RDMA/mana_ib: Enable RoCE on port 1") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Konstantin Taranov <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
* RDMA/mana_ib: Configure mac address in RNICKonstantin Taranov2024-04-161-0/+9
| | | | | | | | Set local mac address in RNIC, which is required by the HW. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Adding and deleting GIDsKonstantin Taranov2024-04-161-0/+2
| | | | | | | | | Implement add_gid and del_gid for RNIC. IPv4 and IPv6 addresses are supported. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Enable RoCE on port 1Konstantin Taranov2024-04-161-0/+15
| | | | | | | | | | 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Implement port parametersKonstantin Taranov2024-04-161-0/+2
| | | | | | | | | | | | | 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Create and destroy rnic adapterKonstantin Taranov2024-04-161-1/+8
| | | | | | | | | Add functions for RNIC creation and destruction. If creation fails, the ib_probe fails as well. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Add EQ creation for rnic adapterKonstantin Taranov2024-04-161-3/+10
| | | | | | | | Create an error EQ for the RNIC adapter. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Use num_comp_vectors of ib_deviceKonstantin Taranov2024-04-161-1/+1
| | | | | | | | | | Use num_comp_vectors of struct ib_device instead of max_num_queues from gdma_context. Signed-off-by: Konstantin Taranov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Long Li <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: query device capabilitiesLong Li2023-12-201-0/+7
| | | | | | | | | 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: register RDMA device with GDMALong Li2023-12-201-5/+19
| | | | | | | | | | 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
* RDMA/mana_ib: Add a driver for Microsoft Azure Network AdapterLong Li2022-11-111-0/+117
Add a RDMA VF driver for Microsoft Azure Network Adapter (MANA). Co-developed-by: Ajay Sharma <[email protected]> Signed-off-by: Ajay Sharma <[email protected]> Reviewed-by: Dexuan Cui <[email protected]> Signed-off-by: Long Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>