Skip to content

Commit d7806bb

Browse files
committed
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
Pull rdma updates from Jason Gunthorpe: "A quiet cycle after the larger 5.8 effort. Substantially cleanup and driver work with a few smaller features this time. - Driver updates for hfi1, rxe, mlx5, hns, qedr, usnic, bnxt_re - Removal of dead or redundant code across the drivers - RAW resource tracker dumps to include a device specific data blob for device objects to aide device debugging - Further advance the IOCTL interface, remove the ability to turn it off. Add QUERY_CONTEXT, QUERY_MR, and QUERY_PD commands - Remove stubs related to devices with no pkey table - A shared CQ scheme to allow multiple ULPs to share the CQ rings of a device to give higher performance - Several more static checker, syzkaller and rare crashers fixed" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (121 commits) RDMA/mlx5: Fix flow destination setting for RDMA TX flow table RDMA/rxe: Remove pkey table RDMA/umem: Add a schedule point in ib_umem_get() RDMA/hns: Fix the unneeded process when getting a general type of CQE error RDMA/hns: Fix error during modify qp RTS2RTS RDMA/hns: Delete unnecessary memset when allocating VF resource RDMA/hns: Remove redundant parameters in set_rc_wqe() RDMA/hns: Remove support for HIP08_A RDMA/hns: Refactor hns_roce_v2_set_hem() RDMA/hns: Remove redundant hardware opcode definitions RDMA/netlink: Remove CAP_NET_RAW check when dump a raw QP RDMA/include: Replace license text with SPDX tags RDMA/rtrs: remove WQ_MEM_RECLAIM for rtrs_wq RDMA/rtrs-clt: add an additional random 8 seconds before reconnecting RDMA/cma: Execute rdma_cm destruction from a handler properly RDMA/cma: Remove unneeded locking for req paths RDMA/cma: Using the standard locking pattern when delivering the removal event RDMA/cma: Simplify DEVICE_REMOVAL for internal_id RDMA/efa: Add EFA 0xefa1 PCI ID RDMA/efa: User/kernel compatibility handshake mechanism ...
2 parents d6efb3a + 23fcc7d commit d7806bb

File tree

166 files changed

+6945
-7569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+6945
-7569
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3621,6 +3621,7 @@ M: Selvin Xavier <[email protected]>
36213621
M: Devesh Sharma <[email protected]>
36223622
M: Somnath Kotur <[email protected]>
36233623
M: Sriharsha Basavapatna <[email protected]>
3624+
M: Naresh Kumar PBS <[email protected]>
36243625
36253626
S: Supported
36263627
W: http://www.broadcom.com

drivers/infiniband/Kconfig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@ config INFINIBAND_USER_ACCESS
3737
libibverbs, libibcm and a hardware driver library from
3838
rdma-core <https://github.com/linux-rdma/rdma-core>.
3939

40-
config INFINIBAND_EXP_LEGACY_VERBS_NEW_UAPI
41-
bool "Allow experimental legacy verbs in new ioctl uAPI (EXPERIMENTAL)"
42-
depends on INFINIBAND_USER_ACCESS
43-
help
44-
IOCTL based uAPI support for Infiniband is enabled by default for
45-
new verbs only. This allows userspace to invoke the IOCTL based uAPI
46-
for current legacy verbs too.
47-
4840
config INFINIBAND_USER_MEM
4941
bool
5042
depends on INFINIBAND_USER_ACCESS != n

drivers/infiniband/core/cache.c

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ int ib_get_cached_pkey(struct ib_device *device,
10541054

10551055
cache = device->port_data[port_num].cache.pkey;
10561056

1057-
if (index < 0 || index >= cache->table_len)
1057+
if (!cache || index < 0 || index >= cache->table_len)
10581058
ret = -EINVAL;
10591059
else
10601060
*pkey = cache->table[index];
@@ -1099,6 +1099,10 @@ int ib_find_cached_pkey(struct ib_device *device,
10991099
read_lock_irqsave(&device->cache_lock, flags);
11001100

11011101
cache = device->port_data[port_num].cache.pkey;
1102+
if (!cache) {
1103+
ret = -EINVAL;
1104+
goto err;
1105+
}
11021106

11031107
*index = -1;
11041108

@@ -1117,6 +1121,7 @@ int ib_find_cached_pkey(struct ib_device *device,
11171121
ret = 0;
11181122
}
11191123

1124+
err:
11201125
read_unlock_irqrestore(&device->cache_lock, flags);
11211126

11221127
return ret;
@@ -1139,6 +1144,10 @@ int ib_find_exact_cached_pkey(struct ib_device *device,
11391144
read_lock_irqsave(&device->cache_lock, flags);
11401145

11411146
cache = device->port_data[port_num].cache.pkey;
1147+
if (!cache) {
1148+
ret = -EINVAL;
1149+
goto err;
1150+
}
11421151

11431152
*index = -1;
11441153

@@ -1149,6 +1158,7 @@ int ib_find_exact_cached_pkey(struct ib_device *device,
11491158
break;
11501159
}
11511160

1161+
err:
11521162
read_unlock_irqrestore(&device->cache_lock, flags);
11531163

11541164
return ret;
@@ -1425,23 +1435,26 @@ ib_cache_update(struct ib_device *device, u8 port, bool enforce_security)
14251435
goto err;
14261436
}
14271437

1428-
pkey_cache = kmalloc(struct_size(pkey_cache, table,
1429-
tprops->pkey_tbl_len),
1430-
GFP_KERNEL);
1431-
if (!pkey_cache) {
1432-
ret = -ENOMEM;
1433-
goto err;
1434-
}
1438+
if (tprops->pkey_tbl_len) {
1439+
pkey_cache = kmalloc(struct_size(pkey_cache, table,
1440+
tprops->pkey_tbl_len),
1441+
GFP_KERNEL);
1442+
if (!pkey_cache) {
1443+
ret = -ENOMEM;
1444+
goto err;
1445+
}
14351446

1436-
pkey_cache->table_len = tprops->pkey_tbl_len;
1447+
pkey_cache->table_len = tprops->pkey_tbl_len;
14371448

1438-
for (i = 0; i < pkey_cache->table_len; ++i) {
1439-
ret = ib_query_pkey(device, port, i, pkey_cache->table + i);
1440-
if (ret) {
1441-
dev_warn(&device->dev,
1442-
"ib_query_pkey failed (%d) for index %d\n",
1443-
ret, i);
1444-
goto err;
1449+
for (i = 0; i < pkey_cache->table_len; ++i) {
1450+
ret = ib_query_pkey(device, port, i,
1451+
pkey_cache->table + i);
1452+
if (ret) {
1453+
dev_warn(&device->dev,
1454+
"ib_query_pkey failed (%d) for index %d\n",
1455+
ret, i);
1456+
goto err;
1457+
}
14451458
}
14461459
}
14471460

0 commit comments

Comments
 (0)