Skip to content

Commit 780d8ce

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: "Small collection of incremental improvement patches: - Minor code cleanup patches, comment improvements, etc from static tools - Clean the some of the kernel caps, reducing the historical stealth uAPI leftovers - Bug fixes and minor changes for rdmavt, hns, rxe, irdma - Remove unimplemented cruft from rxe - Reorganize UMR QP code in mlx5 to avoid going through the IB verbs layer - flush_workqueue(system_unbound_wq) removal - Ensure rxe waits for objects to be unused before allowing the core to free them - Several rc quality bug fixes for hfi1" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (67 commits) RDMA/rtrs-clt: Fix one kernel-doc comment RDMA/hfi1: Remove all traces of diagpkt support RDMA/hfi1: Consolidate software versions RDMA/hfi1: Remove pointless driver version RDMA/hfi1: Fix potential integer multiplication overflow errors RDMA/hfi1: Prevent panic when SDMA is disabled RDMA/hfi1: Prevent use of lock before it is initialized RDMA/rxe: Fix an error handling path in rxe_get_mcg() IB/core: Fix typo in comment RDMA/core: Fix typo in comment IB/hf1: Fix typo in comment IB/qib: Fix typo in comment IB/iser: Fix typo in comment RDMA/mlx4: Avoid flush_scheduled_work() usage IB/isert: Avoid flush_scheduled_work() usage RDMA/mlx5: Remove duplicate pointer assignment in mlx5_ib_alloc_implicit_mr() RDMA/qedr: Remove unnecessary synchronize_irq() before free_irq() RDMA/hns: Use hr_reg_read() instead of remaining roce_get_xxx() RDMA/hns: Use hr_reg_xxx() instead of remaining roce_set_xxx() RDMA/irdma: Add SW mechanism to generate completions on error ...
2 parents 090b39a + 9c47717 commit 780d8ce

Some content is hidden

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

88 files changed

+1968
-2002
lines changed

drivers/infiniband/core/device.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ struct workqueue_struct *ib_comp_wq;
5858
struct workqueue_struct *ib_comp_unbound_wq;
5959
struct workqueue_struct *ib_wq;
6060
EXPORT_SYMBOL_GPL(ib_wq);
61+
static struct workqueue_struct *ib_unreg_wq;
6162

6263
/*
6364
* Each of the three rwsem locks (devices, clients, client_data) protects the
@@ -1602,7 +1603,7 @@ void ib_unregister_device_queued(struct ib_device *ib_dev)
16021603
WARN_ON(!refcount_read(&ib_dev->refcount));
16031604
WARN_ON(!ib_dev->ops.dealloc_driver);
16041605
get_device(&ib_dev->dev);
1605-
if (!queue_work(system_unbound_wq, &ib_dev->unregistration_work))
1606+
if (!queue_work(ib_unreg_wq, &ib_dev->unregistration_work))
16061607
put_device(&ib_dev->dev);
16071608
}
16081609
EXPORT_SYMBOL(ib_unregister_device_queued);
@@ -2751,27 +2752,28 @@ static const struct rdma_nl_cbs ibnl_ls_cb_table[RDMA_NL_LS_NUM_OPS] = {
27512752

27522753
static int __init ib_core_init(void)
27532754
{
2754-
int ret;
2755+
int ret = -ENOMEM;
27552756

27562757
ib_wq = alloc_workqueue("infiniband", 0, 0);
27572758
if (!ib_wq)
27582759
return -ENOMEM;
27592760

2761+
ib_unreg_wq = alloc_workqueue("ib-unreg-wq", WQ_UNBOUND,
2762+
WQ_UNBOUND_MAX_ACTIVE);
2763+
if (!ib_unreg_wq)
2764+
goto err;
2765+
27602766
ib_comp_wq = alloc_workqueue("ib-comp-wq",
27612767
WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
2762-
if (!ib_comp_wq) {
2763-
ret = -ENOMEM;
2764-
goto err;
2765-
}
2768+
if (!ib_comp_wq)
2769+
goto err_unbound;
27662770

27672771
ib_comp_unbound_wq =
27682772
alloc_workqueue("ib-comp-unb-wq",
27692773
WQ_UNBOUND | WQ_HIGHPRI | WQ_MEM_RECLAIM |
27702774
WQ_SYSFS, WQ_UNBOUND_MAX_ACTIVE);
2771-
if (!ib_comp_unbound_wq) {
2772-
ret = -ENOMEM;
2775+
if (!ib_comp_unbound_wq)
27732776
goto err_comp;
2774-
}
27752777

27762778
ret = class_register(&ib_class);
27772779
if (ret) {
@@ -2831,6 +2833,8 @@ static int __init ib_core_init(void)
28312833
destroy_workqueue(ib_comp_unbound_wq);
28322834
err_comp:
28332835
destroy_workqueue(ib_comp_wq);
2836+
err_unbound:
2837+
destroy_workqueue(ib_unreg_wq);
28342838
err:
28352839
destroy_workqueue(ib_wq);
28362840
return ret;
@@ -2852,7 +2856,7 @@ static void __exit ib_core_cleanup(void)
28522856
destroy_workqueue(ib_comp_wq);
28532857
/* Make sure that any pending umem accounting work is done. */
28542858
destroy_workqueue(ib_wq);
2855-
flush_workqueue(system_unbound_wq);
2859+
destroy_workqueue(ib_unreg_wq);
28562860
WARN_ON(!xa_empty(&clients));
28572861
WARN_ON(!xa_empty(&devices));
28582862
}

