Skip to content

Commit 747c19e

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: "Another small cycle. Mostly cleanups and bug fixes, quite a bit assisted from bots. There are a few new syzkaller splats that haven't been solved yet but they should get into the rcs in a few weeks, I think. Summary: - Update drivers to use common helpers for GUIDs, pkeys, bitmaps, memset_startat, and others - General code cleanups from bots - Simplify some of the rxe pool code in preparation for a larger rework - Clean out old stuff from hns, including all support for hip06 devices - Fix a bug where GID table entries could be missed if the table had holes in it - Rename paths and sessions in rtrs for better understandability - Consolidate the roce source port selection code - NDR speed support in mlx5" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (83 commits) RDMA/irdma: Remove the redundant return RDMA/rxe: Use the standard method to produce udp source port RDMA/irdma: Make the source udp port vary RDMA/hns: Replace get_udp_sport with rdma_get_udp_sport RDMA/core: Calculate UDP source port based on flow label or lqpn/rqpn IB/qib: Fix typos RDMA/rtrs-clt: Rename rtrs_clt to rtrs_clt_sess RDMA/rtrs-srv: Rename rtrs_srv to rtrs_srv_sess RDMA/rtrs-clt: Rename rtrs_clt_sess to rtrs_clt_path RDMA/rtrs-srv: Rename rtrs_srv_sess to rtrs_srv_path RDMA/rtrs: Rename rtrs_sess to rtrs_path RDMA/hns: Modify the hop num of HIP09 EQ to 1 IB/iser: Align coding style across driver IB/iser: Remove un-needed casting to/from void pointer IB/iser: Don't suppress send completions IB/iser: Rename ib_ret local variable IB/iser: Fix RNR errors IB/iser: Remove deprecated pi_guard module param IB/mlx5: Expose NDR speed through MAD RDMA/cxgb4: Set queue pair state when being queried ...
2 parents feb7a43 + c0fe82b commit 747c19e

Some content is hidden

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

105 files changed

+2232
-8797
lines changed

drivers/block/rnbd/rnbd-clt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ static void msg_conf(void *priv, int errno)
433433
schedule_work(&iu->work);
434434
}
435435

