diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2019-06-28 20:18:23 -0400 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2019-06-28 20:18:23 -0400 |
commit | 371bb62158d53c1fc33e2fb9b6aeb9522caf6cf4 (patch) | |
tree | 9442ae9b22e3cf24fbe8dcefae8862a3e4e05629 /drivers/infiniband | |
parent | 10dcc7448e9ea49488a38bca7551de1a9da06ad9 (diff) | |
parent | 4b972a01a7da614b4796475f933094751a295a2f (diff) |
Merge tag 'v5.2-rc6' into rdma.git for-next
For dependencies in next patches.
Resolve conflicts:
- Use uverbs_get_cleared_udata() with new cq allocation flow
- Continue to delete nes despite SPDX conflict
- Resolve list appends in mlx5_command_str()
- Use u16 for vport_rule stuff
- Resolve list appends in struct ib_client
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband')
75 files changed, 324 insertions, 154 deletions
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig index 0fe6f76e8fdc..42af4cd40ba2 100644 --- a/drivers/infiniband/Kconfig +++ b/drivers/infiniband/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | menuconfig INFINIBAND | 2 | menuconfig INFINIBAND |
2 | tristate "InfiniBand support" | 3 | tristate "InfiniBand support" |
3 | depends on HAS_IOMEM && HAS_DMA | 4 | depends on HAS_IOMEM && HAS_DMA |
diff --git a/drivers/infiniband/Makefile b/drivers/infiniband/Makefile index fad0b44c356f..8603cdfcfdcb 100644 --- a/drivers/infiniband/Makefile +++ b/drivers/infiniband/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | obj-$(CONFIG_INFINIBAND) += core/ | 2 | obj-$(CONFIG_INFINIBAND) += core/ |
2 | obj-$(CONFIG_INFINIBAND) += hw/ | 3 | obj-$(CONFIG_INFINIBAND) += hw/ |
3 | obj-$(CONFIG_INFINIBAND) += ulp/ | 4 | obj-$(CONFIG_INFINIBAND) += ulp/ |
diff --git a/drivers/infiniband/core/cgroup.c b/drivers/infiniband/core/cgroup.c index 388fd04e5f63..1f037fe01450 100644 --- a/drivers/infiniband/core/cgroup.c +++ b/drivers/infiniband/core/cgroup.c | |||
@@ -1,14 +1,6 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
1 | /* | 2 | /* |
2 | * Copyright (C) 2016 Parav Pandit <pandit.parav@gmail.com> | 3 | * Copyright (C) 2016 Parav Pandit <pandit.parav@gmail.com> |
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | */ | 4 | */ |
13 | 5 | ||
14 | #include "core_priv.h" | 6 | #include "core_priv.h" |
diff --git a/drivers/infiniband/core/cq.c b/drivers/infiniband/core/cq.c index 3b9412c69565..00d70f166209 100644 --- a/drivers/infiniband/core/cq.c +++ b/drivers/infiniband/core/cq.c | |||
@@ -1,14 +1,6 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
1 | /* | 2 | /* |
2 | * Copyright (c) 2015 HGST, a Western Digital Company. | 3 | * Copyright (c) 2015 HGST, a Western Digital Company. |
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | */ | 4 | */ |
13 | #include <linux/module.h> | 5 | #include <linux/module.h> |
14 | #include <linux/err.h> | 6 | #include <linux/err.h> |
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index 669c2d58e695..8a6ccb936dfe 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c | |||
@@ -407,27 +407,44 @@ static int rename_compat_devs(struct ib_device *device) | |||
407 | 407 | ||
408 | int ib_device_rename(struct ib_device *ibdev, const char *name) | 408 | int ib_device_rename(struct ib_device *ibdev, const char *name) |
409 | { | 409 | { |
410 | unsigned long index; | ||
411 | void *client_data; | ||
410 | int ret; | 412 | int ret; |
411 | 413 | ||
412 | down_write(&devices_rwsem); | 414 | down_write(&devices_rwsem); |
413 | if (!strcmp(name, dev_name(&ibdev->dev))) { | 415 | if (!strcmp(name, dev_name(&ibdev->dev))) { |
414 | ret = 0; | 416 | up_write(&devices_rwsem); |
415 | goto out; | 417 | return 0; |
416 | } | 418 | } |
417 | 419 | ||
418 | if (__ib_device_get_by_name(name)) { | 420 | if (__ib_device_get_by_name(name)) { |
419 | ret = -EEXIST; | 421 | up_write(&devices_rwsem); |
420 | goto out; | 422 | return -EEXIST; |
421 | } | 423 | } |
422 | 424 | ||
423 | ret = device_rename(&ibdev->dev, name); | 425 | ret = device_rename(&ibdev->dev, name); |
424 | if (ret) | 426 | if (ret) { |
425 | goto out; | 427 | up_write(&devices_rwsem); |
428 | return ret; | ||
429 | } | ||
430 | |||
426 | strlcpy(ibdev->name, name, IB_DEVICE_NAME_MAX); | 431 | strlcpy(ibdev->name, name, IB_DEVICE_NAME_MAX); |
427 | ret = rename_compat_devs(ibdev); | 432 | ret = rename_compat_devs(ibdev); |
428 | out: | 433 | |
429 | up_write(&devices_rwsem); | 434 | downgrade_write(&devices_rwsem); |
430 | return ret; | 435 | down_read(&ibdev->client_data_rwsem); |
436 | xan_for_each_marked(&ibdev->client_data, index, client_data, | ||
437 | CLIENT_DATA_REGISTERED) { | ||
438 | struct ib_client *client = xa_load(&clients, index); | ||
439 | |||
440 | if (!client || !client->rename) | ||
441 | continue; | ||
442 | |||
443 | client->rename(ibdev, client_data); | ||
444 | } | ||
445 | up_read(&ibdev->client_data_rwsem); | ||
446 | up_read(&devices_rwsem); | ||
447 | return 0; | ||
431 | } | 448 | } |
432 | 449 | ||
433 | static int alloc_name(struct ib_device *ibdev, const char *name) | 450 | static int alloc_name(struct ib_device *ibdev, const char *name) |
@@ -472,14 +489,15 @@ static void ib_device_release(struct device *device) | |||
472 | 489 | ||
473 | free_netdevs(dev); | 490 | free_netdevs(dev); |
474 | WARN_ON(refcount_read(&dev->refcount)); | 491 | WARN_ON(refcount_read(&dev->refcount)); |
475 | ib_cache_release_one(dev); | 492 | if (dev->port_data) { |
476 | ib_security_release_port_pkey_list(dev); | 493 | ib_cache_release_one(dev); |
477 | xa_destroy(&dev->compat_devs); | 494 | ib_security_release_port_pkey_list(dev); |
478 | xa_destroy(&dev->client_data); | ||
479 | if (dev->port_data) | ||
480 | kfree_rcu(container_of(dev->port_data, struct ib_port_data_rcu, | 495 | kfree_rcu(container_of(dev->port_data, struct ib_port_data_rcu, |
481 | pdata[0]), | 496 | pdata[0]), |
482 | rcu_head); | 497 | rcu_head); |
498 | } | ||
499 | xa_destroy(&dev->compat_devs); | ||
500 | xa_destroy(&dev->client_data); | ||
483 | kfree_rcu(dev, rcu_head); | 501 | kfree_rcu(dev, rcu_head); |
484 | } | 502 | } |
485 | 503 | ||
@@ -2028,6 +2046,9 @@ static void free_netdevs(struct ib_device *ib_dev) | |||
2028 | unsigned long flags; | 2046 | unsigned long flags; |
2029 | unsigned int port; | 2047 | unsigned int port; |
2030 | 2048 | ||
2049 | if (!ib_dev->port_data) | ||
2050 | return; | ||
2051 | |||
2031 | rdma_for_each_port (ib_dev, port) { | 2052 | rdma_for_each_port (ib_dev, port) { |
2032 | struct ib_port_data *pdata = &ib_dev->port_data[port]; | 2053 | struct ib_port_data *pdata = &ib_dev->port_data[port]; |
2033 | struct net_device *ndev; | 2054 | struct net_device *ndev; |
diff --git a/drivers/infiniband/core/mr_pool.c b/drivers/infiniband/core/mr_pool.c index 132ff92626e1..c0e2df128b34 100644 --- a/drivers/infiniband/core/mr_pool.c +++ b/drivers/infiniband/core/mr_pool.c | |||
@@ -1,14 +1,6 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
1 | /* | 2 | /* |
2 | * Copyright (c) 2016 HGST, a Western Digital Company. | 3 | * Copyright (c) 2016 HGST, a Western Digital Company. |
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | */ | 4 | */ |
13 | #include <rdma/ib_verbs.h> | 5 | #include <rdma/ib_verbs.h> |
14 | #include <rdma/mr_pool.h> | 6 | #include <rdma/mr_pool.h> |
diff --git a/drivers/infiniband/core/rdma_core.h b/drivers/infiniband/core/rdma_core.h index 5445323629b5..e63fbda25e1d 100644 --- a/drivers/infiniband/core/rdma_core.h +++ b/drivers/infiniband/core/rdma_core.h | |||
@@ -110,6 +110,8 @@ int uverbs_output_written(const struct uverbs_attr_bundle *bundle, size_t idx); | |||
110 | void setup_ufile_idr_uobject(struct ib_uverbs_file *ufile); | 110 | void setup_ufile_idr_uobject(struct ib_uverbs_file *ufile); |
111 | void release_ufile_idr_uobject(struct ib_uverbs_file *ufile); | 111 | void release_ufile_idr_uobject(struct ib_uverbs_file *ufile); |
112 | 112 | ||
113 | struct ib_udata *uverbs_get_cleared_udata(struct uverbs_attr_bundle *attrs); | ||
114 | |||
113 | /* | 115 | /* |
114 | * This is the runtime description of the uverbs API, used by the syscall | 116 | * This is the runtime description of the uverbs API, used by the syscall |
115 | * machinery to validate and dispatch calls. | 117 | * machinery to validate and dispatch calls. |
diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c index cc5feb301c05..dce06108c8c3 100644 --- a/drivers/infiniband/core/rw.c +++ b/drivers/infiniband/core/rw.c | |||
@@ -1,14 +1,6 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-only | ||
1 | /* | 2 | /* |
2 | * Copyright (c) 2016 HGST, a Western Digital Company. | 3 | * Copyright (c) 2016 HGST, a Western Digital Company. |
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | */ | 4 | */ |
13 | #include <linux/moduleparam.h> | 5 | #include <linux/moduleparam.h> |
14 | #include <linux/slab.h> | 6 | #include <linux/slab.h> |
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 911533081db5..750c4d484329 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c | |||
@@ -174,6 +174,17 @@ static int uverbs_request_finish(struct uverbs_req_iter *iter) | |||
174 | return 0; | 174 | return 0; |
175 | } | 175 | } |
176 | 176 | ||
177 | /* | ||
178 | * When calling a destroy function during an error unwind we need to pass in | ||
179 | * the udata that is sanitized of all user arguments. Ie from the driver | ||
180 | * perspective it looks like no udata was passed. | ||
181 | */ | ||
182 | struct ib_udata *uverbs_get_cleared_udata(struct uverbs_attr_bundle *attrs) | ||
183 | { | ||
184 | attrs->driver_udata = (struct ib_udata){}; | ||
185 | return &attrs->driver_udata; | ||
186 | } | ||
187 | |||
177 | static struct ib_uverbs_completion_event_file * | 188 | static struct ib_uverbs_completion_event_file * |
178 | _ib_uverbs_lookup_comp_file(s32 fd, struct uverbs_attr_bundle *attrs) | 189 | _ib_uverbs_lookup_comp_file(s32 fd, struct uverbs_attr_bundle *attrs) |
179 | { | 190 | { |
@@ -441,7 +452,7 @@ static int ib_uverbs_alloc_pd(struct uverbs_attr_bundle *attrs) | |||
441 | return uobj_alloc_commit(uobj, attrs); | 452 | return uobj_alloc_commit(uobj, attrs); |
442 | 453 | ||
443 | err_copy: | 454 | err_copy: |
444 | ib_dealloc_pd_user(pd, &attrs->driver_udata); | 455 | ib_dealloc_pd_user(pd, uverbs_get_cleared_udata(attrs)); |
445 | pd = NULL; | 456 | pd = NULL; |
446 | err_alloc: | 457 | err_alloc: |
447 | kfree(pd); | 458 | kfree(pd); |
@@ -644,7 +655,7 @@ err_copy: | |||
644 | } | 655 | } |
645 | 656 | ||
646 | err_dealloc_xrcd: | 657 | err_dealloc_xrcd: |
647 | ib_dealloc_xrcd(xrcd, &attrs->driver_udata); | 658 | ib_dealloc_xrcd(xrcd, uverbs_get_cleared_udata(attrs)); |
648 | 659 | ||
649 | err: | 660 | err: |
650 | uobj_alloc_abort(&obj->uobject, attrs); | 661 | uobj_alloc_abort(&obj->uobject, attrs); |
@@ -769,7 +780,7 @@ static int ib_uverbs_reg_mr(struct uverbs_attr_bundle *attrs) | |||
769 | return uobj_alloc_commit(uobj, attrs); | 780 | return uobj_alloc_commit(uobj, attrs); |
770 | 781 | ||
771 | err_copy: | 782 | err_copy: |
772 | ib_dereg_mr_user(mr, &attrs->driver_udata); | 783 | ib_dereg_mr_user(mr, uverbs_get_cleared_udata(attrs)); |
773 | 784 | ||
774 | err_put: | 785 | err_put: |
775 | uobj_put_obj_read(pd); | 786 | uobj_put_obj_read(pd); |
@@ -1047,7 +1058,7 @@ static struct ib_ucq_object *create_cq(struct uverbs_attr_bundle *attrs, | |||
1047 | return obj; | 1058 | return obj; |
1048 | 1059 | ||
1049 | err_cb: | 1060 | err_cb: |
1050 | ib_destroy_cq(cq); | 1061 | ib_destroy_cq_user(cq, uverbs_get_cleared_udata(attrs)); |
1051 | cq = NULL; | 1062 | cq = NULL; |
1052 | err_free: | 1063 | err_free: |
1053 | kfree(cq); | 1064 | kfree(cq); |
@@ -1485,7 +1496,7 @@ static int create_qp(struct uverbs_attr_bundle *attrs, | |||
1485 | 1496 | ||
1486 | return uobj_alloc_commit(&obj->uevent.uobject, attrs); | 1497 | return uobj_alloc_commit(&obj->uevent.uobject, attrs); |
1487 | err_cb: | 1498 | err_cb: |
1488 | ib_destroy_qp(qp); | 1499 | ib_destroy_qp_user(qp, uverbs_get_cleared_udata(attrs)); |
1489 | 1500 | ||
1490 | err_put: | 1501 | err_put: |
1491 | if (!IS_ERR(xrcd_uobj)) | 1502 | if (!IS_ERR(xrcd_uobj)) |
@@ -1618,7 +1629,7 @@ static int ib_uverbs_open_qp(struct uverbs_attr_bundle *attrs) | |||
1618 | return uobj_alloc_commit(&obj->uevent.uobject, attrs); | 1629 | return uobj_alloc_commit(&obj->uevent.uobject, attrs); |
1619 | 1630 | ||
1620 | err_destroy: | 1631 | err_destroy: |
1621 | ib_destroy_qp(qp); | 1632 | ib_destroy_qp_user(qp, uverbs_get_cleared_udata(attrs)); |
1622 | err_xrcd: | 1633 | err_xrcd: |
1623 | uobj_put_read(xrcd_uobj); | 1634 | uobj_put_read(xrcd_uobj); |
1624 | err_put: | 1635 | err_put: |
@@ -2460,7 +2471,8 @@ static int ib_uverbs_create_ah(struct uverbs_attr_bundle *attrs) | |||
2460 | return uobj_alloc_commit(uobj, attrs); | 2471 | return uobj_alloc_commit(uobj, attrs); |
2461 | 2472 | ||
2462 | err_copy: | 2473 | err_copy: |
2463 | rdma_destroy_ah(ah, RDMA_DESTROY_AH_SLEEPABLE); | 2474 | rdma_destroy_ah_user(ah, RDMA_DESTROY_AH_SLEEPABLE, |
2475 | uverbs_get_cleared_udata(attrs)); | ||
2464 | 2476 | ||
2465 | err_put: | 2477 | err_put: |
2466 | uobj_put_obj_read(pd); | 2478 | uobj_put_obj_read(pd); |
@@ -2971,7 +2983,7 @@ static int ib_uverbs_ex_create_wq(struct uverbs_attr_bundle *attrs) | |||
2971 | return uobj_alloc_commit(&obj->uevent.uobject, attrs); | 2983 | return uobj_alloc_commit(&obj->uevent.uobject, attrs); |
2972 | 2984 | ||
2973 | err_copy: | 2985 | err_copy: |
2974 | ib_destroy_wq(wq, &attrs->driver_udata); | 2986 | ib_destroy_wq(wq, uverbs_get_cleared_udata(attrs)); |
2975 | err_put_cq: | 2987 | err_put_cq: |
2976 | uobj_put_obj_read(cq); | 2988 | uobj_put_obj_read(cq); |
2977 | err_put_pd: | 2989 | err_put_pd: |
@@ -3471,7 +3483,7 @@ static int __uverbs_create_xsrq(struct uverbs_attr_bundle *attrs, | |||
3471 | return uobj_alloc_commit(&obj->uevent.uobject, attrs); | 3483 | return uobj_alloc_commit(&obj->uevent.uobject, attrs); |
3472 | 3484 | ||
3473 | err_copy: | 3485 | err_copy: |
3474 | ib_destroy_srq_user(srq, &attrs->driver_udata); | 3486 | ib_destroy_srq_user(srq, uverbs_get_cleared_udata(attrs)); |
3475 | 3487 | ||
3476 | err_free: | 3488 | err_free: |
3477 | kfree(srq); | 3489 | kfree(srq); |
diff --git a/drivers/infiniband/core/uverbs_std_types_cq.c b/drivers/infiniband/core/uverbs_std_types_cq.c index 06b8c7d017b7..e39fe6a8aac4 100644 --- a/drivers/infiniband/core/uverbs_std_types_cq.c +++ b/drivers/infiniband/core/uverbs_std_types_cq.c | |||
@@ -140,7 +140,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_CQ_CREATE)( | |||
140 | 140 | ||
141 | return 0; | 141 | return 0; |
142 | err_cq: | 142 | err_cq: |
143 | ib_destroy_cq(cq); | 143 | ib_destroy_cq_user(cq, uverbs_get_cleared_udata(attrs)); |
144 | cq = NULL; | 144 | cq = NULL; |
145 | err_free: | 145 | err_free: |
146 | kfree(cq); | 146 | kfree(cq); |
diff --git a/drivers/infiniband/core/uverbs_std_types_mr.c b/drivers/infiniband/core/uverbs_std_types_mr.c index 7ca79bfa3487..c1286a52dc84 100644 --- a/drivers/infiniband/core/uverbs_std_types_mr.c +++ b/drivers/infiniband/core/uverbs_std_types_mr.c | |||
@@ -149,7 +149,7 @@ static int UVERBS_HANDLER(UVERBS_METHOD_DM_MR_REG)( | |||
149 | return 0; | 149 | return 0; |
150 | 150 | ||
151 | err_dereg: | 151 | err_dereg: |
152 | ib_dereg_mr_user(mr, &attrs->driver_udata); | 152 | ib_dereg_mr_user(mr, uverbs_get_cleared_udata(attrs)); |
153 | 153 | ||
154 | return ret; | 154 | return ret; |
155 | } | 155 | } |
diff --git a/drivers/infiniband/hw/bnxt_re/Kconfig b/drivers/infiniband/hw/bnxt_re/Kconfig index 51e8234520a9..ab8779d23382 100644 --- a/drivers/infiniband/hw/bnxt_re/Kconfig +++ b/drivers/infiniband/hw/bnxt_re/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_BNXT_RE | 2 | config INFINIBAND_BNXT_RE |
2 | tristate "Broadcom Netxtreme HCA support" | 3 | tristate "Broadcom Netxtreme HCA support" |
3 | depends on 64BIT | 4 | depends on 64BIT |
diff --git a/drivers/infiniband/hw/cxgb3/Kconfig b/drivers/infiniband/hw/cxgb3/Kconfig index a7b77cb3d5d5..8c1a72bff447 100644 --- a/drivers/infiniband/hw/cxgb3/Kconfig +++ b/drivers/infiniband/hw/cxgb3/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_CXGB3 | 2 | config INFINIBAND_CXGB3 |
2 | tristate "Chelsio RDMA Driver" | 3 | tristate "Chelsio RDMA Driver" |
3 | depends on CHELSIO_T3 | 4 | depends on CHELSIO_T3 |
diff --git a/drivers/infiniband/hw/cxgb4/Kconfig b/drivers/infiniband/hw/cxgb4/Kconfig index e0522a5d5a06..b49e8d4c3854 100644 --- a/drivers/infiniband/hw/cxgb4/Kconfig +++ b/drivers/infiniband/hw/cxgb4/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_CXGB4 | 2 | config INFINIBAND_CXGB4 |
2 | tristate "Chelsio T4/T5 RDMA Driver" | 3 | tristate "Chelsio T4/T5 RDMA Driver" |
3 | depends on CHELSIO_T4 && INET | 4 | depends on CHELSIO_T4 && INET |
diff --git a/drivers/infiniband/hw/cxgb4/Makefile b/drivers/infiniband/hw/cxgb4/Makefile index 31a87d90a40b..291d259d2319 100644 --- a/drivers/infiniband/hw/cxgb4/Makefile +++ b/drivers/infiniband/hw/cxgb4/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | ccflags-y := -I $(srctree)/drivers/net/ethernet/chelsio/cxgb4 | 2 | ccflags-y := -I $(srctree)/drivers/net/ethernet/chelsio/cxgb4 |
2 | ccflags-y += -I $(srctree)/drivers/net/ethernet/chelsio/libcxgb | 3 | ccflags-y += -I $(srctree)/drivers/net/ethernet/chelsio/libcxgb |
3 | 4 | ||
diff --git a/drivers/infiniband/hw/efa/efa_com_cmd.c b/drivers/infiniband/hw/efa/efa_com_cmd.c index fad5c2ee7bb1..62345d8abf3c 100644 --- a/drivers/infiniband/hw/efa/efa_com_cmd.c +++ b/drivers/infiniband/hw/efa/efa_com_cmd.c | |||
@@ -138,9 +138,11 @@ int efa_com_destroy_qp(struct efa_com_dev *edev, | |||
138 | sizeof(qp_cmd), | 138 | sizeof(qp_cmd), |
139 | (struct efa_admin_acq_entry *)&cmd_completion, | 139 | (struct efa_admin_acq_entry *)&cmd_completion, |
140 | sizeof(cmd_completion)); | 140 | sizeof(cmd_completion)); |
141 | if (err) | 141 | if (err) { |
142 | ibdev_err(edev->efa_dev, "Failed to destroy qp-%u [%d]\n", | 142 | ibdev_err(edev->efa_dev, "Failed to destroy qp-%u [%d]\n", |
143 | qp_cmd.qp_handle, err); | 143 | qp_cmd.qp_handle, err); |
144 | return err; | ||
145 | } | ||
144 | 146 | ||
145 | return 0; | 147 | return 0; |
146 | } | 148 | } |
@@ -198,9 +200,11 @@ int efa_com_destroy_cq(struct efa_com_dev *edev, | |||
198 | (struct efa_admin_acq_entry *)&destroy_resp, | 200 | (struct efa_admin_acq_entry *)&destroy_resp, |
199 | sizeof(destroy_resp)); | 201 | sizeof(destroy_resp)); |
200 | 202 | ||
201 | if (err) | 203 | if (err) { |
202 | ibdev_err(edev->efa_dev, "Failed to destroy CQ-%u [%d]\n", | 204 | ibdev_err(edev->efa_dev, "Failed to destroy CQ-%u [%d]\n", |
203 | params->cq_idx, err); | 205 | params->cq_idx, err); |
206 | return err; | ||
207 | } | ||
204 | 208 | ||
205 | return 0; | 209 | return 0; |
206 | } | 210 | } |
@@ -272,10 +276,12 @@ int efa_com_dereg_mr(struct efa_com_dev *edev, | |||
272 | sizeof(mr_cmd), | 276 | sizeof(mr_cmd), |
273 | (struct efa_admin_acq_entry *)&cmd_completion, | 277 | (struct efa_admin_acq_entry *)&cmd_completion, |
274 | sizeof(cmd_completion)); | 278 | sizeof(cmd_completion)); |
275 | if (err) | 279 | if (err) { |
276 | ibdev_err(edev->efa_dev, | 280 | ibdev_err(edev->efa_dev, |
277 | "Failed to de-register mr(lkey-%u) [%d]\n", | 281 | "Failed to de-register mr(lkey-%u) [%d]\n", |
278 | mr_cmd.l_key, err); | 282 | mr_cmd.l_key, err); |
283 | return err; | ||
284 | } | ||
279 | 285 | ||
280 | return 0; | 286 | return 0; |
281 | } | 287 | } |
@@ -327,9 +333,11 @@ int efa_com_destroy_ah(struct efa_com_dev *edev, | |||
327 | sizeof(ah_cmd), | 333 | sizeof(ah_cmd), |
328 | (struct efa_admin_acq_entry *)&cmd_completion, | 334 | (struct efa_admin_acq_entry *)&cmd_completion, |
329 | sizeof(cmd_completion)); | 335 | sizeof(cmd_completion)); |
330 | if (err) | 336 | if (err) { |
331 | ibdev_err(edev->efa_dev, "Failed to destroy ah-%d pd-%d [%d]\n", | 337 | ibdev_err(edev->efa_dev, "Failed to destroy ah-%d pd-%d [%d]\n", |
332 | ah_cmd.ah, ah_cmd.pd, err); | 338 | ah_cmd.ah, ah_cmd.pd, err); |
339 | return err; | ||
340 | } | ||
333 | 341 | ||
334 | return 0; | 342 | return 0; |
335 | } | 343 | } |
@@ -387,10 +395,12 @@ static int efa_com_get_feature_ex(struct efa_com_dev *edev, | |||
387 | get_resp, | 395 | get_resp, |
388 | sizeof(*get_resp)); | 396 | sizeof(*get_resp)); |
389 | 397 | ||
390 | if (err) | 398 | if (err) { |
391 | ibdev_err(edev->efa_dev, | 399 | ibdev_err(edev->efa_dev, |
392 | "Failed to submit get_feature command %d [%d]\n", | 400 | "Failed to submit get_feature command %d [%d]\n", |
393 | feature_id, err); | 401 | feature_id, err); |
402 | return err; | ||
403 | } | ||
394 | 404 | ||
395 | return 0; | 405 | return 0; |
396 | } | 406 | } |
@@ -534,10 +544,12 @@ static int efa_com_set_feature_ex(struct efa_com_dev *edev, | |||
534 | (struct efa_admin_acq_entry *)set_resp, | 544 | (struct efa_admin_acq_entry *)set_resp, |
535 | sizeof(*set_resp)); | 545 | sizeof(*set_resp)); |
536 | 546 | ||
537 | if (err) | 547 | if (err) { |
538 | ibdev_err(edev->efa_dev, | 548 | ibdev_err(edev->efa_dev, |
539 | "Failed to submit set_feature command %d error: %d\n", | 549 | "Failed to submit set_feature command %d error: %d\n", |
540 | feature_id, err); | 550 | feature_id, err); |
551 | return err; | ||
552 | } | ||
541 | 553 | ||
542 | return 0; | 554 | return 0; |
543 | } | 555 | } |
diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c index 7b4e0fa99817..df77bc312a25 100644 --- a/drivers/infiniband/hw/efa/efa_verbs.c +++ b/drivers/infiniband/hw/efa/efa_verbs.c | |||
@@ -204,6 +204,7 @@ static u64 mmap_entry_insert(struct efa_dev *dev, struct efa_ucontext *ucontext, | |||
204 | void *obj, u64 address, u64 length, u8 mmap_flag) | 204 | void *obj, u64 address, u64 length, u8 mmap_flag) |
205 | { | 205 | { |
206 | struct efa_mmap_entry *entry; | 206 | struct efa_mmap_entry *entry; |
207 | u32 next_mmap_page; | ||
207 | int err; | 208 | int err; |
208 | 209 | ||
209 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); | 210 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); |
@@ -216,15 +217,19 @@ static u64 mmap_entry_insert(struct efa_dev *dev, struct efa_ucontext *ucontext, | |||
216 | entry->mmap_flag = mmap_flag; | 217 | entry->mmap_flag = mmap_flag; |
217 | 218 | ||
218 | xa_lock(&ucontext->mmap_xa); | 219 | xa_lock(&ucontext->mmap_xa); |
220 | if (check_add_overflow(ucontext->mmap_xa_page, | ||
221 | (u32)(length >> PAGE_SHIFT), | ||
222 | &next_mmap_page)) | ||
223 | goto err_unlock; | ||
224 | |||
219 | entry->mmap_page = ucontext->mmap_xa_page; | 225 | entry->mmap_page = ucontext->mmap_xa_page; |
220 | ucontext->mmap_xa_page += DIV_ROUND_UP(length, PAGE_SIZE); | 226 | ucontext->mmap_xa_page = next_mmap_page; |
221 | err = __xa_insert(&ucontext->mmap_xa, entry->mmap_page, entry, | 227 | err = __xa_insert(&ucontext->mmap_xa, entry->mmap_page, entry, |
222 | GFP_KERNEL); | 228 | GFP_KERNEL); |
229 | if (err) | ||
230 | goto err_unlock; | ||
231 | |||
223 | xa_unlock(&ucontext->mmap_xa); | 232 | xa_unlock(&ucontext->mmap_xa); |
224 | if (err){ | ||
225 | kfree(entry); | ||
226 | return EFA_MMAP_INVALID; | ||
227 | } | ||
228 | 233 | ||
229 | ibdev_dbg( | 234 | ibdev_dbg( |
230 | &dev->ibdev, | 235 | &dev->ibdev, |
@@ -232,6 +237,12 @@ static u64 mmap_entry_insert(struct efa_dev *dev, struct efa_ucontext *ucontext, | |||
232 | entry->obj, entry->address, entry->length, get_mmap_key(entry)); | 237 | entry->obj, entry->address, entry->length, get_mmap_key(entry)); |
233 | 238 | ||
234 | return get_mmap_key(entry); | 239 | return get_mmap_key(entry); |
240 | |||
241 | err_unlock: | ||
242 | xa_unlock(&ucontext->mmap_xa); | ||
243 | kfree(entry); | ||
244 | return EFA_MMAP_INVALID; | ||
245 | |||
235 | } | 246 | } |
236 | 247 | ||
237 | int efa_query_device(struct ib_device *ibdev, | 248 | int efa_query_device(struct ib_device *ibdev, |
@@ -1628,7 +1639,6 @@ int efa_mmap(struct ib_ucontext *ibucontext, | |||
1628 | ibdev_dbg(&dev->ibdev, "Mapping executable pages is not permitted\n"); | 1639 | ibdev_dbg(&dev->ibdev, "Mapping executable pages is not permitted\n"); |
1629 | return -EPERM; | 1640 | return -EPERM; |
1630 | } | 1641 | } |
1631 | vma->vm_flags &= ~VM_MAYEXEC; | ||
1632 | 1642 | ||
1633 | return __efa_mmap(dev, ucontext, vma, key, length); | 1643 | return __efa_mmap(dev, ucontext, vma, key, length); |
1634 | } | 1644 | } |
diff --git a/drivers/infiniband/hw/hfi1/Kconfig b/drivers/infiniband/hw/hfi1/Kconfig index 7b146b67a80f..0653f4f7b26c 100644 --- a/drivers/infiniband/hw/hfi1/Kconfig +++ b/drivers/infiniband/hw/hfi1/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_HFI1 | 2 | config INFINIBAND_HFI1 |
2 | tristate "Intel OPA Gen1 support" | 3 | tristate "Intel OPA Gen1 support" |
3 | depends on X86_64 && INFINIBAND_RDMAVT && I2C | 4 | depends on X86_64 && INFINIBAND_RDMAVT && I2C |
diff --git a/drivers/infiniband/hw/hfi1/chip.c b/drivers/infiniband/hw/hfi1/chip.c index 310105d4e3de..d5b643a1d9fd 100644 --- a/drivers/infiniband/hw/hfi1/chip.c +++ b/drivers/infiniband/hw/hfi1/chip.c | |||
@@ -9850,6 +9850,7 @@ void hfi1_quiet_serdes(struct hfi1_pportdata *ppd) | |||
9850 | 9850 | ||
9851 | /* disable the port */ | 9851 | /* disable the port */ |
9852 | clear_rcvctrl(dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK); | 9852 | clear_rcvctrl(dd, RCV_CTRL_RCV_PORT_ENABLE_SMASK); |
9853 | cancel_work_sync(&ppd->freeze_work); | ||
9853 | } | 9854 | } |
9854 | 9855 | ||
9855 | static inline int init_cpu_counters(struct hfi1_devdata *dd) | 9856 | static inline int init_cpu_counters(struct hfi1_devdata *dd) |
@@ -14031,6 +14032,19 @@ static void init_kdeth_qp(struct hfi1_devdata *dd) | |||
14031 | } | 14032 | } |
14032 | 14033 | ||
14033 | /** | 14034 | /** |
14035 | * hfi1_get_qp_map | ||
14036 | * @dd: device data | ||
14037 | * @idx: index to read | ||
14038 | */ | ||
14039 | u8 hfi1_get_qp_map(struct hfi1_devdata *dd, u8 idx) | ||
14040 | { | ||
14041 | u64 reg = read_csr(dd, RCV_QP_MAP_TABLE + (idx / 8) * 8); | ||
14042 | |||
14043 | reg >>= (idx % 8) * 8; | ||
14044 | return reg; | ||
14045 | } | ||
14046 | |||
14047 | /** | ||
14034 | * init_qpmap_table | 14048 | * init_qpmap_table |
14035 | * @dd - device data | 14049 | * @dd - device data |
14036 | * @first_ctxt - first context | 14050 | * @first_ctxt - first context |
diff --git a/drivers/infiniband/hw/hfi1/chip.h b/drivers/infiniband/hw/hfi1/chip.h index 4e6c3556ec48..b76cf81f927f 100644 --- a/drivers/infiniband/hw/hfi1/chip.h +++ b/drivers/infiniband/hw/hfi1/chip.h | |||
@@ -1445,6 +1445,7 @@ void clear_all_interrupts(struct hfi1_devdata *dd); | |||
1445 | void remap_intr(struct hfi1_devdata *dd, int isrc, int msix_intr); | 1445 | void remap_intr(struct hfi1_devdata *dd, int isrc, int msix_intr); |
1446 | void remap_sdma_interrupts(struct hfi1_devdata *dd, int engine, int msix_intr); | 1446 | void remap_sdma_interrupts(struct hfi1_devdata *dd, int engine, int msix_intr); |
1447 | void reset_interrupts(struct hfi1_devdata *dd); | 1447 | void reset_interrupts(struct hfi1_devdata *dd); |
1448 | u8 hfi1_get_qp_map(struct hfi1_devdata *dd, u8 idx); | ||
1448 | 1449 | ||
1449 | /* | 1450 | /* |
1450 | * Interrupt source table. | 1451 | * Interrupt source table. |
diff --git a/drivers/infiniband/hw/hfi1/fault.c b/drivers/infiniband/hw/hfi1/fault.c index 3fd3315d0fb0..93613e5def9b 100644 --- a/drivers/infiniband/hw/hfi1/fault.c +++ b/drivers/infiniband/hw/hfi1/fault.c | |||
@@ -153,6 +153,7 @@ static ssize_t fault_opcodes_write(struct file *file, const char __user *buf, | |||
153 | char *dash; | 153 | char *dash; |
154 | unsigned long range_start, range_end, i; | 154 | unsigned long range_start, range_end, i; |
155 | bool remove = false; | 155 | bool remove = false; |
156 | unsigned long bound = 1U << BITS_PER_BYTE; | ||
156 | 157 | ||
157 | end = strchr(ptr, ','); | 158 | end = strchr(ptr, ','); |
158 | if (end) | 159 | if (end) |
@@ -178,6 +179,10 @@ static ssize_t fault_opcodes_write(struct file *file, const char __user *buf, | |||
178 | BITS_PER_BYTE); | 179 | BITS_PER_BYTE); |
179 | break; | 180 | break; |
180 | } | 181 | } |
182 | /* Check the inputs */ | ||
183 | if (range_start >= bound || range_end >= bound) | ||
184 | break; | ||
185 | |||
181 | for (i = range_start; i <= range_end; i++) { | 186 | for (i = range_start; i <= range_end; i++) { |
182 | if (remove) | 187 | if (remove) |
183 | clear_bit(i, fault->opcodes); | 188 | clear_bit(i, fault->opcodes); |
diff --git a/drivers/infiniband/hw/hfi1/hfi.h b/drivers/infiniband/hw/hfi1/hfi.h index b458c218842b..fa45350a9a1d 100644 --- a/drivers/infiniband/hw/hfi1/hfi.h +++ b/drivers/infiniband/hw/hfi1/hfi.h | |||
@@ -539,6 +539,37 @@ static inline void hfi1_16B_set_qpn(struct opa_16b_mgmt *mgmt, | |||
539 | mgmt->src_qpn = cpu_to_be32(src_qp & OPA_16B_MGMT_QPN_MASK); | 539 | mgmt->src_qpn = cpu_to_be32(src_qp & OPA_16B_MGMT_QPN_MASK); |
540 | } | 540 | } |
541 | 541 | ||
542 | /** | ||
543 | * hfi1_get_rc_ohdr - get extended header | ||
544 | * @opah - the opaheader | ||
545 | */ | ||
546 | static inline struct ib_other_headers * | ||
547 | hfi1_get_rc_ohdr(struct hfi1_opa_header *opah) | ||
548 | { | ||
549 | struct ib_other_headers *ohdr; | ||
550 | struct ib_header *hdr = NULL; | ||
551 | struct hfi1_16b_header *hdr_16b = NULL; | ||
552 | |||
553 | /* Find out where the BTH is */ | ||
554 | if (opah->hdr_type == HFI1_PKT_TYPE_9B) { | ||
555 | hdr = &opah->ibh; | ||
556 | if (ib_get_lnh(hdr) == HFI1_LRH_BTH) | ||
557 | ohdr = &hdr->u.oth; | ||
558 | else | ||
559 | ohdr = &hdr->u.l.oth; | ||
560 | } else { | ||
561 | u8 l4; | ||
562 | |||
563 | hdr_16b = &opah->opah; | ||
564 | l4 = hfi1_16B_get_l4(hdr_16b); | ||
565 | if (l4 == OPA_16B_L4_IB_LOCAL) | ||
566 | ohdr = &hdr_16b->u.oth; | ||
567 | else | ||
568 | ohdr = &hdr_16b->u.l.oth; | ||
569 | } | ||
570 | return ohdr; | ||
571 | } | ||
572 | |||
542 | struct rvt_sge_state; | 573 | struct rvt_sge_state; |
543 | 574 | ||
544 | /* | 575 | /* |
diff --git a/drivers/infiniband/hw/hfi1/pio.c b/drivers/infiniband/hw/hfi1/pio.c index 919008620dd3..79126b2b14ab 100644 --- a/drivers/infiniband/hw/hfi1/pio.c +++ b/drivers/infiniband/hw/hfi1/pio.c | |||
@@ -952,6 +952,22 @@ void sc_disable(struct send_context *sc) | |||
952 | } | 952 | } |
953 | } | 953 | } |
954 | spin_unlock(&sc->release_lock); | 954 | spin_unlock(&sc->release_lock); |
955 | |||
956 | write_seqlock(&sc->waitlock); | ||
957 | while (!list_empty(&sc->piowait)) { | ||
958 | struct iowait *wait; | ||
959 | struct rvt_qp *qp; | ||
960 | struct hfi1_qp_priv *priv; | ||
961 | |||
962 | wait = list_first_entry(&sc->piowait, struct iowait, list); | ||
963 | qp = iowait_to_qp(wait); | ||
964 | priv = qp->priv; | ||
965 | list_del_init(&priv->s_iowait.list); | ||
966 | priv->s_iowait.lock = NULL; | ||
967 | hfi1_qp_wakeup(qp, RVT_S_WAIT_PIO | HFI1_S_WAIT_PIO_DRAIN); | ||
968 | } | ||
969 | write_sequnlock(&sc->waitlock); | ||
970 | |||
955 | spin_unlock_irq(&sc->alloc_lock); | 971 | spin_unlock_irq(&sc->alloc_lock); |
956 | } | 972 | } |
957 | 973 | ||
@@ -1427,7 +1443,8 @@ void sc_stop(struct send_context *sc, int flag) | |||
1427 | * @cb: optional callback to call when the buffer is finished sending | 1443 | * @cb: optional callback to call when the buffer is finished sending |
1428 | * @arg: argument for cb | 1444 | * @arg: argument for cb |
1429 | * | 1445 | * |
1430 | * Return a pointer to a PIO buffer if successful, NULL if not enough room. | 1446 | * Return a pointer to a PIO buffer, NULL if not enough room, -ECOMM |
1447 | * when link is down. | ||
1431 | */ | 1448 | */ |
1432 | struct pio_buf *sc_buffer_alloc(struct send_context *sc, u32 dw_len, | 1449 | struct pio_buf *sc_buffer_alloc(struct send_context *sc, u32 dw_len, |
1433 | pio_release_cb cb, void *arg) | 1450 | pio_release_cb cb, void *arg) |
@@ -1443,7 +1460,7 @@ struct pio_buf *sc_buffer_alloc(struct send_context *sc, u32 dw_len, | |||
1443 | spin_lock_irqsave(&sc->alloc_lock, flags); | 1460 | spin_lock_irqsave(&sc->alloc_lock, flags); |
1444 | if (!(sc->flags & SCF_ENABLED)) { | 1461 | if (!(sc->flags & SCF_ENABLED)) { |
1445 | spin_unlock_irqrestore(&sc->alloc_lock, flags); | 1462 | spin_unlock_irqrestore(&sc->alloc_lock, flags); |
1446 | goto done; | 1463 | return ERR_PTR(-ECOMM); |
1447 | } | 1464 | } |
1448 | 1465 | ||
1449 | retry: | 1466 | retry: |
diff --git a/drivers/infiniband/hw/hfi1/rc.c b/drivers/infiniband/hw/hfi1/rc.c index 84b51cc36dbd..235bdbc706ac 100644 --- a/drivers/infiniband/hw/hfi1/rc.c +++ b/drivers/infiniband/hw/hfi1/rc.c | |||
@@ -1432,7 +1432,7 @@ void hfi1_send_rc_ack(struct hfi1_packet *packet, bool is_fecn) | |||
1432 | pbc = create_pbc(ppd, pbc_flags, qp->srate_mbps, | 1432 | pbc = create_pbc(ppd, pbc_flags, qp->srate_mbps, |
1433 | sc_to_vlt(ppd->dd, sc5), plen); | 1433 | sc_to_vlt(ppd->dd, sc5), plen); |
1434 | pbuf = sc_buffer_alloc(rcd->sc, plen, NULL, NULL); | 1434 | pbuf = sc_buffer_alloc(rcd->sc, plen, NULL, NULL); |
1435 | if (!pbuf) { | 1435 | if (IS_ERR_OR_NULL(pbuf)) { |
1436 | /* | 1436 | /* |
1437 | * We have no room to send at the moment. Pass | 1437 | * We have no room to send at the moment. Pass |
1438 | * responsibility for sending the ACK to the send engine | 1438 | * responsibility for sending the ACK to the send engine |
@@ -1701,6 +1701,36 @@ static void reset_sending_psn(struct rvt_qp *qp, u32 psn) | |||
1701 | } | 1701 | } |
1702 | } | 1702 | } |
1703 | 1703 | ||
1704 | /** | ||
1705 | * hfi1_rc_verbs_aborted - handle abort status | ||
1706 | * @qp: the QP | ||
1707 | * @opah: the opa header | ||
1708 | * | ||
1709 | * This code modifies both ACK bit in BTH[2] | ||
1710 | * and the s_flags to go into send one mode. | ||
1711 | * | ||
1712 | * This serves to throttle the send engine to only | ||
1713 | * send a single packet in the likely case the | ||
1714 | * a link has gone down. | ||
1715 | */ | ||
1716 | void hfi1_rc_verbs_aborted(struct rvt_qp *qp, struct hfi1_opa_header *opah) | ||
1717 | { | ||
1718 | struct ib_other_headers *ohdr = hfi1_get_rc_ohdr(opah); | ||
1719 | u8 opcode = ib_bth_get_opcode(ohdr); | ||
1720 | u32 psn; | ||
1721 | |||
1722 | /* ignore responses */ | ||
1723 | if ((opcode >= OP(RDMA_READ_RESPONSE_FIRST) && | ||
1724 | opcode <= OP(ATOMIC_ACKNOWLEDGE)) || | ||
1725 | opcode == TID_OP(READ_RESP) || | ||
1726 | opcode == TID_OP(WRITE_RESP)) | ||
1727 | return; | ||
1728 | |||
1729 | psn = ib_bth_get_psn(ohdr) | IB_BTH_REQ_ACK; | ||
1730 | ohdr->bth[2] = cpu_to_be32(psn); | ||
1731 | qp->s_flags |= RVT_S_SEND_ONE; | ||
1732 | } | ||
1733 | |||
1704 | /* | 1734 | /* |
1705 | * This should be called with the QP s_lock held and interrupts disabled. | 1735 | * This should be called with the QP s_lock held and interrupts disabled. |
1706 | */ | 1736 | */ |
@@ -1709,8 +1739,6 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_opa_header *opah) | |||
1709 | struct ib_other_headers *ohdr; | 1739 | struct ib_other_headers *ohdr; |
1710 | struct hfi1_qp_priv *priv = qp->priv; | 1740 | struct hfi1_qp_priv *priv = qp->priv; |
1711 | struct rvt_swqe *wqe; | 1741 | struct rvt_swqe *wqe; |
1712 | struct ib_header *hdr = NULL; | ||
1713 | struct hfi1_16b_header *hdr_16b = NULL; | ||
1714 | u32 opcode, head, tail; | 1742 | u32 opcode, head, tail; |
1715 | u32 psn; | 1743 | u32 psn; |
1716 | struct tid_rdma_request *req; | 1744 | struct tid_rdma_request *req; |
@@ -1719,24 +1747,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_opa_header *opah) | |||
1719 | if (!(ib_rvt_state_ops[qp->state] & RVT_SEND_OR_FLUSH_OR_RECV_OK)) | 1747 | if (!(ib_rvt_state_ops[qp->state] & RVT_SEND_OR_FLUSH_OR_RECV_OK)) |
1720 | return; | 1748 | return; |
1721 | 1749 | ||
1722 | /* Find out where the BTH is */ | 1750 | ohdr = hfi1_get_rc_ohdr(opah); |
1723 | if (priv->hdr_type == HFI1_PKT_TYPE_9B) { | ||
1724 | hdr = &opah->ibh; | ||
1725 | if (ib_get_lnh(hdr) == HFI1_LRH_BTH) | ||
1726 | ohdr = &hdr->u.oth; | ||
1727 | else | ||
1728 | ohdr = &hdr->u.l.oth; | ||
1729 | } else { | ||
1730 | u8 l4; | ||
1731 | |||
1732 | hdr_16b = &opah->opah; | ||
1733 | l4 = hfi1_16B_get_l4(hdr_16b); | ||
1734 | if (l4 == OPA_16B_L4_IB_LOCAL) | ||
1735 | ohdr = &hdr_16b->u.oth; | ||
1736 | else | ||
1737 | ohdr = &hdr_16b->u.l.oth; | ||
1738 | } | ||
1739 | |||
1740 | opcode = ib_bth_get_opcode(ohdr); | 1751 | opcode = ib_bth_get_opcode(ohdr); |
1741 | if ((opcode >= OP(RDMA_READ_RESPONSE_FIRST) && | 1752 | if ((opcode >= OP(RDMA_READ_RESPONSE_FIRST) && |
1742 | opcode <= OP(ATOMIC_ACKNOWLEDGE)) || | 1753 | opcode <= OP(ATOMIC_ACKNOWLEDGE)) || |
diff --git a/drivers/infiniband/hw/hfi1/sdma.c b/drivers/infiniband/hw/hfi1/sdma.c index b0110728f541..28b66bd70b74 100644 --- a/drivers/infiniband/hw/hfi1/sdma.c +++ b/drivers/infiniband/hw/hfi1/sdma.c | |||
@@ -405,19 +405,33 @@ static void sdma_flush(struct sdma_engine *sde) | |||
405 | struct sdma_txreq *txp, *txp_next; | 405 | struct sdma_txreq *txp, *txp_next; |
406 | LIST_HEAD(flushlist); | 406 | LIST_HEAD(flushlist); |
407 | unsigned long flags; | 407 | unsigned long flags; |
408 | uint seq; | ||
408 | 409 | ||
409 | /* flush from head to tail */ | 410 | /* flush from head to tail */ |
410 | sdma_flush_descq(sde); | 411 | sdma_flush_descq(sde); |
411 | spin_lock_irqsave(&sde->flushlist_lock, flags); | 412 | spin_lock_irqsave(&sde->flushlist_lock, flags); |
412 | /* copy flush list */ | 413 | /* copy flush list */ |
413 | list_for_each_entry_safe(txp, txp_next, &sde->flushlist, list) { | 414 | list_splice_init(&sde->flushlist, &flushlist); |
414 | list_del_init(&txp->list); | ||
415 | list_add_tail(&txp->list, &flushlist); | ||
416 | } | ||
417 | spin_unlock_irqrestore(&sde->flushlist_lock, flags); | 415 | spin_unlock_irqrestore(&sde->flushlist_lock, flags); |
418 | /* flush from flush list */ | 416 | /* flush from flush list */ |
419 | list_for_each_entry_safe(txp, txp_next, &flushlist, list) | 417 | list_for_each_entry_safe(txp, txp_next, &flushlist, list) |
420 | complete_tx(sde, txp, SDMA_TXREQ_S_ABORTED); | 418 | complete_tx(sde, txp, SDMA_TXREQ_S_ABORTED); |
419 | /* wakeup QPs orphaned on the dmawait list */ | ||
420 | do { | ||
421 | struct iowait *w, *nw; | ||
422 | |||
423 | seq = read_seqbegin(&sde->waitlock); | ||
424 | if (!list_empty(&sde->dmawait)) { | ||
425 | write_seqlock(&sde->waitlock); | ||
426 | list_for_each_entry_safe(w, nw, &sde->dmawait, list) { | ||
427 | if (w->wakeup) { | ||
428 | w->wakeup(w, SDMA_AVAIL_REASON); | ||
429 | list_del_init(&w->list); | ||
430 | } | ||
431 | } | ||
432 | write_sequnlock(&sde->waitlock); | ||
433 | } | ||
434 | } while (read_seqretry(&sde->waitlock, seq)); | ||
421 | } | 435 | } |
422 | 436 | ||
423 | /* | 437 | /* |
@@ -2413,7 +2427,7 @@ unlock_noconn: | |||
2413 | list_add_tail(&tx->list, &sde->flushlist); | 2427 | list_add_tail(&tx->list, &sde->flushlist); |
2414 | spin_unlock(&sde->flushlist_lock); | 2428 | spin_unlock(&sde->flushlist_lock); |
2415 | iowait_inc_wait_count(wait, tx->num_desc); | 2429 | iowait_inc_wait_count(wait, tx->num_desc); |
2416 | schedule_work(&sde->flush_worker); | 2430 | queue_work_on(sde->cpu, system_highpri_wq, &sde->flush_worker); |
2417 | ret = -ECOMM; | 2431 | ret = -ECOMM; |
2418 | goto unlock; | 2432 | goto unlock; |
2419 | nodesc: | 2433 | nodesc: |
@@ -2511,7 +2525,7 @@ unlock_noconn: | |||
2511 | iowait_inc_wait_count(wait, tx->num_desc); | 2525 | iowait_inc_wait_count(wait, tx->num_desc); |
2512 | } | 2526 | } |
2513 | spin_unlock(&sde->flushlist_lock); | 2527 | spin_unlock(&sde->flushlist_lock); |
2514 | schedule_work(&sde->flush_worker); | 2528 | queue_work_on(sde->cpu, system_highpri_wq, &sde->flush_worker); |
2515 | ret = -ECOMM; | 2529 | ret = -ECOMM; |
2516 | goto update_tail; | 2530 | goto update_tail; |
2517 | nodesc: | 2531 | nodesc: |
diff --git a/drivers/infiniband/hw/hfi1/tid_rdma.c b/drivers/infiniband/hw/hfi1/tid_rdma.c index 8f564b0a3333..92acccaaaa86 100644 --- a/drivers/infiniband/hw/hfi1/tid_rdma.c +++ b/drivers/infiniband/hw/hfi1/tid_rdma.c | |||
@@ -312,9 +312,7 @@ static struct hfi1_ctxtdata *qp_to_rcd(struct rvt_dev_info *rdi, | |||
312 | if (qp->ibqp.qp_num == 0) | 312 | if (qp->ibqp.qp_num == 0) |
313 | ctxt = 0; | 313 | ctxt = 0; |
314 | else | 314 | else |
315 | ctxt = ((qp->ibqp.qp_num >> dd->qos_shift) % | 315 | ctxt = hfi1_get_qp_map(dd, qp->ibqp.qp_num >> dd->qos_shift); |
316 | (dd->n_krcv_queues - 1)) + 1; | ||
317 | |||
318 | return dd->rcd[ctxt]; | 316 | return dd->rcd[ctxt]; |
319 | } | 317 | } |
320 | 318 | ||
diff --git a/drivers/infiniband/hw/hfi1/ud.c b/drivers/infiniband/hw/hfi1/ud.c index f88ad425664a..4cb0fce5c096 100644 --- a/drivers/infiniband/hw/hfi1/ud.c +++ b/drivers/infiniband/hw/hfi1/ud.c | |||
@@ -683,7 +683,7 @@ void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, | |||
683 | pbc = create_pbc(ppd, pbc_flags, qp->srate_mbps, vl, plen); | 683 | pbc = create_pbc(ppd, pbc_flags, qp->srate_mbps, vl, plen); |
684 | if (ctxt) { | 684 | if (ctxt) { |
685 | pbuf = sc_buffer_alloc(ctxt, plen, NULL, NULL); | 685 | pbuf = sc_buffer_alloc(ctxt, plen, NULL, NULL); |
686 | if (pbuf) { | 686 | if (!IS_ERR_OR_NULL(pbuf)) { |
687 | trace_pio_output_ibhdr(ppd->dd, &hdr, sc5); | 687 | trace_pio_output_ibhdr(ppd->dd, &hdr, sc5); |
688 | ppd->dd->pio_inline_send(ppd->dd, pbuf, pbc, | 688 | ppd->dd->pio_inline_send(ppd->dd, pbuf, pbc, |
689 | &hdr, hwords); | 689 | &hdr, hwords); |
@@ -738,7 +738,7 @@ void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, | |||
738 | pbc = create_pbc(ppd, pbc_flags, qp->srate_mbps, vl, plen); | 738 | pbc = create_pbc(ppd, pbc_flags, qp->srate_mbps, vl, plen); |
739 | if (ctxt) { | 739 | if (ctxt) { |
740 | pbuf = sc_buffer_alloc(ctxt, plen, NULL, NULL); | 740 | pbuf = sc_buffer_alloc(ctxt, plen, NULL, NULL); |
741 | if (pbuf) { | 741 | if (!IS_ERR_OR_NULL(pbuf)) { |
742 | trace_pio_output_ibhdr(ppd->dd, &hdr, sc5); | 742 | trace_pio_output_ibhdr(ppd->dd, &hdr, sc5); |
743 | ppd->dd->pio_inline_send(ppd->dd, pbuf, pbc, | 743 | ppd->dd->pio_inline_send(ppd->dd, pbuf, pbc, |
744 | &hdr, hwords); | 744 | &hdr, hwords); |
diff --git a/drivers/infiniband/hw/hfi1/user_exp_rcv.c b/drivers/infiniband/hw/hfi1/user_exp_rcv.c index 0cd71ce7cc71..3592a9ec155e 100644 --- a/drivers/infiniband/hw/hfi1/user_exp_rcv.c +++ b/drivers/infiniband/hw/hfi1/user_exp_rcv.c | |||
@@ -324,6 +324,9 @@ int hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd, | |||
324 | u32 *tidlist = NULL; | 324 | u32 *tidlist = NULL; |
325 | struct tid_user_buf *tidbuf; | 325 | struct tid_user_buf *tidbuf; |
326 | 326 | ||
327 | if (!PAGE_ALIGNED(tinfo->vaddr)) | ||
328 | return -EINVAL; | ||
329 | |||
327 | tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL); | 330 | tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL); |
328 | if (!tidbuf) | 331 | if (!tidbuf) |
329 | return -ENOMEM; | 332 | return -ENOMEM; |
diff --git a/drivers/infiniband/hw/hfi1/user_sdma.c b/drivers/infiniband/hw/hfi1/user_sdma.c index 8bfbc6d7ea34..fd754a16475a 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.c +++ b/drivers/infiniband/hw/hfi1/user_sdma.c | |||
@@ -130,20 +130,16 @@ static int defer_packet_queue( | |||
130 | { | 130 | { |
131 | struct hfi1_user_sdma_pkt_q *pq = | 131 | struct hfi1_user_sdma_pkt_q *pq = |
132 | container_of(wait->iow, struct hfi1_user_sdma_pkt_q, busy); | 132 | container_of(wait->iow, struct hfi1_user_sdma_pkt_q, busy); |
133 | struct user_sdma_txreq *tx = | ||
134 | container_of(txreq, struct user_sdma_txreq, txreq); | ||
135 | 133 | ||
136 | if (sdma_progress(sde, seq, txreq)) { | 134 | write_seqlock(&sde->waitlock); |
137 | if (tx->busycount++ < MAX_DEFER_RETRY_COUNT) | 135 | if (sdma_progress(sde, seq, txreq)) |
138 | goto eagain; | 136 | goto eagain; |
139 | } | ||
140 | /* | 137 | /* |
141 | * We are assuming that if the list is enqueued somewhere, it | 138 | * We are assuming that if the list is enqueued somewhere, it |
142 | * is to the dmawait list since that is the only place where | 139 | * is to the dmawait list since that is the only place where |
143 | * it is supposed to be enqueued. | 140 | * it is supposed to be enqueued. |
144 | */ | 141 | */ |
145 | xchg(&pq->state, SDMA_PKT_Q_DEFERRED); | 142 | xchg(&pq->state, SDMA_PKT_Q_DEFERRED); |
146 | write_seqlock(&sde->waitlock); | ||
147 | if (list_empty(&pq->busy.list)) { | 143 | if (list_empty(&pq->busy.list)) { |
148 | iowait_get_priority(&pq->busy); | 144 | iowait_get_priority(&pq->busy); |
149 | iowait_queue(pkts_sent, &pq->busy, &sde->dmawait); | 145 | iowait_queue(pkts_sent, &pq->busy, &sde->dmawait); |
@@ -151,6 +147,7 @@ static int defer_packet_queue( | |||
151 | write_sequnlock(&sde->waitlock); | 147 | write_sequnlock(&sde->waitlock); |
152 | return -EBUSY; | 148 | return -EBUSY; |
153 | eagain: | 149 | eagain: |
150 | write_sequnlock(&sde->waitlock); | ||
154 | return -EAGAIN; | 151 | return -EAGAIN; |
155 | } | 152 | } |
156 | 153 | ||
@@ -804,7 +801,6 @@ static int user_sdma_send_pkts(struct user_sdma_request *req, u16 maxpkts) | |||
804 | 801 | ||
805 | tx->flags = 0; | 802 | tx->flags = 0; |
806 | tx->req = req; | 803 | tx->req = req; |
807 | tx->busycount = 0; | ||
808 | INIT_LIST_HEAD(&tx->list); | 804 | INIT_LIST_HEAD(&tx->list); |
809 | 805 | ||
810 | /* | 806 | /* |
diff --git a/drivers/infiniband/hw/hfi1/user_sdma.h b/drivers/infiniband/hw/hfi1/user_sdma.h index 14dfd757dafd..4d8510b0fc38 100644 --- a/drivers/infiniband/hw/hfi1/user_sdma.h +++ b/drivers/infiniband/hw/hfi1/user_sdma.h | |||
@@ -245,7 +245,6 @@ struct user_sdma_txreq { | |||
245 | struct list_head list; | 245 | struct list_head list; |
246 | struct user_sdma_request *req; | 246 | struct user_sdma_request *req; |
247 | u16 flags; | 247 | u16 flags; |
248 | unsigned int busycount; | ||
249 | u16 seqnum; | 248 | u16 seqnum; |
250 | }; | 249 | }; |
251 | 250 | ||
diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c index 1f36db98240f..c4b243f50c76 100644 --- a/drivers/infiniband/hw/hfi1/verbs.c +++ b/drivers/infiniband/hw/hfi1/verbs.c | |||
@@ -638,6 +638,8 @@ static void verbs_sdma_complete( | |||
638 | struct hfi1_opa_header *hdr; | 638 | struct hfi1_opa_header *hdr; |
639 | 639 | ||
640 | hdr = &tx->phdr.hdr; | 640 | hdr = &tx->phdr.hdr; |
641 | if (unlikely(status == SDMA_TXREQ_S_ABORTED)) | ||
642 | hfi1_rc_verbs_aborted(qp, hdr); | ||
641 | hfi1_rc_send_complete(qp, hdr); | 643 | hfi1_rc_send_complete(qp, hdr); |
642 | } | 644 | } |
643 | spin_unlock(&qp->s_lock); | 645 | spin_unlock(&qp->s_lock); |
@@ -1037,10 +1039,10 @@ int hfi1_verbs_send_pio(struct rvt_qp *qp, struct hfi1_pkt_state *ps, | |||
1037 | if (cb) | 1039 | if (cb) |
1038 | iowait_pio_inc(&priv->s_iowait); | 1040 | iowait_pio_inc(&priv->s_iowait); |
1039 | pbuf = sc_buffer_alloc(sc, plen, cb, qp); | 1041 | pbuf = sc_buffer_alloc(sc, plen, cb, qp); |
1040 | if (unlikely(!pbuf)) { | 1042 | if (unlikely(IS_ERR_OR_NULL(pbuf))) { |
1041 | if (cb) | 1043 | if (cb) |
1042 | verbs_pio_complete(qp, 0); | 1044 | verbs_pio_complete(qp, 0); |
1043 | if (ppd->host_link_state != HLS_UP_ACTIVE) { | 1045 | if (IS_ERR(pbuf)) { |
1044 | /* | 1046 | /* |
1045 | * If we have filled the PIO buffers to capacity and are | 1047 | * If we have filled the PIO buffers to capacity and are |
1046 | * not in an active state this request is not going to | 1048 | * not in an active state this request is not going to |
@@ -1095,15 +1097,15 @@ int hfi1_verbs_send_pio(struct rvt_qp *qp, struct hfi1_pkt_state *ps, | |||
1095 | &ps->s_txreq->phdr.hdr, ib_is_sc5(sc5)); | 1097 | &ps->s_txreq->phdr.hdr, ib_is_sc5(sc5)); |
1096 | 1098 | ||
1097 | pio_bail: | 1099 | pio_bail: |
1100 | spin_lock_irqsave(&qp->s_lock, flags); | ||
1098 | if (qp->s_wqe) { | 1101 | if (qp->s_wqe) { |
1099 | spin_lock_irqsave(&qp->s_lock, flags); | ||
1100 | rvt_send_complete(qp, qp->s_wqe, wc_status); | 1102 | rvt_send_complete(qp, qp->s_wqe, wc_status); |
1101 | spin_unlock_irqrestore(&qp->s_lock, flags); | ||
1102 | } else if (qp->ibqp.qp_type == IB_QPT_RC) { | 1103 | } else if (qp->ibqp.qp_type == IB_QPT_RC) { |
1103 | spin_lock_irqsave(&qp->s_lock, flags); | 1104 | if (unlikely(wc_status == IB_WC_GENERAL_ERR)) |
1105 | hfi1_rc_verbs_aborted(qp, &ps->s_txreq->phdr.hdr); | ||
1104 | hfi1_rc_send_complete(qp, &ps->s_txreq->phdr.hdr); | 1106 | hfi1_rc_send_complete(qp, &ps->s_txreq->phdr.hdr); |
1105 | spin_unlock_irqrestore(&qp->s_lock, flags); | ||
1106 | } | 1107 | } |
1108 | spin_unlock_irqrestore(&qp->s_lock, flags); | ||
1107 | 1109 | ||
1108 | ret = 0; | 1110 | ret = 0; |
1109 | 1111 | ||
@@ -1356,8 +1358,6 @@ static void hfi1_fill_device_attr(struct hfi1_devdata *dd) | |||
1356 | rdi->dparms.props.max_cq = hfi1_max_cqs; | 1358 | rdi->dparms.props.max_cq = hfi1_max_cqs; |
1357 | rdi->dparms.props.max_ah = hfi1_max_ahs; | 1359 | rdi->dparms.props.max_ah = hfi1_max_ahs; |
1358 | rdi->dparms.props.max_cqe = hfi1_max_cqes; | 1360 | rdi->dparms.props.max_cqe = hfi1_max_cqes; |
1359 | rdi->dparms.props.max_mr = rdi->lkey_table.max; | ||
1360 | rdi->dparms.props.max_fmr = rdi->lkey_table.max; | ||
1361 | rdi->dparms.props.max_map_per_fmr = 32767; | 1361 | rdi->dparms.props.max_map_per_fmr = 32767; |
1362 | rdi->dparms.props.max_pd = hfi1_max_pds; | 1362 | rdi->dparms.props.max_pd = hfi1_max_pds; |
1363 | rdi->dparms.props.max_qp_rd_atom = HFI1_MAX_RDMA_ATOMIC; | 1363 | rdi->dparms.props.max_qp_rd_atom = HFI1_MAX_RDMA_ATOMIC; |
diff --git a/drivers/infiniband/hw/hfi1/verbs.h b/drivers/infiniband/hw/hfi1/verbs.h index 7ecb8ed4a1d9..ae9582ddbc8f 100644 --- a/drivers/infiniband/hw/hfi1/verbs.h +++ b/drivers/infiniband/hw/hfi1/verbs.h | |||
@@ -416,6 +416,7 @@ void hfi1_rc_hdrerr( | |||
416 | 416 | ||
417 | u8 ah_to_sc(struct ib_device *ibdev, struct rdma_ah_attr *ah_attr); | 417 | u8 ah_to_sc(struct ib_device *ibdev, struct rdma_ah_attr *ah_attr); |
418 | 418 | ||
419 | void hfi1_rc_verbs_aborted(struct rvt_qp *qp, struct hfi1_opa_header *opah); | ||
419 | void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_opa_header *opah); | 420 | void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_opa_header *opah); |
420 | 421 | ||
421 | void hfi1_ud_rcv(struct hfi1_packet *packet); | 422 | void hfi1_ud_rcv(struct hfi1_packet *packet); |
diff --git a/drivers/infiniband/hw/hfi1/verbs_txreq.c b/drivers/infiniband/hw/hfi1/verbs_txreq.c index c4ab2d5b4502..8f766dd3f61c 100644 --- a/drivers/infiniband/hw/hfi1/verbs_txreq.c +++ b/drivers/infiniband/hw/hfi1/verbs_txreq.c | |||
@@ -100,7 +100,7 @@ struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev, | |||
100 | if (ib_rvt_state_ops[qp->state] & RVT_PROCESS_RECV_OK) { | 100 | if (ib_rvt_state_ops[qp->state] & RVT_PROCESS_RECV_OK) { |
101 | struct hfi1_qp_priv *priv; | 101 | struct hfi1_qp_priv *priv; |
102 | 102 | ||
103 | tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC); | 103 | tx = kmem_cache_alloc(dev->verbs_txreq_cache, VERBS_TXREQ_GFP); |
104 | if (tx) | 104 | if (tx) |
105 | goto out; | 105 | goto out; |
106 | priv = qp->priv; | 106 | priv = qp->priv; |
diff --git a/drivers/infiniband/hw/hfi1/verbs_txreq.h b/drivers/infiniband/hw/hfi1/verbs_txreq.h index b002e96eb335..bfa6e081cb56 100644 --- a/drivers/infiniband/hw/hfi1/verbs_txreq.h +++ b/drivers/infiniband/hw/hfi1/verbs_txreq.h | |||
@@ -72,6 +72,7 @@ struct hfi1_ibdev; | |||
72 | struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev, | 72 | struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev, |
73 | struct rvt_qp *qp); | 73 | struct rvt_qp *qp); |
74 | 74 | ||
75 | #define VERBS_TXREQ_GFP (GFP_ATOMIC | __GFP_NOWARN) | ||
75 | static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev, | 76 | static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev, |
76 | struct rvt_qp *qp) | 77 | struct rvt_qp *qp) |
77 | __must_hold(&qp->slock) | 78 | __must_hold(&qp->slock) |
@@ -79,7 +80,7 @@ static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev, | |||
79 | struct verbs_txreq *tx; | 80 | struct verbs_txreq *tx; |
80 | struct hfi1_qp_priv *priv = qp->priv; | 81 | struct hfi1_qp_priv *priv = qp->priv; |
81 | 82 | ||
82 | tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC); | 83 | tx = kmem_cache_alloc(dev->verbs_txreq_cache, VERBS_TXREQ_GFP); |
83 | if (unlikely(!tx)) { | 84 | if (unlikely(!tx)) { |
84 | /* call slow path to get the lock */ | 85 | /* call slow path to get the lock */ |
85 | tx = __get_txreq(dev, qp); | 86 | tx = __get_txreq(dev, qp); |
diff --git a/drivers/infiniband/hw/hns/Kconfig b/drivers/infiniband/hw/hns/Kconfig index b548c003009b..8bf847bcd8d3 100644 --- a/drivers/infiniband/hw/hns/Kconfig +++ b/drivers/infiniband/hw/hns/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_HNS | 2 | config INFINIBAND_HNS |
2 | tristate "HNS RoCE Driver" | 3 | tristate "HNS RoCE Driver" |
3 | depends on NET_VENDOR_HISILICON | 4 | depends on NET_VENDOR_HISILICON |
diff --git a/drivers/infiniband/hw/hns/Makefile b/drivers/infiniband/hw/hns/Makefile index b956cf430bdb..1c5a20af6992 100644 --- a/drivers/infiniband/hw/hns/Makefile +++ b/drivers/infiniband/hw/hns/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | # | 2 | # |
2 | # Makefile for the Hisilicon RoCE drivers. | 3 | # Makefile for the Hisilicon RoCE drivers. |
3 | # | 4 | # |
diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c index 2c0bc2536fda..056a6873df7a 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c | |||
@@ -902,6 +902,7 @@ static void hns_roce_v1_release_lp_qp(struct hns_roce_dev *hr_dev) | |||
902 | hns_roce_ib_destroy_cq(&free_mr->mr_free_cq->ib_cq, NULL); | 902 | hns_roce_ib_destroy_cq(&free_mr->mr_free_cq->ib_cq, NULL); |
903 | kfree(&free_mr->mr_free_cq->ib_cq); | 903 | kfree(&free_mr->mr_free_cq->ib_cq); |
904 | hns_roce_dealloc_pd(&free_mr->mr_free_pd->ibpd, NULL); | 904 | hns_roce_dealloc_pd(&free_mr->mr_free_pd->ibpd, NULL); |
905 | kfree(&free_mr->mr_free_pd->ibpd); | ||
905 | } | 906 | } |
906 | 907 | ||
907 | static int hns_roce_db_init(struct hns_roce_dev *hr_dev) | 908 | static int hns_roce_db_init(struct hns_roce_dev *hr_dev) |
diff --git a/drivers/infiniband/hw/i40iw/Kconfig b/drivers/infiniband/hw/i40iw/Kconfig index d867ef1ac72a..e4b45f4cd8f8 100644 --- a/drivers/infiniband/hw/i40iw/Kconfig +++ b/drivers/infiniband/hw/i40iw/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_I40IW | 2 | config INFINIBAND_I40IW |
2 | tristate "Intel(R) Ethernet X722 iWARP Driver" | 3 | tristate "Intel(R) Ethernet X722 iWARP Driver" |
3 | depends on INET && I40E | 4 | depends on INET && I40E |
diff --git a/drivers/infiniband/hw/mlx4/Kconfig b/drivers/infiniband/hw/mlx4/Kconfig index fc01deac1d3c..cc7c42fe6499 100644 --- a/drivers/infiniband/hw/mlx4/Kconfig +++ b/drivers/infiniband/hw/mlx4/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config MLX4_INFINIBAND | 2 | config MLX4_INFINIBAND |
2 | tristate "Mellanox ConnectX HCA support" | 3 | tristate "Mellanox ConnectX HCA support" |
3 | depends on NETDEVICES && ETHERNET && PCI && INET | 4 | depends on NETDEVICES && ETHERNET && PCI && INET |
diff --git a/drivers/infiniband/hw/mlx4/Makefile b/drivers/infiniband/hw/mlx4/Makefile index f4213b3a8fe1..7b6757b02857 100644 --- a/drivers/infiniband/hw/mlx4/Makefile +++ b/drivers/infiniband/hw/mlx4/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | obj-$(CONFIG_MLX4_INFINIBAND) += mlx4_ib.o | 2 | obj-$(CONFIG_MLX4_INFINIBAND) += mlx4_ib.o |
2 | 3 | ||
3 | mlx4_ib-y := ah.o cq.o doorbell.o mad.o main.o mr.o qp.o srq.o mcg.o cm.o alias_GUID.o sysfs.o | 4 | mlx4_ib-y := ah.o cq.o doorbell.o mad.o main.o mr.o qp.o srq.o mcg.o cm.o alias_GUID.o sysfs.o |
diff --git a/drivers/infiniband/hw/mlx5/Kconfig b/drivers/infiniband/hw/mlx5/Kconfig index 8d651c05de62..ea248def4556 100644 --- a/drivers/infiniband/hw/mlx5/Kconfig +++ b/drivers/infiniband/hw/mlx5/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config MLX5_INFINIBAND | 2 | config MLX5_INFINIBAND |
2 | tristate "Mellanox 5th generation network adapters (ConnectX series) support" | 3 | tristate "Mellanox 5th generation network adapters (ConnectX series) support" |
3 | depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE | 4 | depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE |
diff --git a/drivers/infiniband/hw/mlx5/Makefile b/drivers/infiniband/hw/mlx5/Makefile index 33f5adb14e4e..9924be8384d8 100644 --- a/drivers/infiniband/hw/mlx5/Makefile +++ b/drivers/infiniband/hw/mlx5/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | obj-$(CONFIG_MLX5_INFINIBAND) += mlx5_ib.o | 2 | obj-$(CONFIG_MLX5_INFINIBAND) += mlx5_ib.o |
2 | 3 | ||
3 | mlx5_ib-y := main.o cq.o doorbell.o qp.o mem.o srq_cmd.o \ | 4 | mlx5_ib-y := main.o cq.o doorbell.o qp.o mem.o srq_cmd.o \ |
diff --git a/drivers/infiniband/hw/mlx5/cmd.c b/drivers/infiniband/hw/mlx5/cmd.c index e3ec79b8f7f5..6c8645033102 100644 --- a/drivers/infiniband/hw/mlx5/cmd.c +++ b/drivers/infiniband/hw/mlx5/cmd.c | |||
@@ -190,12 +190,12 @@ int mlx5_cmd_alloc_sw_icm(struct mlx5_dm *dm, int type, u64 length, | |||
190 | u16 uid, phys_addr_t *addr, u32 *obj_id) | 190 | u16 uid, phys_addr_t *addr, u32 *obj_id) |
191 | { | 191 | { |
192 | struct mlx5_core_dev *dev = dm->dev; | 192 | struct mlx5_core_dev *dev = dm->dev; |
193 | u32 num_blocks = DIV_ROUND_UP(length, MLX5_SW_ICM_BLOCK_SIZE(dev)); | ||
194 | u32 out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)] = {}; | 193 | u32 out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)] = {}; |
195 | u32 in[MLX5_ST_SZ_DW(create_sw_icm_in)] = {}; | 194 | u32 in[MLX5_ST_SZ_DW(create_sw_icm_in)] = {}; |
196 | unsigned long *block_map; | 195 | unsigned long *block_map; |
197 | u64 icm_start_addr; | 196 | u64 icm_start_addr; |
198 | u32 log_icm_size; | 197 | u32 log_icm_size; |
198 | u32 num_blocks; | ||
199 | u32 max_blocks; | 199 | u32 max_blocks; |
200 | u64 block_idx; | 200 | u64 block_idx; |
201 | void *sw_icm; | 201 | void *sw_icm; |
@@ -224,6 +224,8 @@ int mlx5_cmd_alloc_sw_icm(struct mlx5_dm *dm, int type, u64 length, | |||
224 | return -EINVAL; | 224 | return -EINVAL; |
225 | } | 225 | } |
226 | 226 | ||
227 | num_blocks = (length + MLX5_SW_ICM_BLOCK_SIZE(dev) - 1) >> | ||
228 | MLX5_LOG_SW_ICM_BLOCK_SIZE(dev); | ||
227 | max_blocks = BIT(log_icm_size - MLX5_LOG_SW_ICM_BLOCK_SIZE(dev)); | 229 | max_blocks = BIT(log_icm_size - MLX5_LOG_SW_ICM_BLOCK_SIZE(dev)); |
228 | spin_lock(&dm->lock); | 230 | spin_lock(&dm->lock); |
229 | block_idx = bitmap_find_next_zero_area(block_map, | 231 | block_idx = bitmap_find_next_zero_area(block_map, |
@@ -266,13 +268,16 @@ int mlx5_cmd_dealloc_sw_icm(struct mlx5_dm *dm, int type, u64 length, | |||
266 | u16 uid, phys_addr_t addr, u32 obj_id) | 268 | u16 uid, phys_addr_t addr, u32 obj_id) |
267 | { | 269 | { |
268 | struct mlx5_core_dev *dev = dm->dev; | 270 | struct mlx5_core_dev *dev = dm->dev; |
269 | u32 num_blocks = DIV_ROUND_UP(length, MLX5_SW_ICM_BLOCK_SIZE(dev)); | ||
270 | u32 out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)] = {}; | 271 | u32 out[MLX5_ST_SZ_DW(general_obj_out_cmd_hdr)] = {}; |
271 | u32 in[MLX5_ST_SZ_DW(general_obj_in_cmd_hdr)] = {}; | 272 | u32 in[MLX5_ST_SZ_DW(general_obj_in_cmd_hdr)] = {}; |
272 | unsigned long *block_map; | 273 | unsigned long *block_map; |
274 | u32 num_blocks; | ||
273 | u64 start_idx; | 275 | u64 start_idx; |
274 | int err; | 276 | int err; |
275 | 277 | ||
278 | num_blocks = (length + MLX5_SW_ICM_BLOCK_SIZE(dev) - 1) >> | ||
279 | MLX5_LOG_SW_ICM_BLOCK_SIZE(dev); | ||
280 | |||
276 | switch (type) { | 281 | switch (type) { |
277 | case MLX5_IB_UAPI_DM_TYPE_STEERING_SW_ICM: | 282 | case MLX5_IB_UAPI_DM_TYPE_STEERING_SW_ICM: |
278 | start_idx = | 283 | start_idx = |
diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c index 22e651cb5534..aa9acebfcc23 100644 --- a/drivers/infiniband/hw/mlx5/ib_rep.c +++ b/drivers/infiniband/hw/mlx5/ib_rep.c | |||
@@ -110,15 +110,15 @@ u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw) | |||
110 | } | 110 | } |
111 | 111 | ||
112 | struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, | 112 | struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, |
113 | int vport_index) | 113 | u16 vport_num) |
114 | { | 114 | { |
115 | return mlx5_eswitch_get_proto_dev(esw, vport_index, REP_IB); | 115 | return mlx5_eswitch_get_proto_dev(esw, vport_num, REP_IB); |
116 | } | 116 | } |
117 | 117 | ||
118 | struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, | 118 | struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, |
119 | int vport_index) | 119 | u16 vport_num) |
120 | { | 120 | { |
121 | return mlx5_eswitch_get_proto_dev(esw, vport_index, REP_ETH); | 121 | return mlx5_eswitch_get_proto_dev(esw, vport_num, REP_ETH); |
122 | } | 122 | } |
123 | 123 | ||
124 | struct mlx5_ib_dev *mlx5_ib_get_uplink_ibdev(struct mlx5_eswitch *esw) | 124 | struct mlx5_ib_dev *mlx5_ib_get_uplink_ibdev(struct mlx5_eswitch *esw) |
@@ -126,9 +126,10 @@ struct mlx5_ib_dev *mlx5_ib_get_uplink_ibdev(struct mlx5_eswitch *esw) | |||
126 | return mlx5_eswitch_uplink_get_proto_dev(esw, REP_IB); | 126 | return mlx5_eswitch_uplink_get_proto_dev(esw, REP_IB); |
127 | } | 127 | } |
128 | 128 | ||
129 | struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, int vport) | 129 | struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, |
130 | u16 vport_num) | ||
130 | { | 131 | { |
131 | return mlx5_eswitch_vport_rep(esw, vport); | 132 | return mlx5_eswitch_vport_rep(esw, vport_num); |
132 | } | 133 | } |
133 | 134 | ||
134 | struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, | 135 | struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, |
diff --git a/drivers/infiniband/hw/mlx5/ib_rep.h b/drivers/infiniband/hw/mlx5/ib_rep.h index 22adce2d6795..7a917e6d5c09 100644 --- a/drivers/infiniband/hw/mlx5/ib_rep.h +++ b/drivers/infiniband/hw/mlx5/ib_rep.h | |||
@@ -14,17 +14,17 @@ extern const struct mlx5_ib_profile uplink_rep_profile; | |||
14 | 14 | ||
15 | u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw); | 15 | u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw); |
16 | struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, | 16 | struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, |
17 | int vport_index); | 17 | u16 vport_num); |
18 | struct mlx5_ib_dev *mlx5_ib_get_uplink_ibdev(struct mlx5_eswitch *esw); | 18 | struct mlx5_ib_dev *mlx5_ib_get_uplink_ibdev(struct mlx5_eswitch *esw); |
19 | struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, | 19 | struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, |
20 | int vport_index); | 20 | u16 vport_num); |
21 | void mlx5_ib_register_vport_reps(struct mlx5_core_dev *mdev); | 21 | void mlx5_ib_register_vport_reps(struct mlx5_core_dev *mdev); |
22 | void mlx5_ib_unregister_vport_reps(struct mlx5_core_dev *mdev); | 22 | void mlx5_ib_unregister_vport_reps(struct mlx5_core_dev *mdev); |
23 | struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, | 23 | struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, |
24 | struct mlx5_ib_sq *sq, | 24 | struct mlx5_ib_sq *sq, |
25 | u16 port); | 25 | u16 port); |
26 | struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, | 26 | struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, |
27 | int vport_index); | 27 | u16 vport_num); |
28 | #else /* CONFIG_MLX5_ESWITCH */ | 28 | #else /* CONFIG_MLX5_ESWITCH */ |
29 | static inline u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw) | 29 | static inline u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw) |
30 | { | 30 | { |
@@ -33,7 +33,7 @@ static inline u8 mlx5_ib_eswitch_mode(struct mlx5_eswitch *esw) | |||
33 | 33 | ||
34 | static inline | 34 | static inline |
35 | struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, | 35 | struct mlx5_ib_dev *mlx5_ib_get_rep_ibdev(struct mlx5_eswitch *esw, |
36 | int vport_index) | 36 | u16 vport_num) |
37 | { | 37 | { |
38 | return NULL; | 38 | return NULL; |
39 | } | 39 | } |
@@ -46,7 +46,7 @@ struct mlx5_ib_dev *mlx5_ib_get_uplink_ibdev(struct mlx5_eswitch *esw) | |||
46 | 46 | ||
47 | static inline | 47 | static inline |
48 | struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, | 48 | struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, |
49 | int vport_index) | 49 | u16 vport_num) |
50 | { | 50 | { |
51 | return NULL; | 51 | return NULL; |
52 | } | 52 | } |
@@ -63,7 +63,7 @@ struct mlx5_flow_handle *create_flow_rule_vport_sq(struct mlx5_ib_dev *dev, | |||
63 | 63 | ||
64 | static inline | 64 | static inline |
65 | struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, | 65 | struct net_device *mlx5_ib_get_rep_netdev(struct mlx5_eswitch *esw, |
66 | int vport_index) | 66 | u16 vport_num) |
67 | { | 67 | { |
68 | return NULL; | 68 | return NULL; |
69 | } | 69 | } |
diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 9aa10cfbc064..05d2bfcb3d60 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c | |||
@@ -2347,7 +2347,7 @@ static int handle_alloc_dm_sw_icm(struct ib_ucontext *ctx, | |||
2347 | /* Allocation size must a multiple of the basic block size | 2347 | /* Allocation size must a multiple of the basic block size |
2348 | * and a power of 2. | 2348 | * and a power of 2. |
2349 | */ | 2349 | */ |
2350 | act_size = roundup(attr->length, MLX5_SW_ICM_BLOCK_SIZE(dm_db->dev)); | 2350 | act_size = round_up(attr->length, MLX5_SW_ICM_BLOCK_SIZE(dm_db->dev)); |
2351 | act_size = roundup_pow_of_two(act_size); | 2351 | act_size = roundup_pow_of_two(act_size); |
2352 | 2352 | ||
2353 | dm->size = act_size; | 2353 | dm->size = act_size; |
diff --git a/drivers/infiniband/hw/mthca/Kconfig b/drivers/infiniband/hw/mthca/Kconfig index da314c3fec23..66ff527f5928 100644 --- a/drivers/infiniband/hw/mthca/Kconfig +++ b/drivers/infiniband/hw/mthca/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_MTHCA | 2 | config INFINIBAND_MTHCA |
2 | tristate "Mellanox HCA support" | 3 | tristate "Mellanox HCA support" |
3 | depends on PCI | 4 | depends on PCI |
diff --git a/drivers/infiniband/hw/ocrdma/Kconfig b/drivers/infiniband/hw/ocrdma/Kconfig index c0cddc0192d1..dd4ec388208c 100644 --- a/drivers/infiniband/hw/ocrdma/Kconfig +++ b/drivers/infiniband/hw/ocrdma/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_OCRDMA | 2 | config INFINIBAND_OCRDMA |
2 | tristate "Emulex One Connect HCA support" | 3 | tristate "Emulex One Connect HCA support" |
3 | depends on ETHERNET && NETDEVICES && PCI && INET && (IPV6 || IPV6=n) | 4 | depends on ETHERNET && NETDEVICES && PCI && INET && (IPV6 || IPV6=n) |
diff --git a/drivers/infiniband/hw/ocrdma/Makefile b/drivers/infiniband/hw/ocrdma/Makefile index e3f20ca15462..14fba95021d8 100644 --- a/drivers/infiniband/hw/ocrdma/Makefile +++ b/drivers/infiniband/hw/ocrdma/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | ccflags-y := -I $(srctree)/drivers/net/ethernet/emulex/benet | 2 | ccflags-y := -I $(srctree)/drivers/net/ethernet/emulex/benet |
2 | 3 | ||
3 | obj-$(CONFIG_INFINIBAND_OCRDMA) += ocrdma.o | 4 | obj-$(CONFIG_INFINIBAND_OCRDMA) += ocrdma.o |
diff --git a/drivers/infiniband/hw/qedr/Kconfig b/drivers/infiniband/hw/qedr/Kconfig index 9b9e3b1d2705..9c30325e1414 100644 --- a/drivers/infiniband/hw/qedr/Kconfig +++ b/drivers/infiniband/hw/qedr/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_QEDR | 2 | config INFINIBAND_QEDR |
2 | tristate "QLogic RoCE driver" | 3 | tristate "QLogic RoCE driver" |
3 | depends on 64BIT && QEDE | 4 | depends on 64BIT && QEDE |
diff --git a/drivers/infiniband/hw/qedr/Makefile b/drivers/infiniband/hw/qedr/Makefile index 1c0bc4f78550..c75679837a85 100644 --- a/drivers/infiniband/hw/qedr/Makefile +++ b/drivers/infiniband/hw/qedr/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | obj-$(CONFIG_INFINIBAND_QEDR) := qedr.o | 2 | obj-$(CONFIG_INFINIBAND_QEDR) := qedr.o |
2 | 3 | ||
3 | qedr-y := main.o verbs.o qedr_roce_cm.o qedr_iw_cm.o | 4 | qedr-y := main.o verbs.o qedr_roce_cm.o qedr_iw_cm.o |
diff --git a/drivers/infiniband/hw/qib/Kconfig b/drivers/infiniband/hw/qib/Kconfig index cb06314a2ae2..376d19f29346 100644 --- a/drivers/infiniband/hw/qib/Kconfig +++ b/drivers/infiniband/hw/qib/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_QIB | 2 | config INFINIBAND_QIB |
2 | tristate "Intel PCIe HCA support" | 3 | tristate "Intel PCIe HCA support" |
3 | depends on 64BIT && INFINIBAND_RDMAVT | 4 | depends on 64BIT && INFINIBAND_RDMAVT |
diff --git a/drivers/infiniband/hw/qib/qib_verbs.c b/drivers/infiniband/hw/qib/qib_verbs.c index 54310fd6c7b6..33778d451b82 100644 --- a/drivers/infiniband/hw/qib/qib_verbs.c +++ b/drivers/infiniband/hw/qib/qib_verbs.c | |||
@@ -1459,8 +1459,6 @@ static void qib_fill_device_attr(struct qib_devdata *dd) | |||
1459 | rdi->dparms.props.max_cq = ib_qib_max_cqs; | 1459 | rdi->dparms.props.max_cq = ib_qib_max_cqs; |
1460 | rdi->dparms.props.max_cqe = ib_qib_max_cqes; | 1460 | rdi->dparms.props.max_cqe = ib_qib_max_cqes; |
1461 | rdi->dparms.props.max_ah = ib_qib_max_ahs; | 1461 | rdi->dparms.props.max_ah = ib_qib_max_ahs; |
1462 | rdi->dparms.props.max_mr = rdi->lkey_table.max; | ||
1463 | rdi->dparms.props.max_fmr = rdi->lkey_table.max; | ||
1464 | rdi->dparms.props.max_map_per_fmr = 32767; | 1462 | rdi->dparms.props.max_map_per_fmr = 32767; |
1465 | rdi->dparms.props.max_qp_rd_atom = QIB_MAX_RDMA_ATOMIC; | 1463 | rdi->dparms.props.max_qp_rd_atom = QIB_MAX_RDMA_ATOMIC; |
1466 | rdi->dparms.props.max_qp_init_rd_atom = 255; | 1464 | rdi->dparms.props.max_qp_init_rd_atom = 255; |
diff --git a/drivers/infiniband/hw/usnic/Kconfig b/drivers/infiniband/hw/usnic/Kconfig index d1dae2af4ca9..c0847d9e2539 100644 --- a/drivers/infiniband/hw/usnic/Kconfig +++ b/drivers/infiniband/hw/usnic/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_USNIC | 2 | config INFINIBAND_USNIC |
2 | tristate "Verbs support for Cisco VIC" | 3 | tristate "Verbs support for Cisco VIC" |
3 | depends on NETDEVICES && ETHERNET && INET && PCI && INTEL_IOMMU | 4 | depends on NETDEVICES && ETHERNET && INET && PCI && INTEL_IOMMU |
diff --git a/drivers/infiniband/hw/vmw_pvrdma/Kconfig b/drivers/infiniband/hw/vmw_pvrdma/Kconfig index 5a9790ac0ede..b99c9f0fc06a 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/Kconfig +++ b/drivers/infiniband/hw/vmw_pvrdma/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_VMWARE_PVRDMA | 2 | config INFINIBAND_VMWARE_PVRDMA |
2 | tristate "VMware Paravirtualized RDMA Driver" | 3 | tristate "VMware Paravirtualized RDMA Driver" |
3 | depends on NETDEVICES && ETHERNET && PCI && INET && VMXNET3 | 4 | depends on NETDEVICES && ETHERNET && PCI && INET && VMXNET3 |
diff --git a/drivers/infiniband/hw/vmw_pvrdma/Makefile b/drivers/infiniband/hw/vmw_pvrdma/Makefile index 2f52e0a044a0..0f5fa4e8cfd0 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/Makefile +++ b/drivers/infiniband/hw/vmw_pvrdma/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | obj-$(CONFIG_INFINIBAND_VMWARE_PVRDMA) += vmw_pvrdma.o | 2 | obj-$(CONFIG_INFINIBAND_VMWARE_PVRDMA) += vmw_pvrdma.o |
2 | 3 | ||
3 | vmw_pvrdma-y := pvrdma_cmd.o pvrdma_cq.o pvrdma_doorbell.o pvrdma_main.o pvrdma_misc.o pvrdma_mr.o pvrdma_qp.o pvrdma_srq.o pvrdma_verbs.o | 4 | vmw_pvrdma-y := pvrdma_cmd.o pvrdma_cq.o pvrdma_doorbell.o pvrdma_main.o pvrdma_misc.o pvrdma_mr.o pvrdma_qp.o pvrdma_srq.o pvrdma_verbs.o |
diff --git a/drivers/infiniband/sw/Makefile b/drivers/infiniband/sw/Makefile index 8b095b27db87..ab48a9b60844 100644 --- a/drivers/infiniband/sw/Makefile +++ b/drivers/infiniband/sw/Makefile | |||
@@ -1,2 +1,3 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | obj-$(CONFIG_INFINIBAND_RDMAVT) += rdmavt/ | 2 | obj-$(CONFIG_INFINIBAND_RDMAVT) += rdmavt/ |
2 | obj-$(CONFIG_RDMA_RXE) += rxe/ | 3 | obj-$(CONFIG_RDMA_RXE) += rxe/ |
diff --git a/drivers/infiniband/sw/rdmavt/Kconfig b/drivers/infiniband/sw/rdmavt/Kconfig index 7df896a18d38..1f2759c72108 100644 --- a/drivers/infiniband/sw/rdmavt/Kconfig +++ b/drivers/infiniband/sw/rdmavt/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_RDMAVT | 2 | config INFINIBAND_RDMAVT |
2 | tristate "RDMA verbs transport library" | 3 | tristate "RDMA verbs transport library" |
3 | depends on X86_64 && ARCH_DMA_ADDR_T_64BIT | 4 | depends on X86_64 && ARCH_DMA_ADDR_T_64BIT |
diff --git a/drivers/infiniband/sw/rdmavt/Makefile b/drivers/infiniband/sw/rdmavt/Makefile index 78b276a90401..b21962dafcc9 100644 --- a/drivers/infiniband/sw/rdmavt/Makefile +++ b/drivers/infiniband/sw/rdmavt/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | # | 2 | # |
2 | # rdmavt driver | 3 | # rdmavt driver |
3 | # | 4 | # |
diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c index db800eb2b1f5..0867a11d074e 100644 --- a/drivers/infiniband/sw/rdmavt/mr.c +++ b/drivers/infiniband/sw/rdmavt/mr.c | |||
@@ -96,6 +96,8 @@ int rvt_driver_mr_init(struct rvt_dev_info *rdi) | |||
96 | for (i = 0; i < rdi->lkey_table.max; i++) | 96 | for (i = 0; i < rdi->lkey_table.max; i++) |
97 | RCU_INIT_POINTER(rdi->lkey_table.table[i], NULL); | 97 | RCU_INIT_POINTER(rdi->lkey_table.table[i], NULL); |
98 | 98 | ||
99 | rdi->dparms.props.max_mr = rdi->lkey_table.max; | ||
100 | rdi->dparms.props.max_fmr = rdi->lkey_table.max; | ||
99 | return 0; | 101 | return 0; |
100 | } | 102 | } |
101 | 103 | ||
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c index dfbc7d8640fb..0d804a58f954 100644 --- a/drivers/infiniband/sw/rdmavt/qp.c +++ b/drivers/infiniband/sw/rdmavt/qp.c | |||
@@ -594,7 +594,8 @@ static int alloc_qpn(struct rvt_dev_info *rdi, struct rvt_qpn_table *qpt, | |||
594 | offset = qpt->incr | ((offset & 1) ^ 1); | 594 | offset = qpt->incr | ((offset & 1) ^ 1); |
595 | } | 595 | } |
596 | /* there can be no set bits in low-order QoS bits */ | 596 | /* there can be no set bits in low-order QoS bits */ |
597 | WARN_ON(offset & (BIT(rdi->dparms.qos_shift) - 1)); | 597 | WARN_ON(rdi->dparms.qos_shift > 1 && |
598 | offset & ((BIT(rdi->dparms.qos_shift - 1) - 1) << 1)); | ||
598 | qpn = mk_qpn(qpt, map, offset); | 599 | qpn = mk_qpn(qpt, map, offset); |
599 | } | 600 | } |
600 | 601 | ||
diff --git a/drivers/infiniband/sw/rxe/Kconfig b/drivers/infiniband/sw/rxe/Kconfig index 67ae960ab523..d9bcfe740588 100644 --- a/drivers/infiniband/sw/rxe/Kconfig +++ b/drivers/infiniband/sw/rxe/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config RDMA_RXE | 2 | config RDMA_RXE |
2 | tristate "Software RDMA over Ethernet (RoCE) driver" | 3 | tristate "Software RDMA over Ethernet (RoCE) driver" |
3 | depends on INET && PCI && INFINIBAND | 4 | depends on INET && PCI && INFINIBAND |
diff --git a/drivers/infiniband/ulp/ipoib/Kconfig b/drivers/infiniband/ulp/ipoib/Kconfig index 569d614d0c41..7af68604af77 100644 --- a/drivers/infiniband/ulp/ipoib/Kconfig +++ b/drivers/infiniband/ulp/ipoib/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_IPOIB | 2 | config INFINIBAND_IPOIB |
2 | tristate "IP-over-InfiniBand" | 3 | tristate "IP-over-InfiniBand" |
3 | depends on NETDEVICES && INET && (IPV6 || IPV6=n) | 4 | depends on NETDEVICES && INET && (IPV6 || IPV6=n) |
diff --git a/drivers/infiniband/ulp/iser/Kconfig b/drivers/infiniband/ulp/iser/Kconfig index 299268f261ee..1d29dffeaff9 100644 --- a/drivers/infiniband/ulp/iser/Kconfig +++ b/drivers/infiniband/ulp/iser/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_ISER | 2 | config INFINIBAND_ISER |
2 | tristate "iSCSI Extensions for RDMA (iSER)" | 3 | tristate "iSCSI Extensions for RDMA (iSER)" |
3 | depends on SCSI && INET && INFINIBAND_ADDR_TRANS | 4 | depends on SCSI && INET && INFINIBAND_ADDR_TRANS |
diff --git a/drivers/infiniband/ulp/iser/Makefile b/drivers/infiniband/ulp/iser/Makefile index fe6cd15f2317..2f3e788638d4 100644 --- a/drivers/infiniband/ulp/iser/Makefile +++ b/drivers/infiniband/ulp/iser/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | obj-$(CONFIG_INFINIBAND_ISER) += ib_iser.o | 2 | obj-$(CONFIG_INFINIBAND_ISER) += ib_iser.o |
2 | 3 | ||
3 | ib_iser-y := iser_verbs.o iser_initiator.o iser_memory.o \ | 4 | ib_iser-y := iser_verbs.o iser_initiator.o iser_memory.o \ |
diff --git a/drivers/infiniband/ulp/isert/Kconfig b/drivers/infiniband/ulp/isert/Kconfig index 02f9759ebb1a..1a3f5ca8354c 100644 --- a/drivers/infiniband/ulp/isert/Kconfig +++ b/drivers/infiniband/ulp/isert/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_ISERT | 2 | config INFINIBAND_ISERT |
2 | tristate "iSCSI Extensions for RDMA (iSER) target support" | 3 | tristate "iSCSI Extensions for RDMA (iSER) target support" |
3 | depends on INET && INFINIBAND_ADDR_TRANS && TARGET_CORE && ISCSI_TARGET | 4 | depends on INET && INFINIBAND_ADDR_TRANS && TARGET_CORE && ISCSI_TARGET |
diff --git a/drivers/infiniband/ulp/isert/Makefile b/drivers/infiniband/ulp/isert/Makefile index a4a4766e3e18..e19b16cafda7 100644 --- a/drivers/infiniband/ulp/isert/Makefile +++ b/drivers/infiniband/ulp/isert/Makefile | |||
@@ -1 +1,2 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | obj-$(CONFIG_INFINIBAND_ISERT) += ib_isert.o | 2 | obj-$(CONFIG_INFINIBAND_ISERT) += ib_isert.o |
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 4b4998e888b9..a1a035270cab 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
1 | /******************************************************************************* | 2 | /******************************************************************************* |
2 | * This file contains iSCSI extentions for RDMA (iSER) Verbs | 3 | * This file contains iSCSI extentions for RDMA (iSER) Verbs |
3 | * | 4 | * |
@@ -5,15 +6,6 @@ | |||
5 | * | 6 | * |
6 | * Nicholas A. Bellinger <nab@linux-iscsi.org> | 7 | * Nicholas A. Bellinger <nab@linux-iscsi.org> |
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | ****************************************************************************/ | 9 | ****************************************************************************/ |
18 | 10 | ||
19 | #include <linux/string.h> | 11 | #include <linux/string.h> |
diff --git a/drivers/infiniband/ulp/opa_vnic/Kconfig b/drivers/infiniband/ulp/opa_vnic/Kconfig index 48132ab5e6b9..a1f266b9c0b2 100644 --- a/drivers/infiniband/ulp/opa_vnic/Kconfig +++ b/drivers/infiniband/ulp/opa_vnic/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_OPA_VNIC | 2 | config INFINIBAND_OPA_VNIC |
2 | tristate "Intel OPA VNIC support" | 3 | tristate "Intel OPA VNIC support" |
3 | depends on X86_64 && INFINIBAND | 4 | depends on X86_64 && INFINIBAND |
diff --git a/drivers/infiniband/ulp/opa_vnic/Makefile b/drivers/infiniband/ulp/opa_vnic/Makefile index 8061b287cfe4..a8c21d140ccb 100644 --- a/drivers/infiniband/ulp/opa_vnic/Makefile +++ b/drivers/infiniband/ulp/opa_vnic/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | # Makefile - Intel Omni-Path Virtual Network Controller driver | 2 | # Makefile - Intel Omni-Path Virtual Network Controller driver |
2 | # Copyright(c) 2017, Intel Corporation. | 3 | # Copyright(c) 2017, Intel Corporation. |
3 | # | 4 | # |
diff --git a/drivers/infiniband/ulp/srp/Kbuild b/drivers/infiniband/ulp/srp/Kbuild index a16c73c667cb..d1f4e513b6a9 100644 --- a/drivers/infiniband/ulp/srp/Kbuild +++ b/drivers/infiniband/ulp/srp/Kbuild | |||
@@ -1 +1,2 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0 | ||
1 | obj-$(CONFIG_INFINIBAND_SRP) += ib_srp.o | 2 | obj-$(CONFIG_INFINIBAND_SRP) += ib_srp.o |
diff --git a/drivers/infiniband/ulp/srp/Kconfig b/drivers/infiniband/ulp/srp/Kconfig index 99db8fe5173a..6f5e7b3a3864 100644 --- a/drivers/infiniband/ulp/srp/Kconfig +++ b/drivers/infiniband/ulp/srp/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_SRP | 2 | config INFINIBAND_SRP |
2 | tristate "InfiniBand SCSI RDMA Protocol" | 3 | tristate "InfiniBand SCSI RDMA Protocol" |
3 | depends on SCSI && INFINIBAND_ADDR_TRANS | 4 | depends on SCSI && INFINIBAND_ADDR_TRANS |
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 87848faa7502..0b09d0cd9b3c 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -148,6 +148,7 @@ MODULE_PARM_DESC(ch_count, | |||
148 | 148 | ||
149 | static void srp_add_one(struct ib_device *device); | 149 | static void srp_add_one(struct ib_device *device); |
150 | static void srp_remove_one(struct ib_device *device, void *client_data); | 150 | static void srp_remove_one(struct ib_device *device, void *client_data); |
151 | static void srp_rename_dev(struct ib_device *device, void *client_data); | ||
151 | static void srp_recv_done(struct ib_cq *cq, struct ib_wc *wc); | 152 | static void srp_recv_done(struct ib_cq *cq, struct ib_wc *wc); |
152 | static void srp_handle_qp_err(struct ib_cq *cq, struct ib_wc *wc, | 153 | static void srp_handle_qp_err(struct ib_cq *cq, struct ib_wc *wc, |
153 | const char *opname); | 154 | const char *opname); |
@@ -162,7 +163,8 @@ static struct workqueue_struct *srp_remove_wq; | |||
162 | static struct ib_client srp_client = { | 163 | static struct ib_client srp_client = { |
163 | .name = "srp", | 164 | .name = "srp", |
164 | .add = srp_add_one, | 165 | .add = srp_add_one, |
165 | .remove = srp_remove_one | 166 | .remove = srp_remove_one, |
167 | .rename = srp_rename_dev | ||
166 | }; | 168 | }; |
167 | 169 | ||
168 | static struct ib_sa_client srp_sa_client; | 170 | static struct ib_sa_client srp_sa_client; |
@@ -4121,6 +4123,20 @@ free_host: | |||
4121 | return NULL; | 4123 | return NULL; |
4122 | } | 4124 | } |
4123 | 4125 | ||
4126 | static void srp_rename_dev(struct ib_device *device, void *client_data) | ||
4127 | { | ||
4128 | struct srp_device *srp_dev = client_data; | ||
4129 | struct srp_host *host, *tmp_host; | ||
4130 | |||
4131 | list_for_each_entry_safe(host, tmp_host, &srp_dev->dev_list, list) { | ||
4132 | char name[IB_DEVICE_NAME_MAX + 8]; | ||
4133 | |||
4134 | snprintf(name, sizeof(name), "srp-%s-%d", | ||
4135 | dev_name(&device->dev), host->port); | ||
4136 | device_rename(&host->dev, name); | ||
4137 | } | ||
4138 | } | ||
4139 | |||
4124 | static void srp_add_one(struct ib_device *device) | 4140 | static void srp_add_one(struct ib_device *device) |
4125 | { | 4141 | { |
4126 | struct srp_device *srp_dev; | 4142 | struct srp_device *srp_dev; |
diff --git a/drivers/infiniband/ulp/srpt/Kconfig b/drivers/infiniband/ulp/srpt/Kconfig index fb8b7182f05e..ce7567cea9f6 100644 --- a/drivers/infiniband/ulp/srpt/Kconfig +++ b/drivers/infiniband/ulp/srpt/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | config INFINIBAND_SRPT | 2 | config INFINIBAND_SRPT |
2 | tristate "InfiniBand SCSI RDMA Protocol target support" | 3 | tristate "InfiniBand SCSI RDMA Protocol target support" |
3 | depends on INFINIBAND && INFINIBAND_ADDR_TRANS && TARGET_CORE | 4 | depends on INFINIBAND && INFINIBAND_ADDR_TRANS && TARGET_CORE |
diff --git a/drivers/infiniband/ulp/srpt/Makefile b/drivers/infiniband/ulp/srpt/Makefile index 43fbde42c58b..2d137928a4c2 100644 --- a/drivers/infiniband/ulp/srpt/Makefile +++ b/drivers/infiniband/ulp/srpt/Makefile | |||
@@ -1 +1,2 @@ | |||
1 | # SPDX-License-Identifier: GPL-2.0-only | ||
1 | obj-$(CONFIG_INFINIBAND_SRPT) += ib_srpt.o | 2 | obj-$(CONFIG_INFINIBAND_SRPT) += ib_srpt.o |