netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Carol Soto <clsoto-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: "Hefty,
	Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
	<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: "brking-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org"
	<brking-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
Subject: Re: [Patch 3/3] IB/ib_cm: hang in cm_destroy_id during PCI error injection
Date: Wed, 23 Apr 2014 13:58:10 -0500	[thread overview]
Message-ID: <53580D42.1060201@linux.vnet.ibm.com> (raw)
In-Reply-To: <1828884A29C6694DAF28B7E6B8A82373992F353B-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>


On 4/23/2014 1:15 PM, Hefty, Sean wrote:
>> Index: b/drivers/infiniband/core/cm.c
>> ===================================================================
>> --- a/drivers/infiniband/core/cm.c
>> +++ b/drivers/infiniband/core/cm.c
>> @@ -161,6 +161,7 @@ struct cm_port {
>>   	struct ib_mad_agent *mad_agent;
>>   	struct kobject port_obj;
>>   	u8 port_num;
>> +	u8 device_fatal;
>>   	struct cm_counter_group counter_group[CM_COUNTER_GROUPS];
>>   };
>>
>> @@ -168,6 +169,7 @@ struct cm_device {
>>   	struct list_head list;
>>   	struct ib_device *ib_device;
>>   	struct device *device;
>> +	struct ib_event_handler event_handler;
>>   	u8 ack_delay;
>>   	struct cm_port *port[0];
>>   };
>> @@ -258,6 +260,10 @@ static int cm_alloc_msg(struct cm_id_pri
>>   	struct ib_mad_agent *mad_agent;
>>   	struct ib_mad_send_buf *m;
>>   	struct ib_ah *ah;
>> +	struct cm_port *port = cm_id_priv->av.port;
>> +
>> +	if (port->device_fatal)
>> +		return -EIO;
>>
>>   	mad_agent = cm_id_priv->av.port->mad_agent;
>>   	ah = ib_create_ah(mad_agent->qp->pd, &cm_id_priv->av.ah_attr);
>> @@ -290,6 +296,9 @@ static int cm_alloc_response_msg(struct
>>   	struct ib_mad_send_buf *m;
>>   	struct ib_ah *ah;
>>
>> +	if (port->device_fatal)
>> +		return -EIO;
>> +
>>   	ah = ib_create_ah_from_wc(port->mad_agent->qp->pd, mad_recv_wc->wc,
>>   				  mad_recv_wc->recv_buf.grh, port->port_num);
>>   	if (IS_ERR(ah))
>> @@ -3764,6 +3773,33 @@ static void cm_remove_port_fs(struct cm_
>>   	kobject_put(&port->port_obj);
>>   }
>>
>> +static void ib_cm_event_handler(struct ib_event_handler *handler,
>> +				struct ib_event *event)
>> +{
>> +	struct cm_device *cm_dev;
>> +	struct cm_port *port = NULL;
>> +
>> +	cm_dev = container_of(handler, struct cm_device, event_handler);
>> +	switch (event->event) {
>> +	case IB_EVENT_PORT_ACTIVE:
>> +		port = cm_dev->port[event->element.port_num - 1];
>> +		if (port == NULL)
>> +			return;
>> +		if (port->port_num == event->element.port_num)
>> +			port->device_fatal = 0;
>> +		break;
>> +	case IB_EVENT_DEVICE_FATAL:
>> +		port = cm_dev->port[event->element.port_num - 1];
>> +		if (port == NULL)
>> +			return;
>> +		if (port->port_num == event->element.port_num)
>> +			port->device_fatal = 1;
>> +		break;
> This is a device level event, not a port event.  The port_num value may not be valid.
The first patch of the series(IB/mlx4: send a IB_EVENT_DEVICE_FATAL to 
users during PCI error injection), when mlx4 send the IB_EVENT_DEVICE_FATAL
event I am passing the port number to that field so in that way I was 
able to make it work. Any other suggestions are welcome.

Thanks
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-04-23 18:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27 14:28 [Patch 0/3] Hangs with IPoIB when doing PCI error injection clsoto
2014-03-27 14:28 ` [Patch 1/3] IB/mlx4: send a IB_EVENT_DEVICE_FATAL to users during " clsoto
2014-03-27 14:28 ` [Patch 2/3] IB: hang in mcast_remove_one " clsoto
2014-03-27 14:28 ` [Patch 3/3] IB/ib_cm: hang in cm_destroy_id " clsoto
     [not found]   ` <20140327142939.460692817-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2014-04-23 18:15     ` Hefty, Sean
     [not found]       ` <1828884A29C6694DAF28B7E6B8A82373992F353B-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-04-23 18:58         ` Carol Soto [this message]
     [not found]           ` <53580D42.1060201-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2014-04-23 21:34             ` Hefty, Sean
     [not found] ` <20140327142813.535289178-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2014-03-28 20:47   ` [Patch 0/3] Hangs with IPoIB when doing " David Miller
2014-03-28 20:47     ` Roland Dreier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53580D42.1060201@linux.vnet.ibm.com \
    --to=clsoto-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
    --cc=brking-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
    --cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).