Browse Source

[ipoib] Use Infiniband broadcast QPN in IPoIB broadcast MAC address

Remove the special handling of the IPoIB broadcast QPN.
tags/v0.9.8
Michael Brown 15 years ago
parent
commit
4d0029611f
1 changed files with 3 additions and 10 deletions
  1. 3
    10
      src/drivers/net/ipoib.c

+ 3
- 10
src/drivers/net/ipoib.c View File

85
 /** IPoIB metadata TID */
85
 /** IPoIB metadata TID */
86
 static uint32_t ipoib_meta_tid = 0;
86
 static uint32_t ipoib_meta_tid = 0;
87
 
87
 
88
-/** Broadcast QPN used in IPoIB MAC addresses
89
- *
90
- * This is a guaranteed invalid real QPN
91
- */
92
-#define IPOIB_BROADCAST_QPN 0xffffffffUL
93
-
94
 /** Broadcast IPoIB address */
88
 /** Broadcast IPoIB address */
95
 static struct ipoib_mac ipoib_broadcast = {
89
 static struct ipoib_mac ipoib_broadcast = {
96
-	.qpn = ntohl ( IPOIB_BROADCAST_QPN ),
90
+	.qpn = htonl ( IB_QPN_BROADCAST ),
97
 	.gid.u.bytes = 	{ 0xff, 0x12, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00,
91
 	.gid.u.bytes = 	{ 0xff, 0x12, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00,
98
 			  0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff },
92
 			  0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff },
99
 };
93
 };
442
 
436
 
443
 	/* Construct address vector */
437
 	/* Construct address vector */
444
 	memset ( &av, 0, sizeof ( av ) );
438
 	memset ( &av, 0, sizeof ( av ) );
439
+	av.qpn = ntohl ( dest->mac.qpn );
445
 	av.qkey = ipoib->data_qkey;
440
 	av.qkey = ipoib->data_qkey;
446
 	av.gid_present = 1;
441
 	av.gid_present = 1;
447
-	if ( dest->mac.qpn == htonl ( IPOIB_BROADCAST_QPN ) ) {
442
+	if ( av.qpn == IB_QPN_BROADCAST ) {
448
 		/* Broadcast */
443
 		/* Broadcast */
449
-		av.qpn = IB_QPN_BROADCAST;
450
 		av.lid = ipoib->broadcast_lid;
444
 		av.lid = ipoib->broadcast_lid;
451
 		memcpy ( &av.gid, &ipoib->broadcast_gid, sizeof ( av.gid ) );
445
 		memcpy ( &av.gid, &ipoib->broadcast_gid, sizeof ( av.gid ) );
452
 	} else {
446
 	} else {
453
 		/* Unicast */
447
 		/* Unicast */
454
-		av.qpn = ntohl ( dest->mac.qpn );
455
 		memcpy ( &av.gid, &dest->mac.gid, sizeof ( av.gid ) );
448
 		memcpy ( &av.gid, &dest->mac.gid, sizeof ( av.gid ) );
456
 		if ( ( rc = ib_resolve_path ( ibdev, &av ) ) != 0 ) {
449
 		if ( ( rc = ib_resolve_path ( ibdev, &av ) ) != 0 ) {
457
 			/* Path not resolved yet */
450
 			/* Path not resolved yet */

Loading…
Cancel
Save