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

Commit 9fe66dfd authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband

parents 32983696 1b205c2d
Loading
Loading
Loading
Loading
+18 −7
Original line number Original line Diff line number Diff line
@@ -8,15 +8,26 @@ config INFINIBAND
	  any protocols you wish to use as well as drivers for your
	  any protocols you wish to use as well as drivers for your
	  InfiniBand hardware.
	  InfiniBand hardware.


config INFINIBAND_USER_VERBS
config INFINIBAND_USER_MAD
	tristate "InfiniBand userspace verbs support"
	tristate "InfiniBand userspace MAD support"
	depends on INFINIBAND
	depends on INFINIBAND
	---help---
	---help---
	  Userspace InfiniBand verbs support.  This is the kernel side
	  Userspace InfiniBand Management Datagram (MAD) support.  This
	  of userspace verbs, which allows userspace processes to
	  is the kernel side of the userspace MAD support, which allows
	  directly access InfiniBand hardware for fast-path
	  userspace processes to send and receive MADs. You will also 
	  operations.  You will also need libibverbs and a hardware
	  need libibumad from <http://www.openib.org>.
	  driver library from <http://www.openib.org>.

config INFINIBAND_USER_ACCESS
	tristate "InfiniBand userspace access (verbs and CM)"
	depends on INFINIBAND
	---help---
	  Userspace InfiniBand access support.  This enables the
	  kernel side of userspace verbs and the userspace
	  communication manager (CM).  This allows userspace processes
	  to set up connections and directly access InfiniBand
	  hardware for fast-path operations.  You will also need
	  libibverbs, libibcm and a hardware driver library from
	  <http://www.openib.org>.


source "drivers/infiniband/hw/mthca/Kconfig"
source "drivers/infiniband/hw/mthca/Kconfig"


+3 −2
Original line number Original line Diff line number Diff line
obj-$(CONFIG_INFINIBAND) +=		ib_core.o ib_mad.o ib_sa.o \
obj-$(CONFIG_INFINIBAND) +=		ib_core.o ib_mad.o ib_sa.o \
					ib_cm.o ib_umad.o ib_ucm.o
					ib_cm.o
obj-$(CONFIG_INFINIBAND_USER_VERBS) +=	ib_uverbs.o
obj-$(CONFIG_INFINIBAND_USER_MAD) +=	ib_umad.o
obj-$(CONFIG_INFINIBAND_USER_ACCESS) +=	ib_uverbs.o ib_ucm.o


ib_core-y :=			packer.o ud_header.o verbs.o sysfs.o \
ib_core-y :=			packer.o ud_header.o verbs.o sysfs.o \
				device.o fmr_pool.o cache.o
				device.o fmr_pool.o cache.o
