Re: [PATCH v2] Return EPROTONOSUPPORT when an RDMA device lacks QP0

2011-05-23 Thread Roland Dreier
 Yes, sorry, revised attached,

Thanks, this looks good to apply to me.

Sean, any objection?

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


RE: [PATCH v2] Return EPROTONOSUPPORT when an RDMA device lacks QP0

2011-05-23 Thread Hefty, Sean
 Sean, any objection?

Looks good to me.  Thanks, Ira.

Acked-by: Sean Hefty sean.he...@intel.com
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] Return EPROTONOSUPPORT when an RDMA device lacks QP0

2011-05-22 Thread Weiny, Ira K.

On May 20, 2011, at 4:23 PM, Hefty, Sean wrote:

 mad_agent_priv-agent.mr = ib_get_dma_mr(port_priv-qp_info[qpn].qp-
 pd,
  IB_ACCESS_LOCAL_WRITE);
 
 in which case it may be safer to check for the NULL pointer.  Can you
 confirm if this was the spot?
 
 Yes it was that spot.  I did think of that today after I sent the patch.
 
 Do you think it would be safer just to check for both pointers QP0 and 1
 (depending on the registration)?
 
 Yes, it seems safer and easier to maintain if we just validated the pointer.
 
 - Sean

New patch attached.

Ira



0001-Return-EPROTONOSUPPORT-when-an-RDMA-device-lacks-the.patch
Description: Binary data


Re: [PATCH v2] Return EPROTONOSUPPORT when an RDMA device lacks QP0

2011-05-22 Thread Roland Dreier
  @@ -2738,6 +2745,7 @@ static void init_mad_qp(struct
ib_mad_port_private *port_priv,
   spin_lock_init(qp_info-snoop_lock);
   qp_info-snoop_table = NULL;
   qp_info-snoop_table_size = 0;
  +qp_info-qp = NULL;
   atomic_set(qp_info-snoop_count, 0);
   }

This bit isn't needed, is it?  qp_info is in memory allocated with kzalloc.
(We could get rid of the other = 0 / = NULL lines too)

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


Re: [PATCH v2] Return EPROTONOSUPPORT when an RDMA device lacks QP0

2011-05-22 Thread Weiny, Ira K.

On May 22, 2011, at 9:05 PM, Roland Dreier wrote:

 @@ -2738,6 +2745,7 @@ static void init_mad_qp(struct
 ib_mad_port_private *port_priv,
  spin_lock_init(qp_info-snoop_lock);
  qp_info-snoop_table = NULL;
  qp_info-snoop_table_size = 0;
 +qp_info-qp = NULL;
  atomic_set(qp_info-snoop_count, 0);
 }
 
 This bit isn't needed, is it?  qp_info is in memory allocated with kzalloc.
 (We could get rid of the other = 0 / = NULL lines too)
 

Yes, sorry, revised attached,
Ira




0001-Return-EPROTONOSUPPORT-when-an-RDMA-device-lacks-the.patch
Description: Binary data