Skip to content

Commit 54d7e81

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: "Usual collection of small improvements and fixes, nothing especially stands out to me here. The new multipath PCI feature is a sign of things to come, I think we will see more of this in the next 10 years. Broadcom and HNS continue to update their drivers for their new HW generations. Summary: - Bug fixes and minor improvments in cxgb4, siw, mlx5, rxe, efa, rts, hfi, erdma, hns, irdma - Code cleanups/typos/etc. Tidy alloc_ordered_workqueue() calls - Multipath PCI for mlx5 - Variable size work queue, SRQ changes, and relaxed ordering for new bnxt HW - New ODP fault resolution FW protocol in mlx5 - New 'rdma monitor' netlink mechanism" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (99 commits) RDMA/bnxt_re: Remove the unused variable en_dev RDMA/nldev: Add missing break in rdma_nl_notify_err_msg() RDMA/irdma: fix error message in irdma_modify_qp_roce() RDMA/cxgb4: Added NULL check for lookup_atid RDMA/hns: Fix ah error counter in sw stat not increasing RDMA/bnxt_re: Recover the device when FW error is detected RDMA/bnxt_re: Group all operations under add_device and remove_device RDMA/bnxt_re: Use the aux device for L2 ULP callbacks RDMA/bnxt_re: Change aux driver data to en_info to hold more information RDMA/nldev: Expose whether RDMA monitoring is supported RDMA/nldev: Add support for RDMA monitoring RDMA/mlx5: Use IB set_netdev and get_netdev functions RDMA/device: Remove optimization in ib_device_get_netdev() RDMA/mlx5: Initialize phys_port_cnt earlier in RDMA device creation RDMA/mlx5: Obtain upper net device only when needed RDMA/mlx5: Check RoCE LAG status before getting netdev RDMA/mlx5: Consider the query_vuid cap for data_direct net/mlx5: Handle memory scheme ODP capabilities RDMA/mlx5: Add implicit MR handling to ODP memory scheme RDMA/mlx5: Add handling for memory scheme page fault events ...
2 parents 6fa6588 + 7092094 commit 54d7e81

Some content is hidden

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

83 files changed

+2796
-896
lines changed

drivers/infiniband/core/cache.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1640,8 +1640,10 @@ int ib_cache_setup_one(struct ib_device *device)
16401640

16411641
rdma_for_each_port (device, p) {
16421642
err = ib_cache_update(device, p, true, true, true);
1643-
if (err)
1643+
if (err) {
1644+
gid_table_cleanup_one(device);
16441645
return err;
1646+
}
16451647
}
16461648

16471649
return 0;

drivers/infiniband/core/core_priv.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,6 @@ void ib_qp_usecnt_inc(struct ib_qp *qp);
325325
void ib_qp_usecnt_dec(struct ib_qp *qp);
326326

327327
struct rdma_dev_addr;
328-
int rdma_resolve_ip_route(struct sockaddr *src_addr,
329-
const struct sockaddr *dst_addr,
330-
struct rdma_dev_addr *addr);
331328

332329
int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
333330
const union ib_gid *dgid,

drivers/infiniband/core/device.c

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,29 @@ static void prevent_dealloc_device(struct ib_device *ib_dev)
13511351
{
13521352
}
13531353

1354+
static void ib_device_notify_register(struct ib_device *device)
1355+
{
1356+
struct net_device *netdev;
1357+
u32 port;
1358+
int ret;
1359+
1360+
ret = rdma_nl_notify_event(device, 0, RDMA_REGISTER_EVENT);
1361+
if (ret)
1362+
return;
1363+
1364+
rdma_for_each_port(device, port) {
1365+
netdev = ib_device_get_netdev(device, port);
1366+
if (!netdev)
1367+
continue;
1368+
1369+
ret = rdma_nl_notify_event(device, port,
1370+
RDMA_NETDEV_ATTACH_EVENT);
1371+
dev_put(netdev);
1372+
if (ret)
1373+
return;
1374+
}
1375+
}
1376+
13541377
/**
13551378
* ib_register_device - Register an IB device with IB core
13561379
* @device: Device to register
@@ -1449,6 +1472,8 @@ int ib_register_device(struct ib_device *device, const char *name,
14491472
dev_set_uevent_suppress(&device->dev, false);
14501473
/* Mark for userspace that device is ready */
14511474
kobject_uevent(&device->dev.kobj, KOBJ_ADD);
1475+
1476+
ib_device_notify_register(device);
14521477
ib_device_put(device);
14531478

