Commit 54d7e819 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
  ...
parents 6fa6588e 70920941
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1640,9 +1640,11 @@ int ib_cache_setup_one(struct ib_device *device)

	rdma_for_each_port (device, p) {
		err = ib_cache_update(device, p, true, true, true);
		if (err)
		if (err) {
			gid_table_cleanup_one(device);
			return err;
		}
	}

	return 0;
}
+0 −3
Original line number Diff line number Diff line
@@ -325,9 +325,6 @@ void ib_qp_usecnt_inc(struct ib_qp *qp);
void ib_qp_usecnt_dec(struct ib_qp *qp);

struct rdma_dev_addr;
int rdma_resolve_ip_route(struct sockaddr *src_addr,
			  const struct sockaddr *dst_addr,
			  struct rdma_dev_addr *addr);

int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
				 const union ib_gid *dgid,
+39 −9
Original line number Diff line number Diff line
@@ -1351,6 +1351,29 @@ static void prevent_dealloc_device(struct ib_device *ib_dev)
{
}

static void ib_device_notify_register(struct ib_device *device)
{
	struct net_device *netdev;
	u32 port;
	int ret;

	ret = rdma_nl_notify_event(device, 0, RDMA_REGISTER_EVENT);
	if (ret)
		return;

	rdma_for_each_port(device, port) {
		netdev = ib_device_get_netdev(device, port);
		if (!netdev)
			continue;

		ret = rdma_nl_notify_event(device, port,
					   RDMA_NETDEV_ATTACH_EVENT);
		dev_put(netdev);
		if (ret)
			return;
	}
}

/**
 * ib_register_device - Register an IB device with IB core
 * @device: Device to register
@@ -1449,6 +1472,8 @@ int ib_register_device(struct ib_device *device, const char *name,
	dev_set_uevent_suppress(&device->dev, false);
	/* Mark for userspace that device is ready */
	kobject_uevent(&device->dev.kobj, KOBJ_ADD);

	ib_device_notify_register(device);
	ib_device_put(device);

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

	disable_device(ib_dev);
	rdma_nl_notify_event(ib_dev, 0, RDMA_UNREGISTER_EVENT);

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

	add_ndev_hash(pdata);

	/* Make sure that the device is registered before we send events */
	if (xa_load(&devices, ib_dev->index) != ib_dev)
		return 0;

	etype = ndev ? RDMA_NETDEV_ATTACH_EVENT : RDMA_NETDEV_DETACH_EVENT;
	rdma_nl_notify_event(ib_dev, port, etype);

	return 0;
}
EXPORT_SYMBOL(ib_device_set_netdev);
@@ -2236,6 +2271,9 @@ struct net_device *ib_device_get_netdev(struct ib_device *ib_dev,
	if (!rdma_is_port_valid(ib_dev, port))
		return NULL;

	if (!ib_dev->port_data)
		return NULL;

	pdata = &ib_dev->port_data[port];

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

	/*
	 * If we are starting to unregister expedite things by preventing
	 * propagation of an unregistering netdev.
	 */
	if (res && res->reg_state != NETREG_REGISTERED) {
		dev_put(res);
		return NULL;
	}

	return res;
}
EXPORT_SYMBOL(ib_device_get_netdev);

/**
 * ib_device_get_by_netdev - Find an IB device associated with a netdev
+1 −1
Original line number Diff line number Diff line
@@ -1182,7 +1182,7 @@ static int __init iw_cm_init(void)
	if (ret)
		return ret;

	iwcm_wq = alloc_ordered_workqueue("iw_cm_wq", 0);
	iwcm_wq = alloc_ordered_workqueue("iw_cm_wq", WQ_MEM_RECLAIM);
	if (!iwcm_wq)
		goto err_alloc;

+10 −9
Original line number Diff line number Diff line
@@ -2616,14 +2616,16 @@ static int retry_send(struct ib_mad_send_wr_private *mad_send_wr)

static void timeout_sends(struct work_struct *work)
{
	struct ib_mad_send_wr_private *mad_send_wr, *n;
	struct ib_mad_agent_private *mad_agent_priv;
	struct ib_mad_send_wr_private *mad_send_wr;
	struct ib_mad_send_wc mad_send_wc;
	struct list_head local_list;
	unsigned long flags, delay;

	mad_agent_priv = container_of(work, struct ib_mad_agent_private,
				      timed_work.work);
	mad_send_wc.vendor_err = 0;
	INIT_LIST_HEAD(&local_list);

	spin_lock_irqsave(&mad_agent_priv->lock, flags);
	while (!list_empty(&mad_agent_priv->wait_list)) {
@@ -2641,13 +2643,16 @@ static void timeout_sends(struct work_struct *work)
			break;
		}

		list_del(&mad_send_wr->agent_list);
		list_del_init(&mad_send_wr->agent_list);
		if (mad_send_wr->status == IB_WC_SUCCESS &&
		    !retry_send(mad_send_wr))
			continue;

		list_add_tail(&mad_send_wr->agent_list, &local_list);
	}
	spin_unlock_irqrestore(&mad_agent_priv->lock, flags);

	list_for_each_entry_safe(mad_send_wr, n, &local_list, agent_list) {
		if (mad_send_wr->status == IB_WC_SUCCESS)
			mad_send_wc.status = IB_WC_RESP_TIMEOUT_ERR;
		else
@@ -2655,11 +2660,8 @@ static void timeout_sends(struct work_struct *work)
		mad_send_wc.send_buf = &mad_send_wr->send_buf;
		mad_agent_priv->agent.send_handler(&mad_agent_priv->agent,
						   &mad_send_wc);

		deref_mad_agent(mad_agent_priv);
		spin_lock_irqsave(&mad_agent_priv->lock, flags);
	}
	spin_unlock_irqrestore(&mad_agent_priv->lock, flags);
}

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

	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,
			goto error7;
	}

	snprintf(name, sizeof(name), "ib_mad%u", port_num);
	port_priv->wq = alloc_ordered_workqueue(name, WQ_MEM_RECLAIM);
	port_priv->wq = alloc_ordered_workqueue("ib_mad%u", WQ_MEM_RECLAIM,
						port_num);
	if (!port_priv->wq) {
		ret = -ENOMEM;
		goto error8;
Loading