Jack Morgenstein wrote:
+static inline int rcv_has_same_gid(struct ib_mad_send_wr_private *wr,
+                                  struct ib_mad_recv_wc *rwc )
+{
+       struct ib_ah_attr attr;
+       u8 send_resp, rcv_resp;
+
+       send_resp = ((struct ib_mad *)(wr->send_buf.mad))->
+                    mad_hdr.method & IB_MGMT_METHOD_RESP;
+       rcv_resp = rwc->recv_buf.mad->mad_hdr.method & IB_MGMT_METHOD_RESP;
+
+       if (!send_resp && rcv_resp)
+               /* is request/response. GID/LIDs are both local (same). */
+               return 1;
+
+       if (send_resp == rcv_resp)
+               /* both requests, or both responses. GIDs different */
+               return 0;

The two checks above are only checking response bits of a sent and received MAD. How do these relate to checking the GIDs?

+       if (ib_query_ah(wr->send_buf.ah, &attr))
+               /* Assume not equal, to avoid false positives. */
+               return 0;

Querying for the address handle every time seems expensive. Can't we save the necessary information inside the ah? Failing that, we should move the query when sending a MAD, so it can be done once.

- Sean
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to