14541479
return 0;
@@ -1491,6 +1516,7 @@ static void __ib_unregister_device(struct ib_device *ib_dev)
14911516
goto out;
14921517

14931518
disable_device(ib_dev);
1519+
rdma_nl_notify_event(ib_dev, 0, RDMA_UNREGISTER_EVENT);
14941520

14951521
/* Expedite removing unregistered pointers from the hash table */
14961522
free_netdevs(ib_dev);
@@ -2159,6 +2185,7 @@ static void add_ndev_hash(struct ib_port_data *pdata)
21592185
int ib_device_set_netdev(struct ib_device *ib_dev, struct net_device *ndev,
21602186
u32 port)
21612187
{
2188+
enum rdma_nl_notify_event_type etype;
21622189
struct net_device *old_ndev;
21632190
struct ib_port_data *pdata;
21642191
unsigned long flags;
@@ -2190,6 +2217,14 @@ int ib_device_set_netdev(struct ib_device *ib_dev, struct net_device *ndev,
21902217
spin_unlock_irqrestore(&pdata->netdev_lock, flags);
21912218

21922219
add_ndev_hash(pdata);
2220+
2221+
/* Make sure that the device is registered before we send events */
2222+
if (xa_load(&devices, ib_dev->index) != ib_dev)
2223+
return 0;
2224+
2225+
etype = ndev ? RDMA_NETDEV_ATTACH_EVENT : RDMA_NETDEV_DETACH_EVENT;
2226+
rdma_nl_notify_event(ib_dev, port, etype);
2227+
21932228
return 0;
21942229
}
21952230
EXPORT_SYMBOL(ib_device_set_netdev);
@@ -2236,6 +2271,9 @@ struct net_device *ib_device_get_netdev(struct ib_device *ib_dev,
22362271
if (!rdma_is_port_valid(ib_dev, port))
22372272
return NULL;
22382273

2274+
if (!ib_dev->port_data)
2275+
return NULL;
2276+
22392277
pdata = &ib_dev->port_data[port];
22402278

22412279
/*
@@ -2252,17 +2290,9 @@ struct net_device *ib_device_get_netdev(struct ib_device *ib_dev,
22522290
spin_unlock(&pdata->netdev_lock);
22532291
}
22542292

2255-
/*
2256-
* If we are starting to unregister expedite things by preventing
2257-
* propagation of an unregistering netdev.
2258-
*/
2259-
if (res && res->reg_state != NETREG_REGISTERED) {
2260-
dev_put(res);
2261-
return NULL;
2262-
}
2263-
22642293
return res;
22652294
}
2295+
EXPORT_SYMBOL(ib_device_get_netdev);
22662296

22672297
/**
22682298
* ib_device_get_by_netdev - Find an IB device associated with a netdev

drivers/infiniband/core/iwcm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ static int __init iw_cm_init(void)
11821182
if (ret)
11831183
return ret;
11841184

1185-
iwcm_wq = alloc_ordered_workqueue("iw_cm_wq", 0);
1185+
iwcm_wq = alloc_ordered_workqueue("iw_cm_wq", WQ_MEM_RECLAIM);
11861186
if (!iwcm_wq)
11871187
goto err_alloc;
11881188

drivers/infiniband/core/mad.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2616,14 +2616,16 @@ static int retry_send(struct ib_mad_send_wr_private *mad_send_wr)
26162616

26172617
static void timeout_sends(struct work_struct *work)
26182618
{
2619+
struct ib_mad_send_wr_private *mad_send_wr, *n;
26192620
struct ib_mad_agent_private *mad_agent_priv;
2620-
struct ib_mad_send_wr_private *mad_send_wr;
26212621
struct ib_mad_send_wc mad_send_wc;
2622+
struct list_head local_list;
26222623
unsigned long flags, delay;
26232624

26242625
mad_agent_priv = container_of(work, struct ib_mad_agent_private,
26252626
timed_work.work);
26262627
mad_send_wc.vendor_err = 0;
2628+
INIT_LIST_HEAD(&local_list);
26272629

26282630
spin_lock_irqsave(&mad_agent_priv->lock, flags);
26292631
while (!list_empty(&mad_agent_priv->wait_list)) {
@@ -2641,25 +2643,25 @@ static void timeout_sends(struct work_struct *work)
26412643
break;
26422644
}
26432645

2644-
list_del(&mad_send_wr->agent_list);
2646+
list_del_init(&mad_send_wr->agent_list);
26452647
if (mad_send_wr->status == IB_WC_SUCCESS &&
26462648
!retry_send(mad_send_wr))
26472649
continue;
26482650

2649-
spin_unlock_irqrestore(&mad_agent_priv->lock, flags);
2651+
list_add_tail(&mad_send_wr->agent_list, &local_list);
2652+
}
2653+
spin_unlock_irqrestore(&mad_agent_priv->lock, flags);
26502654

2655+
list_for_each_entry_safe(mad_send_wr, n, &local_list, agent_list) {
26512656
if (mad_send_wr->status == IB_WC_SUCCESS)
26522657
mad_send_wc.status = IB_WC_RESP_TIMEOUT_ERR;
26532658
else
26542659
mad_send_wc.status = mad_send_wr->status;
26552660
mad_send_wc.send_buf = &mad_send_wr->send_buf;
26562661
mad_agent_priv->agent.send_handler(&mad_agent_priv->agent,
26572662
&mad_send_wc);
2658-
26592663
deref_mad_agent(mad_agent_priv);
2660-
spin_lock_irqsave(&mad_agent_priv->lock, flags);
26612664
}
2662-
spin_unlock_irqrestore(&mad_agent_priv->lock, flags);
26632665
}
26642666

26652667
/*
@@ -2937,7 +2939,6 @@ static int ib_mad_port_open(struct ib_device *device,
29372939
int ret, cq_size;
29382940
struct ib_mad_port_private *port_priv;
29392941
unsigned long flags;
2940-
char name[sizeof "ib_mad123"];
29412942
int has_smi;
29422943

29432944
if (WARN_ON(rdma_max_mad_size(device, port_num) < IB_MGMT_MAD_SIZE))
@@ -2990,8 +2991,8 @@ static int ib_mad_port_open(struct ib_device *device,
29902991
goto error7;
29912992
}
29922993

2993-
snprintf(name, sizeof(name), "ib_mad%u", port_num);
2994-
port_priv->wq = alloc_ordered_workqueue(name, WQ_MEM_RECLAIM);
2994+
port_priv->wq = alloc_ordered_workqueue("ib_mad%u", WQ_MEM_RECLAIM,
2995+
port_num);
29952996
if (!port_priv->wq) {
29962997
ret = -ENOMEM;
29972998
goto error8;

drivers/infiniband/core/netlink.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ int rdma_nl_net_init(struct rdma_dev_net *rnet)
311311
struct net *net = read_pnet(&rnet->net);
312312
struct netlink_kernel_cfg cfg = {
313313
.input = rdma_nl_rcv,
314+
.flags = NL_CFG_F_NONROOT_RECV,
314315
};
315316
struct sock *nls;
316317

0 commit comments

Comments
 (0)