[infiniband] Improve ib_packet debugging messages
authorMichael Brown <mcb30@etherboot.org>
Wed, 8 Jul 2009 03:31:48 +0000 (04:31 +0100)
committerMichael Brown <mcb30@etherboot.org>
Fri, 17 Jul 2009 22:06:34 +0000 (23:06 +0100)
src/net/infiniband/ib_packet.c

index 3170a20..409ef2f 100644 (file)
@@ -213,15 +213,23 @@ int ib_pull ( struct ib_device *ibdev, struct io_buffer *iobuf,
        /* Determine destination QP, if applicable */
        if ( qp ) {
                if ( IB_LID_MULTICAST ( lid ) && grh ) {
        /* Determine destination QP, if applicable */
        if ( qp ) {
                if ( IB_LID_MULTICAST ( lid ) && grh ) {
-                       *qp = ib_find_qp_mgid ( ibdev, &grh->dgid );
+                       if ( ! ( *qp = ib_find_qp_mgid ( ibdev, &grh->dgid ))){
+                               DBGC ( ibdev, "IBDEV %p RX for unknown MGID "
+                                      "%08x:%08x:%08x:%08x\n", ibdev,
+                                      ntohl ( grh->dgid.u.dwords[0] ),
+                                      ntohl ( grh->dgid.u.dwords[1] ),
+                                      ntohl ( grh->dgid.u.dwords[2] ),
+                                      ntohl ( grh->dgid.u.dwords[3] ) );
+                               return -ENODEV;
+                       }
                } else {
                } else {
-                       *qp = ib_find_qp_qpn ( ibdev, qpn );
-               }
-               if ( ! *qp ) {
-                       DBGC ( ibdev, "IBDEV %p RX for nonexistent QP\n",
-                              ibdev );
-                       return -ENODEV;
+                       if ( ! ( *qp = ib_find_qp_qpn ( ibdev, qpn ) ) ) {
+                               DBGC ( ibdev, "IBDEV %p RX for nonexistent "
+                                      "QPN %lx\n", ibdev, qpn );
+                               return -ENODEV;
+                       }
                }
                }
+               assert ( *qp );
        }
 
        DBGC2 ( ibdev, "IBDEV %p RX %04x:%08lx <= %04x:%08lx (key %08x)\n",
        }
 
        DBGC2 ( ibdev, "IBDEV %p RX %04x:%08lx <= %04x:%08lx (key %08x)\n",