瀏覽代碼

[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 年之前
父節點
當前提交
4d0029611f
共有 1 個檔案被更改,包括 3 行新增10 行删除
  1. 3
    10
      src/drivers/net/ipoib.c

+ 3
- 10
src/drivers/net/ipoib.c 查看文件

@@ -85,15 +85,9 @@ struct ipoib_device {
85 85
 /** IPoIB metadata TID */
86 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 88
 /** Broadcast IPoIB address */
95 89
 static struct ipoib_mac ipoib_broadcast = {
96
-	.qpn = ntohl ( IPOIB_BROADCAST_QPN ),
90
+	.qpn = htonl ( IB_QPN_BROADCAST ),
97 91
 	.gid.u.bytes = 	{ 0xff, 0x12, 0x40, 0x1b, 0x00, 0x00, 0x00, 0x00,
98 92
 			  0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff },
99 93
 };
@@ -442,16 +436,15 @@ static int ipoib_transmit ( struct net_device *netdev,
442 436
 
443 437
 	/* Construct address vector */
444 438
 	memset ( &av, 0, sizeof ( av ) );
439
+	av.qpn = ntohl ( dest->mac.qpn );
445 440
 	av.qkey = ipoib->data_qkey;
446 441
 	av.gid_present = 1;
447
-	if ( dest->mac.qpn == htonl ( IPOIB_BROADCAST_QPN ) ) {
442
+	if ( av.qpn == IB_QPN_BROADCAST ) {
448 443
 		/* Broadcast */
449
-		av.qpn = IB_QPN_BROADCAST;
450 444
 		av.lid = ipoib->broadcast_lid;
451 445
 		memcpy ( &av.gid, &ipoib->broadcast_gid, sizeof ( av.gid ) );
452 446
 	} else {
453 447
 		/* Unicast */
454
-		av.qpn = ntohl ( dest->mac.qpn );
455 448
 		memcpy ( &av.gid, &dest->mac.gid, sizeof ( av.gid ) );
456 449
 		if ( ( rc = ib_resolve_path ( ibdev, &av ) ) != 0 ) {
457 450
 			/* Path not resolved yet */

Loading…
取消
儲存