OpenCloudOS-Kernel/drivers/infiniband/sw/rdmavt
Mark Bloch 1fb7f8973f RDMA: Support more than 255 rdma ports
Current code uses many different types when dealing with a port of a RDMA
device: u8, unsigned int and u32. Switch to u32 to clean up the logic.

This allows us to make (at least) the core view consistent and use the
same type. Unfortunately not all places can be converted. Many uverbs
functions expect port to be u8 so keep those places in order not to break
UAPIs.  HW/Spec defined values must also not be changed.

With the switch to u32 we now can support devices with more than 255
ports. U32_MAX is reserved to make control logic a bit easier to deal
with. As a device with U32_MAX ports probably isn't going to happen any
time soon this seems like a non issue.

When a device with more than 255 ports is created uverbs will report the
RDMA device as having 255 ports as this is the max currently supported.

The verbs interface is not changed yet because the IBTA spec limits the
port size in too many places to be u8 and all applications that relies in
verbs won't be able to cope with this change. At this stage, we are
extending the interfaces that are using vendor channel solely

Once the limitation is lifted mlx5 in switchdev mode will be able to have
thousands of SFs created by the device. As the only instance of an RDMA
device that reports more than 255 ports will be a representor device and
it exposes itself as a RAW Ethernet only device CM/MAD/IPoIB and other
ULPs aren't effected by this change and their sysfs/interfaces that are
exposes to userspace can remain unchanged.

While here cleanup some alignment issues and remove unneeded sanity
checks (mainly in rdmavt),

Link: https://lore.kernel.org/r/20210301070420.439400-1-leon@kernel.org
Signed-off-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
2021-03-26 09:31:21 -03:00
..
Kconfig RDMA/core: remove use of dma_virt_ops 2020-11-17 15:22:07 -04:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
ah.c IB: Fix kernel-doc markups 2020-12-07 15:45:00 -04:00
ah.h RDMA: Restore ability to fail on AH destroy 2020-09-09 13:57:22 -03:00
cq.c RDMA/sw/rdmavt/cq: Demote hardly complete kernel-doc header 2021-01-22 14:37:31 -04:00
cq.h RDMA: Allow fail of destroy CQ 2020-09-09 14:14:29 -03:00
mad.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mad.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
mcast.c RDMA/sw/rdmavt/mcast: Demote incomplete kernel-doc header 2021-01-22 14:37:33 -04:00
mcast.h IB/rdmavt: Fix copyright date 2016-03-10 20:37:27 -05:00
mmap.c mm: don't include asm/pgtable.h if linux/mm.h is already included 2020-06-09 09:39:13 -07:00
mmap.h IB: Pass only ib_udata in function prototypes 2019-04-01 15:00:47 -03:00
mr.c RDMA/sw/rdmavt/mr: Fix some issues related to formatting and missing descriptions 2021-01-22 14:37:34 -04:00
mr.h RDMA: Remove the udata parameter from alloc_mr callback 2020-07-06 19:25:53 -03:00
pd.c RDMA: Restore ability to fail on PD deallocate 2020-09-09 13:57:22 -03:00
pd.h RDMA: Restore ability to fail on PD deallocate 2020-09-09 13:57:22 -03:00
qp.c RDMA/sw/rdmavt/qp: Fix kernel-doc formatting problem 2021-01-28 15:42:27 -04:00
qp.h IB/hfi1: Move receive work queue struct into uapi directory 2019-06-28 22:32:16 -03:00
rc.c IB/rdmavt: Fix RQ counting issues causing use of an invalid RWQE 2020-07-29 15:54:36 -03:00
srq.c RDMA/sw/rdmavt/srq: Fix a couple of kernel-doc issues 2021-01-28 15:42:25 -04:00
srq.h RDMA: Restore ability to fail on SRQ destroy 2020-09-09 14:14:24 -03:00
trace.c IB/rdmavt: Fix copyright date 2016-03-10 20:37:27 -05:00
trace.h IB/{rdmavt, hfi1, qib}: Remove get_card_name() downcall 2018-01-05 13:34:55 -05:00
trace_cq.h IB/rdmavt: Add wc_flags and wc_immdata to cq entry trace 2019-01-18 13:48:19 -07:00
trace_mr.h IB/rdmavt: Add trace for map_mr_sg 2019-06-28 22:34:26 -03:00
trace_qp.h IB/rdmavt: Fix ab/ba include issues 2019-04-24 11:31:49 -03:00
trace_rc.h IB/rdmavt: Fix ab/ba include issues 2019-04-24 11:31:49 -03:00
trace_rvt.h IB/rdmavt: Fix trace hierarchy 2016-12-11 15:25:13 -05:00
trace_tx.h IB/rdmavt: Fix ab/ba include issues 2019-04-24 11:31:49 -03:00
vt.c RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00
vt.h RDMA: Support more than 255 rdma ports 2021-03-26 09:31:21 -03:00