Commit d087f6ad authored by Roland Dreier's avatar Roland Dreier
Browse files

Merge branches 'core', 'cxgb4', 'ipoib', 'iser', 'iwcm', 'mad', 'misc',...

Merge branches 'core', 'cxgb4', 'ipoib', 'iser', 'iwcm', 'mad', 'misc', 'mlx4', 'mlx5', 'ocrdma' and 'srp' into for-next
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -26,6 +26,11 @@ Creating MAD agents
  ioctl.  Also, all agents registered through a file descriptor will
  ioctl.  Also, all agents registered through a file descriptor will
  be unregistered when the descriptor is closed.
  be unregistered when the descriptor is closed.


  2014 -- a new registration ioctl is now provided which allows additional
       fields to be provided during registration.
       Users of this registration call are implicitly setting the use of
       pkey_index (see below).

Receiving MADs
Receiving MADs


  MADs are received using read().  The receive side now supports
  MADs are received using read().  The receive side now supports
@@ -104,10 +109,10 @@ P_Key Index Handling
  The old ib_umad interface did not allow setting the P_Key index for
  The old ib_umad interface did not allow setting the P_Key index for
  MADs that are sent and did not provide a way for obtaining the P_Key
  MADs that are sent and did not provide a way for obtaining the P_Key
  index of received MADs.  A new layout for struct ib_user_mad_hdr
  index of received MADs.  A new layout for struct ib_user_mad_hdr
  with a pkey_index member has been defined; however, to preserve
  with a pkey_index member has been defined; however, to preserve binary
  binary compatibility with older applications, this new layout will
  compatibility with older applications, this new layout will not be used
  not be used unless the IB_USER_MAD_ENABLE_PKEY ioctl is called
  unless one of IB_USER_MAD_ENABLE_PKEY or IB_USER_MAD_REGISTER_AGENT2 ioctl's
  before a file descriptor is used for anything else.
  are called before a file descriptor is used for anything else.


  In September 2008, the IB_USER_MAD_ABI_VERSION will be incremented
  In September 2008, the IB_USER_MAD_ABI_VERSION will be incremented
  to 6, the new layout of struct ib_user_mad_hdr will be used by
  to 6, the new layout of struct ib_user_mad_hdr will be used by
+8 −8
Original line number Original line Diff line number Diff line
@@ -94,14 +94,14 @@ void agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
		port_priv = ib_get_agent_port(device, port_num);
		port_priv = ib_get_agent_port(device, port_num);


	if (!port_priv) {
	if (!port_priv) {
		printk(KERN_ERR SPFX "Unable to find port agent\n");
		dev_err(&device->dev, "Unable to find port agent\n");
		return;
		return;
	}
	}


	agent = port_priv->agent[qpn];
	agent = port_priv->agent[qpn];
	ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num);
	ah = ib_create_ah_from_wc(agent->qp->pd, wc, grh, port_num);
	if (IS_ERR(ah)) {
	if (IS_ERR(ah)) {
		printk(KERN_ERR SPFX "ib_create_ah_from_wc error %ld\n",
		dev_err(&device->dev, "ib_create_ah_from_wc error %ld\n",
			PTR_ERR(ah));
			PTR_ERR(ah));
		return;
		return;
	}
	}
@@ -110,7 +110,7 @@ void agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
				      IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA,
				      IB_MGMT_MAD_HDR, IB_MGMT_MAD_DATA,
				      GFP_KERNEL);
				      GFP_KERNEL);
	if (IS_ERR(send_buf)) {
	if (IS_ERR(send_buf)) {
		printk(KERN_ERR SPFX "ib_create_send_mad error\n");
		dev_err(&device->dev, "ib_create_send_mad error\n");
		goto err1;
		goto err1;
	}
	}


@@ -125,7 +125,7 @@ void agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
	}
	}


	if (ib_post_send_mad(send_buf, NULL)) {
	if (ib_post_send_mad(send_buf, NULL)) {
		printk(KERN_ERR SPFX "ib_post_send_mad error\n");
		dev_err(&device->dev, "ib_post_send_mad error\n");
		goto err2;
		goto err2;
	}
	}
	return;
	return;
@@ -151,7 +151,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
	/* Create new device info */
	/* Create new device info */
	port_priv = kzalloc(sizeof *port_priv, GFP_KERNEL);
	port_priv = kzalloc(sizeof *port_priv, GFP_KERNEL);
	if (!port_priv) {
	if (!port_priv) {
		printk(KERN_ERR SPFX "No memory for ib_agent_port_private\n");
		dev_err(&device->dev, "No memory for ib_agent_port_private\n");
		ret = -ENOMEM;
		ret = -ENOMEM;
		goto error1;
		goto error1;
	}
	}
