[openib-general] Re: [PATCH] CMA mods for iWARP

Sean Hefty mshefty at ichips.intel.com
Fri Jan 6 10:06:23 PST 2006


Tom Tucker wrote:
> This patch is for CMA changes to support iWARP and is relative to the
> trunk. It includes the latest ib_addr generalizations that allowed for
> some simplification in the rdma_resolve_addr implementation. This patch
> needs the include file patch to compile. 

Thanks - I would prefer hold off committing these changes for a few days until 
we can submit a patch to merge the existing rdma_cm and ib_addr upstream.

Only a couple of minor nits below.

> +static int cma_iw_handler(struct iw_cm_id* iw_id, struct iw_cm_event* event)
> +{
> +	struct rdma_id_private *id_priv = iw_id->context;
> +	enum rdma_cm_event_type event_type = 0;
> +	int ret = 0;
> +
> +	atomic_inc(&id_priv->dev_remove);
> +
> +	switch (event->event) {
> +	case IW_CM_EVENT_LLP_DISCONNECT:
> +	case IW_CM_EVENT_LLP_RESET:
> +	case IW_CM_EVENT_LLP_TIMEOUT:
> +	case IW_CM_EVENT_CLOSE:
> +		event_type = RDMA_CM_EVENT_DISCONNECTED;
> +		break;
> +
> +	case IW_CM_EVENT_CONNECT_REQUEST:
> +		BUG_ON(1);
> +		break;

Maybe move the BUG_ON to a default case?

> +static int cma_iw_listen(struct rdma_id_private *id_priv)
> +{
> +	int ret;
> +	struct sockaddr_in* sin;
> +
> +	id_priv->cm_id.iw = iw_create_cm_id(id_priv->id.device, 
> +					    iw_conn_req_handler,
> +					    id_priv);
> +	if (IS_ERR(id_priv->cm_id.iw))
> +		return PTR_ERR(id_priv->cm_id.iw);
> +
> +	sin = (struct sockaddr_in*)&id_priv->id.route.addr.src_addr;
> +	id_priv->cm_id.iw->local_addr = *sin;
> +
> +	ret = iw_cm_listen(id_priv->cm_id.iw, 10 /* backlog */);

rdma_listen() has a backlog parameter that can be used here.

- Sean



More information about the general mailing list