aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mana/main.c
diff options
context:
space:
mode:
authorKonstantin Taranov <[email protected]>2024-04-10 08:42:29 +0000
committerLeon Romanovsky <[email protected]>2024-04-16 11:28:26 +0000
commit8b184e4f1c328d9b37994f66224550befdefe49b (patch)
treeba58df8c59847a1bfc0164da8dad794502f7aaa1 /drivers/infiniband/hw/mana/main.c
parentRDMA/mana_ib: Implement port parameters (diff)
downloadkernel-8b184e4f1c328d9b37994f66224550befdefe49b.tar.gz
kernel-8b184e4f1c328d9b37994f66224550befdefe49b.zip
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
Diffstat (limited to 'drivers/infiniband/hw/mana/main.c')
-rw-r--r--drivers/infiniband/hw/mana/main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mana/main.c b/drivers/infiniband/hw/mana/main.c
index b2817c92f1c0..c020183385d4 100644
--- a/drivers/infiniband/hw/mana/main.c
+++ b/drivers/infiniband/hw/mana/main.c
@@ -525,11 +525,18 @@ int mana_ib_mmap(struct ib_ucontext *ibcontext, struct vm_area_struct *vma)
int mana_ib_get_port_immutable(struct ib_device *ibdev, u32 port_num,
struct ib_port_immutable *immutable)
{
- /*
- * This version only support RAW_PACKET
- * other values need to be filled for other types
- */
+ struct ib_port_attr attr;
+ int err;
+
+ err = ib_query_port(ibdev, port_num, &attr);
+ if (err)
+ return err;
+
+ immutable->pkey_tbl_len = attr.pkey_tbl_len;
+ immutable->gid_tbl_len = attr.gid_tbl_len;
immutable->core_cap_flags = RDMA_CORE_PORT_RAW_PACKET;
+ if (port_num == 1)
+ immutable->core_cap_flags |= RDMA_CORE_PORT_IBA_ROCE_UDP_ENCAP;
return 0;
}