+4 −1
Original line number Original line Diff line number Diff line
@@ -173,7 +173,8 @@ static int cm_alloc_msg(struct cm_id_private *cm_id_priv,
	if (IS_ERR(ah))
	if (IS_ERR(ah))
		return PTR_ERR(ah);
		return PTR_ERR(ah);


	m = ib_create_send_mad(mad_agent, 1, cm_id_priv->av.pkey_index,
	m = ib_create_send_mad(mad_agent, cm_id_priv->id.remote_cm_qpn, 
			       cm_id_priv->av.pkey_index,
			       ah, 0, sizeof(struct ib_mad_hdr),
			       ah, 0, sizeof(struct ib_mad_hdr),
			       sizeof(struct ib_mad)-sizeof(struct ib_mad_hdr),
			       sizeof(struct ib_mad)-sizeof(struct ib_mad_hdr),
			       GFP_ATOMIC);
			       GFP_ATOMIC);
@@ -536,6 +537,7 @@ struct ib_cm_id *ib_create_cm_id(ib_cm_handler cm_handler,
	cm_id_priv->id.state = IB_CM_IDLE;
	cm_id_priv->id.state = IB_CM_IDLE;
	cm_id_priv->id.cm_handler = cm_handler;
	cm_id_priv->id.cm_handler = cm_handler;
	cm_id_priv->id.context = context;
	cm_id_priv->id.context = context;
	cm_id_priv->id.remote_cm_qpn = 1;
	ret = cm_alloc_id(cm_id_priv);
	ret = cm_alloc_id(cm_id_priv);
	if (ret)
	if (ret)
		goto error;
		goto error;
@@ -1313,6 +1315,7 @@ error3: atomic_dec(&cm_id_priv->refcount);
	cm_deref_id(listen_cm_id_priv);
	cm_deref_id(listen_cm_id_priv);
	cm_cleanup_timewait(cm_id_priv->timewait_info);
	cm_cleanup_timewait(cm_id_priv->timewait_info);
error2:	kfree(cm_id_priv->timewait_info);
error2:	kfree(cm_id_priv->timewait_info);
	cm_id_priv->timewait_info = NULL;
error1:	ib_destroy_cm_id(&cm_id_priv->id);
error1:	ib_destroy_cm_id(&cm_id_priv->id);
	return ret;
	return ret;
}
}
+3 −1
Original line number Original line Diff line number Diff line
@@ -593,7 +593,8 @@ static int send_next_seg(struct ib_mad_send_wr_private *mad_send_wr)
		rmpp_mad->rmpp_hdr.paylen_newwin =
		rmpp_mad->rmpp_hdr.paylen_newwin =
			cpu_to_be32(mad_send_wr->total_seg *
			cpu_to_be32(mad_send_wr->total_seg *
				    (sizeof(struct ib_rmpp_mad) -
				    (sizeof(struct ib_rmpp_mad) -
				       offsetof(struct ib_rmpp_mad, data)));
				       offsetof(struct ib_rmpp_mad, data)) -
				    mad_send_wr->pad);
		mad_send_wr->sg_list[0].length = sizeof(struct ib_rmpp_mad);
		mad_send_wr->sg_list[0].length = sizeof(struct ib_rmpp_mad);
	} else {
	} else {
		mad_send_wr->send_wr.num_sge = 2;
		mad_send_wr->send_wr.num_sge = 2;
@@ -602,6 +603,7 @@ static int send_next_seg(struct ib_mad_send_wr_private *mad_send_wr)
		mad_send_wr->sg_list[1].length = sizeof(struct ib_rmpp_mad) -
		mad_send_wr->sg_list[1].length = sizeof(struct ib_rmpp_mad) -
						 mad_send_wr->data_offset;
						 mad_send_wr->data_offset;
		mad_send_wr->sg_list[1].lkey = mad_send_wr->sg_list[0].lkey;
		mad_send_wr->sg_list[1].lkey = mad_send_wr->sg_list[0].lkey;
		rmpp_mad->rmpp_hdr.paylen_newwin = 0;
	}
	}


	if (mad_send_wr->seg_num == mad_send_wr->total_seg) {
	if (mad_send_wr->seg_num == mad_send_wr->total_seg) {
+2 −28
Original line number Original line Diff line number Diff line
@@ -113,32 +113,6 @@ static DEFINE_IDR(query_idr);
static spinlock_t tid_lock;
static spinlock_t tid_lock;
static u32 tid;
static u32 tid;


enum {
	IB_SA_ATTR_CLASS_PORTINFO    = 0x01,
	IB_SA_ATTR_NOTICE	     = 0x02,
	IB_SA_ATTR_INFORM_INFO	     = 0x03,
	IB_SA_ATTR_NODE_REC	     = 0x11,
	IB_SA_ATTR_PORT_INFO_REC     = 0x12,
	IB_SA_ATTR_SL2VL_REC	     = 0x13,
	IB_SA_ATTR_SWITCH_REC	     = 0x14,
	IB_SA_ATTR_LINEAR_FDB_REC    = 0x15,
	IB_SA_ATTR_RANDOM_FDB_REC    = 0x16,
	IB_SA_ATTR_MCAST_FDB_REC     = 0x17,
	IB_SA_ATTR_SM_INFO_REC	     = 0x18,
	IB_SA_ATTR_LINK_REC	     = 0x20,
	IB_SA_ATTR_GUID_INFO_REC     = 0x30,
	IB_SA_ATTR_SERVICE_REC	     = 0x31,
	IB_SA_ATTR_PARTITION_REC     = 0x33,
	IB_SA_ATTR_RANGE_REC	     = 0x34,
	IB_SA_ATTR_PATH_REC	     = 0x35,
	IB_SA_ATTR_VL_ARB_REC	     = 0x36,
	IB_SA_ATTR_MC_GROUP_REC	     = 0x37,
	IB_SA_ATTR_MC_MEMBER_REC     = 0x38,
	IB_SA_ATTR_TRACE_REC	     = 0x39,
	IB_SA_ATTR_MULTI_PATH_REC    = 0x3a,
	IB_SA_ATTR_SERVICE_ASSOC_REC = 0x3b
};

#define PATH_REC_FIELD(field) \
#define PATH_REC_FIELD(field) \
	.struct_offset_bytes = offsetof(struct ib_sa_path_rec, field),		\
	.struct_offset_bytes = offsetof(struct ib_sa_path_rec, field),		\
	.struct_size_bytes   = sizeof ((struct ib_sa_path_rec *) 0)->field,	\
	.struct_size_bytes   = sizeof ((struct ib_sa_path_rec *) 0)->field,	\
@@ -431,8 +405,8 @@ static void ib_sa_event(struct ib_event_handler *handler, struct ib_event *event
	    event->event == IB_EVENT_LID_CHANGE  ||
	    event->event == IB_EVENT_LID_CHANGE  ||
	    event->event == IB_EVENT_PKEY_CHANGE ||
	    event->event == IB_EVENT_PKEY_CHANGE ||
	    event->event == IB_EVENT_SM_CHANGE) {
	    event->event == IB_EVENT_SM_CHANGE) {
		struct ib_sa_device *sa_dev =
		struct ib_sa_device *sa_dev;
			ib_get_client_data(event->device, &sa_client);
		sa_dev = container_of(handler, typeof(*sa_dev), event_handler);


		schedule_work(&sa_dev->port[event->element.port_num -
		schedule_work(&sa_dev->port[event->element.port_num -
					    sa_dev->start_port].update_task);
					    sa_dev->start_port].update_task);
Loading