436-
static int send_usr_msg(struct rtrs_clt *rtrs, int dir,
436+
static int send_usr_msg(struct rtrs_clt_sess *rtrs, int dir,
437437
struct rnbd_iu *iu, struct kvec *vec,
438438
size_t len, struct scatterlist *sg, unsigned int sg_len,
439439
void (*conf)(struct work_struct *work),
@@ -1010,7 +1010,7 @@ static int rnbd_client_xfer_request(struct rnbd_clt_dev *dev,
10101010
struct request *rq,
10111011
struct rnbd_iu *iu)
10121012
{
1013-
struct rtrs_clt *rtrs = dev->sess->rtrs;
1013+
struct rtrs_clt_sess *rtrs = dev->sess->rtrs;
10141014
struct rtrs_permit *permit = iu->permit;
10151015
struct rnbd_msg_io msg;
10161016
struct rtrs_clt_req_ops req_ops;

drivers/block/rnbd/rnbd-clt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct rnbd_cpu_qlist {
7575

7676
struct rnbd_clt_session {
7777
struct list_head list;
78-
struct rtrs_clt *rtrs;
78+
struct rtrs_clt_sess *rtrs;
7979
wait_queue_head_t rtrs_waitq;
8080
bool rtrs_ready;
8181
struct rnbd_cpu_qlist __percpu

drivers/block/rnbd/rnbd-srv.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,15 @@ static void destroy_sess(struct rnbd_srv_session *srv_sess)
263263
kfree(srv_sess);
264264
}
265265

266-
static int create_sess(struct rtrs_srv *rtrs)
266+
static int create_sess(struct rtrs_srv_sess *rtrs)
267267
{
268268
struct rnbd_srv_session *srv_sess;
269-
char sessname[NAME_MAX];
269+
char pathname[NAME_MAX];
270270
int err;
271271

272-
err = rtrs_srv_get_sess_name(rtrs, sessname, sizeof(sessname));
272+
err = rtrs_srv_get_path_name(rtrs, pathname, sizeof(pathname));
273273
if (err) {
274-
pr_err("rtrs_srv_get_sess_name(%s): %d\n", sessname, err);
274+
pr_err("rtrs_srv_get_path_name(%s): %d\n", pathname, err);
275275

276276
return err;
277277
}
@@ -284,8 +284,8 @@ static int create_sess(struct rtrs_srv *rtrs)
284284
offsetof(struct rnbd_dev_blk_io, bio),
285285
BIOSET_NEED_BVECS);
286286
if (err) {
287-
pr_err("Allocating srv_session for session %s failed\n",
288-
sessname);
287+
pr_err("Allocating srv_session for path %s failed\n",
288+
pathname);
289289
kfree(srv_sess);
290290
return err;
291291
}
@@ -298,14 +298,14 @@ static int create_sess(struct rtrs_srv *rtrs)
298298
mutex_unlock(&sess_lock);
299299

300300
srv_sess->rtrs = rtrs;
301-
strscpy(srv_sess->sessname, sessname, sizeof(srv_sess->sessname));
301+
strscpy(srv_sess->sessname, pathname, sizeof(srv_sess->sessname));
302302

303303
rtrs_srv_set_sess_priv(rtrs, srv_sess);
304304

305305
return 0;
306306
}
307307

308-
static int rnbd_srv_link_ev(struct rtrs_srv *rtrs,
308+
static int rnbd_srv_link_ev(struct rtrs_srv_sess *rtrs,
309309
enum rtrs_srv_link_ev ev, void *priv)
310310
{
311311
struct rnbd_srv_session *srv_sess = priv;

drivers/block/rnbd/rnbd-srv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
struct rnbd_srv_session {
2121
/* Entry inside global sess_list */
2222
struct list_head list;
23-
struct rtrs_srv *rtrs;
23+
struct rtrs_srv_sess *rtrs;
2424
char sessname[NAME_MAX];
2525
int queue_depth;
2626
struct bio_set sess_bio_set;

drivers/infiniband/core/cache.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,17 +956,23 @@ int rdma_query_gid(struct ib_device *device, u32 port_num,
956956
{
957957
struct ib_gid_table *table;
958958
unsigned long flags;
959-
int res = -EINVAL;
959+
int res;
960960

961961
if (!rdma_is_port_valid(device, port_num))
962962
return -EINVAL;
963963

964964
table = rdma_gid_table(device, port_num);
965965
read_lock_irqsave(&table->rwlock, flags);
966966

967-
if (index < 0 || index >= table->sz ||
968-
!is_gid_entry_valid(table->data_vec[index]))
967+
if (index < 0 || index >= table->sz) {
968+
res = -EINVAL;
969969
goto done;
970+
}
971+
972+
if (!is_gid_entry_valid(table->data_vec[index])) {
973+
res = -ENOENT;
974+
goto done;
975+
}
970976

971977
memcpy(gid, &table->data_vec[index]->attr.gid, sizeof(*gid));
972978
res = 0;

drivers/infiniband/core/cma.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,7 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)
766766
unsigned int p;
767767
u16 pkey, index;
768768
enum ib_port_state port_state;
769+
int ret;
769770
int i;
770771

771772
cma_dev = NULL;
@@ -784,9 +785,14 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)
784785

785786
if (ib_get_cached_port_state(cur_dev->device, p, &port_state))
786787
continue;
787-
for (i = 0; !rdma_query_gid(cur_dev->device,
788-
p, i, &gid);
789-
i++) {
788+
789+
for (i = 0; i < cur_dev->device->port_data[p].immutable.gid_tbl_len;
790+
++i) {
791+
ret = rdma_query_gid(cur_dev->device, p, i,
792+
&gid);
793+
if (ret)
794+
continue;
795+
790796
if (!memcmp(&gid, dgid, sizeof(gid))) {
791797
cma_dev = cur_dev;
792798
sgid = gid;
@@ -4033,8 +4039,7 @@ static int cma_resolve_ib_udp(struct rdma_id_private *id_priv,
40334039

40344040
memset(&req, 0, sizeof req);
40354041
offset = cma_user_data_offset(id_priv);
4036-
req.private_data_len = offset + conn_param->private_data_len;
4037-
if (req.private_data_len < conn_param->private_data_len)
4042+
if (check_add_overflow(offset, conn_param->private_data_len, &req.private_data_len))
40384043
return -EINVAL;
40394044

40404045
if (req.private_data_len) {
@@ -4093,8 +4098,7 @@ static int cma_connect_ib(struct rdma_id_private *id_priv,
40934098

40944099
memset(&req, 0, sizeof req);
40954100
offset = cma_user_data_offset(id_priv);
4096-
req.private_data_len = offset + conn_param->private_data_len;
4097-
if (req.private_data_len < conn_param->private_data_len)
4101+
if (check_add_overflow(offset, conn_param->private_data_len, &req.private_data_len))
40984102
return -EINVAL;
40994103

41004104
if (req.private_data_len) {

drivers/infiniband/core/device.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,8 @@ int ib_find_gid(struct ib_device *device, union ib_gid *gid,
24612461
++i) {
24622462
ret = rdma_query_gid(device, port, i, &tmp_gid);
24632463
if (ret)
2464-
return ret;
2464+
continue;
2465+
24652466
if (!memcmp(&tmp_gid, gid, sizeof *gid)) {
24662467
*port_num = port;
24672468
if (index)

drivers/infiniband/core/sysfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ static struct attribute *port_default_attrs[] = {
433433
&ib_port_attr_link_layer.attr,
434434
NULL
435435
};
436+
ATTRIBUTE_GROUPS(port_default);
436437

437438
static ssize_t print_ndev(const struct ib_gid_attr *gid_attr, char *buf)
438439
{
@@ -774,7 +775,7 @@ static void ib_port_gid_attr_release(struct kobject *kobj)
774775
static struct kobj_type port_type = {
775776
.release = ib_port_release,
776777
.sysfs_ops = &port_sysfs_ops,
777-
.default_attrs = port_default_attrs
778+
.default_groups = port_default_groups,
778779
};
779780

780781
static struct kobj_type gid_attr_type = {

drivers/infiniband/core/umem_odp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ struct ib_umem_odp *ib_umem_odp_get(struct ib_device *device,
227227
const struct mmu_interval_notifier_ops *ops)
228228
{
229229
struct ib_umem_odp *umem_odp;
230-
struct mm_struct *mm;
231230
int ret;
232231

233232
if (WARN_ON_ONCE(!(access & IB_ACCESS_ON_DEMAND)))
@@ -241,7 +240,7 @@ struct ib_umem_odp *ib_umem_odp_get(struct ib_device *device,
241240
umem_odp->umem.length = size;
242241
umem_odp->umem.address = addr;
243242
umem_odp->umem.writable = ib_access_writable(access);
244-
umem_odp->umem.owning_mm = mm = current->mm;
243+
umem_odp->umem.owning_mm = current->mm;
245244
umem_odp->notifier.ops = ops;
246245

247246
umem_odp->page_shift = PAGE_SHIFT;

drivers/infiniband/core/uverbs_cmd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,6 @@ static int create_qp(struct uverbs_attr_bundle *attrs,
13991399
attr.sq_sig_type = cmd->sq_sig_all ? IB_SIGNAL_ALL_WR :
14001400
IB_SIGNAL_REQ_WR;
14011401
attr.qp_type = cmd->qp_type;
1402-
attr.create_flags = 0;
14031402

14041403
attr.cap.max_send_wr = cmd->max_send_wr;
14051404
attr.cap.max_recv_wr = cmd->max_recv_wr;

0 commit comments

Comments
 (0)