Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cead99dc authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  RDMA/cma: Do not issue MRA if user rejects connection request
  mlx4_core: Move table_find from fmr_alloc to fmr_enable
  IB/mlx4: mlx4_ib_fmr_alloc() should call mlx4_fmr_enable()
  IPoIB: Remove unused struct ipoib_cm_tx.ibwc member
  IPoIB: On P_Key change event, reset state properly
  IB/mthca: Convert to use be16_add_cpu()
  RDMA/cxgb3: Fail loopback connections
  IB/cm: Fix infiniband_cm class kobject ref counting
  IB/cm: Remove debug printk()s that snuck upstream
  IB/mthca: Add missing sg_init_table() in mthca_map_user_db()
parents 664a1566 ead595ae
Loading
Loading
Loading
Loading
+8 −18
Original line number Diff line number Diff line
@@ -3587,8 +3587,6 @@ static void cm_release_port_obj(struct kobject *obj)
{
	struct cm_port *cm_port;

	printk(KERN_ERR "free cm port\n");

	cm_port = container_of(obj, struct cm_port, port_obj);
	kfree(cm_port);
}
@@ -3601,8 +3599,6 @@ static void cm_release_dev_obj(struct kobject *obj)
{
	struct cm_device *cm_dev;

	printk(KERN_ERR "free cm dev\n");

	cm_dev = container_of(obj, struct cm_device, dev_obj);
	kfree(cm_dev);
}
@@ -3616,18 +3612,12 @@ struct class cm_class = {
};
EXPORT_SYMBOL(cm_class);

static void cm_remove_fs_obj(struct kobject *obj)
{
	kobject_put(obj->parent);
	kobject_put(obj);
}

static int cm_create_port_fs(struct cm_port *port)
{
	int i, ret;

	ret = kobject_init_and_add(&port->port_obj, &cm_port_obj_type,
				   kobject_get(&port->cm_dev->dev_obj),
				   &port->cm_dev->dev_obj,
				   "%d", port->port_num);
	if (ret) {
		kfree(port);
@@ -3637,7 +3627,7 @@ static int cm_create_port_fs(struct cm_port *port)
	for (i = 0; i < CM_COUNTER_GROUPS; i++) {
		ret = kobject_init_and_add(&port->counter_group[i].obj,
					   &cm_counter_obj_type,
					   kobject_get(&port->port_obj),
					   &port->port_obj,
					   "%s", counter_group_names[i]);
		if (ret)
			goto error;
@@ -3647,8 +3637,8 @@ static int cm_create_port_fs(struct cm_port *port)

error:
	while (i--)
		cm_remove_fs_obj(&port->counter_group[i].obj);
	cm_remove_fs_obj(&port->port_obj);
		kobject_put(&port->counter_group[i].obj);
	kobject_put(&port->port_obj);
	return ret;

}
@@ -3658,9 +3648,9 @@ static void cm_remove_port_fs(struct cm_port *port)
	int i;

	for (i = 0; i < CM_COUNTER_GROUPS; i++)
		cm_remove_fs_obj(&port->counter_group[i].obj);
		kobject_put(&port->counter_group[i].obj);

	cm_remove_fs_obj(&port->port_obj);
	kobject_put(&port->port_obj);
}

static void cm_add_one(struct ib_device *device)
@@ -3744,7 +3734,7 @@ static void cm_add_one(struct ib_device *device)
		ib_unregister_mad_agent(port->mad_agent);
		cm_remove_port_fs(port);
	}
	cm_remove_fs_obj(&cm_dev->dev_obj);
	kobject_put(&cm_dev->dev_obj);
}

static void cm_remove_one(struct ib_device *device)
@@ -3771,7 +3761,7 @@ static void cm_remove_one(struct ib_device *device)
		ib_unregister_mad_agent(port->mad_agent);
		cm_remove_port_fs(port);
	}
	cm_remove_fs_obj(&cm_dev->dev_obj);
	kobject_put(&cm_dev->dev_obj);
}

static int __init ib_cm_init(void)
+9 −1
Original line number Diff line number Diff line
@@ -1107,7 +1107,6 @@ static int cma_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
		event.param.ud.private_data_len =
				IB_CM_SIDR_REQ_PRIVATE_DATA_SIZE - offset;
	} else {
		ib_send_cm_mra(cm_id, CMA_CM_MRA_SETTING, NULL, 0);
		conn_id = cma_new_conn_id(&listen_id->id, ib_event);
		cma_set_req_event_data(&event, &ib_event->param.req_rcvd,
				       ib_event->private_data, offset);
@@ -1130,6 +1129,15 @@ static int cma_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)

	ret = conn_id->id.event_handler(&conn_id->id, &event);
	if (!ret) {
		/*
		 * Acquire mutex to prevent user executing rdma_destroy_id()
		 * while we're accessing the cm_id.
		 */
		mutex_lock(&lock);
		if (cma_comp(conn_id, CMA_CONNECT) &&
		    !cma_is_ud_ps(conn_id->id.ps))
			ib_send_cm_mra(cm_id, CMA_CM_MRA_SETTING, NULL, 0);
		mutex_unlock(&lock);
		cma_enable_remove(conn_id);
		goto out;
	}
+17 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
#include <linux/skbuff.h>
#include <linux/timer.h>
#include <linux/notifier.h>
#include <linux/inetdevice.h>

#include <net/neighbour.h>
#include <net/netevent.h>
@@ -1784,6 +1785,17 @@ int iwch_accept_cr(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
	return err;
}

static int is_loopback_dst(struct iw_cm_id *cm_id)
{
	struct net_device *dev;

	dev = ip_dev_find(&init_net, cm_id->remote_addr.sin_addr.s_addr);
	if (!dev)
		return 0;
	dev_put(dev);
	return 1;
}

int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
{
	int err = 0;
@@ -1791,6 +1803,11 @@ int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
	struct iwch_ep *ep;
	struct rtable *rt;

	if (is_loopback_dst(cm_id)) {
		err = -ENOSYS;
		goto out;
	}

	ep = alloc_ep(sizeof(*ep), GFP_KERNEL);
	if (!ep) {
		printk(KERN_ERR MOD "%s - cannot alloc ep.\n", __FUNCTION__);
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ struct ib_fmr *mlx4_ib_fmr_alloc(struct ib_pd *pd, int acc,
	if (err)
		goto err_free;

	err = mlx4_mr_enable(to_mdev(pd->device)->dev, &fmr->mfmr.mr);
	err = mlx4_fmr_enable(to_mdev(pd->device)->dev, &fmr->mfmr);
	if (err)
		goto err_mr;

+1 −1
Original line number Diff line number Diff line
@@ -473,7 +473,7 @@ static void handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
	if (!(new_wqe & cpu_to_be32(0x3f)) || (!cqe->db_cnt && dbd))
		return;

	cqe->db_cnt   = cpu_to_be16(be16_to_cpu(cqe->db_cnt) - dbd);
	be16_add_cpu(&cqe->db_cnt, -dbd);
	cqe->wqe      = new_wqe;
	cqe->syndrome = SYNDROME_WR_FLUSH_ERR;

Loading