drivers/infiniband/core/nldev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ static int nldev_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
17391739
if (!device)
17401740
return -EINVAL;
17411741

1742-
if (!(device->attrs.device_cap_flags & IB_DEVICE_ALLOW_USER_UNREG)) {
1742+
if (!(device->attrs.kernel_cap_flags & IBK_ALLOW_USER_UNREG)) {
17431743
ib_device_put(device);
17441744
return -EINVAL;
17451745
}

drivers/infiniband/core/sa_query.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,31 +1034,31 @@ int ib_nl_handle_resolve_resp(struct sk_buff *skb,
10341034
struct netlink_ext_ack *extack)
10351035
{
10361036
unsigned long flags;
1037-
struct ib_sa_query *query;
1037+
struct ib_sa_query *query = NULL, *iter;
10381038
struct ib_mad_send_buf *send_buf;
10391039
struct ib_mad_send_wc mad_send_wc;
1040-
int found = 0;
10411040
int ret;
10421041

10431042
if ((nlh->nlmsg_flags & NLM_F_REQUEST) ||
10441043
!(NETLINK_CB(skb).sk))
10451044
return -EPERM;
10461045

10471046
spin_lock_irqsave(&ib_nl_request_lock, flags);
1048-
list_for_each_entry(query, &ib_nl_request_list, list) {
1047+
list_for_each_entry(iter, &ib_nl_request_list, list) {
10491048
/*
10501049
* If the query is cancelled, let the timeout routine
10511050
* take care of it.
10521051
*/
1053-
if (nlh->nlmsg_seq == query->seq) {
1054-
found = !ib_sa_query_cancelled(query);
1055-
if (found)
1056-
list_del(&query->list);
1052+
if (nlh->nlmsg_seq == iter->seq) {
1053+
if (!ib_sa_query_cancelled(iter)) {
1054+
list_del(&iter->list);
1055+
query = iter;
1056+
}
10571057
break;
10581058
}
10591059
}
10601060

1061-
if (!found) {
1061+
if (!query) {
10621062
spin_unlock_irqrestore(&ib_nl_request_lock, flags);
10631063
goto resp_out;
10641064
}

drivers/infiniband/core/umem_odp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ int ib_umem_odp_map_dma_and_lock(struct ib_umem_odp *umem_odp, u64 user_virt,
455455
break;
456456
}
457457
}
458-
/* upon sucesss lock should stay on hold for the callee */
458+
/* upon success lock should stay on hold for the callee */
459459
if (!ret)
460460
ret = dma_index - start_idx;
461461
else

drivers/infiniband/core/uverbs_cmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static void copy_query_dev_fields(struct ib_ucontext *ucontext,
337337
resp->hw_ver = attr->hw_ver;
338338
resp->max_qp = attr->max_qp;
339339
resp->max_qp_wr = attr->max_qp_wr;
340-
resp->device_cap_flags = lower_32_bits(attr->device_cap_flags);
340+
resp->device_cap_flags = lower_32_bits(attr->device_cap_flags);
341341
resp->max_sge = min(attr->max_send_sge, attr->max_recv_sge);
342342
resp->max_sge_rd = attr->max_sge_rd;
343343
resp->max_cq = attr->max_cq;

drivers/infiniband/core/verbs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ struct ib_pd *__ib_alloc_pd(struct ib_device *device, unsigned int flags,
281281
}
282282
rdma_restrack_add(&pd->res);
283283

284-
if (device->attrs.device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY)
284+
if (device->attrs.kernel_cap_flags & IBK_LOCAL_DMA_LKEY)
285285
pd->local_dma_lkey = device->local_dma_lkey;
286286
else
287287
mr_access_flags |= IB_ACCESS_LOCAL_WRITE;
@@ -308,7 +308,7 @@ struct ib_pd *__ib_alloc_pd(struct ib_device *device, unsigned int flags,
308308

309309
pd->__internal_mr = mr;
310310

311-
if (!(device->attrs.device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY))
311+
if (!(device->attrs.kernel_cap_flags & IBK_LOCAL_DMA_LKEY))
312312
pd->local_dma_lkey = pd->__internal_mr->lkey;
313313

314314
if (flags & IB_PD_UNSAFE_GLOBAL_RKEY)
@@ -2131,8 +2131,8 @@ struct ib_mr *ib_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
21312131
struct ib_mr *mr;
21322132

21332133
if (access_flags & IB_ACCESS_ON_DEMAND) {
2134-
if (!(pd->device->attrs.device_cap_flags &
2135-
IB_DEVICE_ON_DEMAND_PAGING)) {
2134+
if (!(pd->device->attrs.kernel_cap_flags &
2135+
IBK_ON_DEMAND_PAGING)) {
21362136
pr_debug("ODP support not available\n");
21372137
return ERR_PTR(-EINVAL);
21382138
}

drivers/infiniband/hw/bnxt_re/ib_verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ int bnxt_re_query_device(struct ib_device *ibdev,
146146
| IB_DEVICE_RC_RNR_NAK_GEN
147147
| IB_DEVICE_SHUTDOWN_PORT
148148
| IB_DEVICE_SYS_IMAGE_GUID
149-
| IB_DEVICE_LOCAL_DMA_LKEY
150149
| IB_DEVICE_RESIZE_MAX_WR
151150
| IB_DEVICE_PORT_ACTIVE_EVENT
152151
| IB_DEVICE_N_NOTIFY_CQ
153152
| IB_DEVICE_MEM_WINDOW
154153
| IB_DEVICE_MEM_WINDOW_TYPE_2B
155154
| IB_DEVICE_MEM_MGT_EXTENSIONS;
155+
ib_attr->kernel_cap_flags = IBK_LOCAL_DMA_LKEY;
156156
ib_attr->max_send_sge = dev_attr->max_qp_sges;
157157
ib_attr->max_recv_sge = dev_attr->max_qp_sges;
158158
ib_attr->max_sge_rd = dev_attr->max_qp_sges;

drivers/infiniband/hw/cxgb4/iw_cxgb4.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ enum db_state {
314314
struct c4iw_dev {
315315
struct ib_device ibdev;
316316
struct c4iw_rdev rdev;
317-
u32 device_cap_flags;
318317
struct xarray cqs;
319318
struct xarray qps;
320319
struct xarray mrs;

drivers/infiniband/hw/cxgb4/provider.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,10 @@ static int c4iw_query_device(struct ib_device *ibdev, struct ib_device_attr *pro
269269
dev->rdev.lldi.ports[0]->dev_addr);
270270
props->hw_ver = CHELSIO_CHIP_RELEASE(dev->rdev.lldi.adapter_type);
271271
props->fw_ver = dev->rdev.lldi.fw_vers;
272-
props->device_cap_flags = dev->device_cap_flags;
272+
props->device_cap_flags = IB_DEVICE_MEM_WINDOW;
273+
props->kernel_cap_flags = IBK_LOCAL_DMA_LKEY;
274+
if (fastreg_support)
275+
props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
273276
props->page_size_cap = T4_PAGESIZE_MASK;
274277
props->vendor_id = (u32)dev->rdev.lldi.pdev->vendor;
275278
props->vendor_part_id = (u32)dev->rdev.lldi.pdev->device;
@@ -529,9 +532,6 @@ void c4iw_register_device(struct work_struct *work)
529532
pr_debug("c4iw_dev %p\n", dev);
530533
addrconf_addr_eui48((u8 *)&dev->ibdev.node_guid,
531534
dev->rdev.lldi.ports[0]->dev_addr);
532-
dev->device_cap_flags = IB_DEVICE_LOCAL_DMA_LKEY | IB_DEVICE_MEM_WINDOW;
533-
if (fastreg_support)
534-
dev->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
535535
dev->ibdev.local_dma_lkey = 0;
536536
dev->ibdev.node_type = RDMA_NODE_RNIC;
537537
BUILD_BUG_ON(sizeof(C4IW_NODE_DESC) > IB_DEVICE_NODE_DESC_MAX);

drivers/infiniband/hw/hfi1/common.h

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -137,61 +137,6 @@
137137
#define HFI1_USER_SWVERSION ((HFI1_USER_SWMAJOR << HFI1_SWMAJOR_SHIFT) | \
138138
HFI1_USER_SWMINOR)
139139

140-
#ifndef HFI1_KERN_TYPE
141-
#define HFI1_KERN_TYPE 0
142-
#endif
143-
144-
/*
145-
* Similarly, this is the kernel version going back to the user. It's
146-
* slightly different, in that we want to tell if the driver was built as
147-
* part of a Intel release, or from the driver from openfabrics.org,
148-
* kernel.org, or a standard distribution, for support reasons.
149-
* The high bit is 0 for non-Intel and 1 for Intel-built/supplied.
150-
*
151-
* It's returned by the driver to the user code during initialization in the
152-
* spi_sw_version field of hfi1_base_info, so the user code can in turn
153-
* check for compatibility with the kernel.
154-
*/
155-
#define HFI1_KERN_SWVERSION ((HFI1_KERN_TYPE << 31) | HFI1_USER_SWVERSION)
156-
157-
/*
158-
* Define the driver version number. This is something that refers only
159-
* to the driver itself, not the software interfaces it supports.
160-
*/
161-
#ifndef HFI1_DRIVER_VERSION_BASE
162-
#define HFI1_DRIVER_VERSION_BASE "0.9-294"
163-
#endif
164-
165-
/* create the final driver version string */
166-
#ifdef HFI1_IDSTR
167-
#define HFI1_DRIVER_VERSION HFI1_DRIVER_VERSION_BASE " " HFI1_IDSTR
168-
#else
169-
#define HFI1_DRIVER_VERSION HFI1_DRIVER_VERSION_BASE
170-
#endif
171-
172-
/*
173-
* Diagnostics can send a packet by writing the following
174-
* struct to the diag packet special file.
175-
*
176-
* This allows a custom PBC qword, so that special modes and deliberate
177-
* changes to CRCs can be used.
178-
*/
179-
#define _DIAG_PKT_VERS 1
180-
struct diag_pkt {
181-
__u16 version; /* structure version */
182-
__u16 unit; /* which device */
183-
__u16 sw_index; /* send sw index to use */
184-
__u16 len; /* data length, in bytes */
185-
__u16 port; /* port number */
186-
__u16 unused;
187-
__u32 flags; /* call flags */
188-
__u64 data; /* user data pointer */
189-
__u64 pbc; /* PBC for the packet */
190-
};
191-
192-
/* diag_pkt flags */
193-
#define F_DIAGPKT_WAIT 0x1 /* wait until packet is sent */
194-
195140
/*
196141
* The next set of defines are for packet headers, and chip register
197142
* and memory bits that are visible to and/or used by user-mode software.

0 commit comments

Comments
 (0)