@@ -161,7 +161,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
		port_priv->agent[0] = ib_register_mad_agent(device, port_num,
		port_priv->agent[0] = ib_register_mad_agent(device, port_num,
							    IB_QPT_SMI, NULL, 0,
							    IB_QPT_SMI, NULL, 0,
							    &agent_send_handler,
							    &agent_send_handler,
							    NULL, NULL);
							    NULL, NULL, 0);
		if (IS_ERR(port_priv->agent[0])) {
		if (IS_ERR(port_priv->agent[0])) {
			ret = PTR_ERR(port_priv->agent[0]);
			ret = PTR_ERR(port_priv->agent[0]);
			goto error2;
			goto error2;
@@ -172,7 +172,7 @@ int ib_agent_port_open(struct ib_device *device, int port_num)
	port_priv->agent[1] = ib_register_mad_agent(device, port_num,
	port_priv->agent[1] = ib_register_mad_agent(device, port_num,
						    IB_QPT_GSI, NULL, 0,
						    IB_QPT_GSI, NULL, 0,
						    &agent_send_handler,
						    &agent_send_handler,
						    NULL, NULL);
						    NULL, NULL, 0);
	if (IS_ERR(port_priv->agent[1])) {
	if (IS_ERR(port_priv->agent[1])) {
		ret = PTR_ERR(port_priv->agent[1]);
		ret = PTR_ERR(port_priv->agent[1]);
		goto error3;
		goto error3;
@@ -202,7 +202,7 @@ int ib_agent_port_close(struct ib_device *device, int port_num)
	port_priv = __ib_get_agent_port(device, port_num);
	port_priv = __ib_get_agent_port(device, port_num);
	if (port_priv == NULL) {
	if (port_priv == NULL) {
		spin_unlock_irqrestore(&ib_agent_port_list_lock, flags);
		spin_unlock_irqrestore(&ib_agent_port_list_lock, flags);
		printk(KERN_ERR SPFX "Port %d not found\n", port_num);
		dev_err(&device->dev, "Port %d not found\n", port_num);
		return -ENODEV;
		return -ENODEV;
	}
	}
	list_del(&port_priv->port_list);
	list_del(&port_priv->port_list);
+3 −2
Original line number Original line Diff line number Diff line
@@ -3753,7 +3753,7 @@ static void cm_add_one(struct ib_device *ib_device)
	struct cm_port *port;
	struct cm_port *port;
	struct ib_mad_reg_req reg_req = {
	struct ib_mad_reg_req reg_req = {
		.mgmt_class = IB_MGMT_CLASS_CM,
		.mgmt_class = IB_MGMT_CLASS_CM,
		.mgmt_class_version = IB_CM_CLASS_VERSION
		.mgmt_class_version = IB_CM_CLASS_VERSION,
	};
	};
	struct ib_port_modify port_modify = {
	struct ib_port_modify port_modify = {
		.set_port_cap_mask = IB_PORT_CM_SUP
		.set_port_cap_mask = IB_PORT_CM_SUP
@@ -3801,7 +3801,8 @@ static void cm_add_one(struct ib_device *ib_device)
							0,
							0,
							cm_send_handler,
							cm_send_handler,
							cm_recv_handler,
							cm_recv_handler,
							port);
							port,
							0);
		if (IS_ERR(port->mad_agent))
		if (IS_ERR(port->mad_agent))
			goto error2;
			goto error2;


+27 −0
Original line number Original line Diff line number Diff line
@@ -46,6 +46,7 @@
#include <linux/completion.h>
#include <linux/completion.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/sysctl.h>


#include <rdma/iw_cm.h>
#include <rdma/iw_cm.h>
#include <rdma/ib_addr.h>
#include <rdma/ib_addr.h>
@@ -65,6 +66,20 @@ struct iwcm_work {
	struct list_head free_list;
	struct list_head free_list;
};
};


static unsigned int default_backlog = 256;

static struct ctl_table_header *iwcm_ctl_table_hdr;
static struct ctl_table iwcm_ctl_table[] = {
	{
		.procname	= "default_backlog",
		.data		= &default_backlog,
		.maxlen		= sizeof(default_backlog),
		.mode		= 0644,
		.proc_handler	= proc_dointvec,
	},
	{ }
};

/*
/*
 * The following services provide a mechanism for pre-allocating iwcm_work
 * The following services provide a mechanism for pre-allocating iwcm_work
 * elements.  The design pre-allocates them  based on the cm_id type:
 * elements.  The design pre-allocates them  based on the cm_id type:
@@ -425,6 +440,9 @@ int iw_cm_listen(struct iw_cm_id *cm_id, int backlog)


	cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
	cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);


	if (!backlog)
		backlog = default_backlog;

	ret = alloc_work_entries(cm_id_priv, backlog);
	ret = alloc_work_entries(cm_id_priv, backlog);
	if (ret)
	if (ret)
		return ret;
		return ret;
@@ -1030,11 +1048,20 @@ static int __init iw_cm_init(void)
	if (!iwcm_wq)
	if (!iwcm_wq)
		return -ENOMEM;
		return -ENOMEM;


	iwcm_ctl_table_hdr = register_net_sysctl(&init_net, "net/iw_cm",
						 iwcm_ctl_table);
	if (!iwcm_ctl_table_hdr) {
		pr_err("iw_cm: couldn't register sysctl paths\n");
		destroy_workqueue(iwcm_wq);
		return -ENOMEM;
	}

	return 0;
	return 0;
}
}


static void __exit iw_cm_cleanup(void)
static void __exit iw_cm_cleanup(void)
{
{
	unregister_net_sysctl_table(iwcm_ctl_table_hdr);
	destroy_workqueue(iwcm_wq);
	destroy_workqueue(iwcm_wq);
}
}


+182 −101

File changed.

Preview size limit exceeded, changes collapsed.

Loading