瀏覽代碼

[infiniband] Pass GMA as a parameter to GMA MAD handlers

tags/v0.9.8
Michael Brown 15 年之前
父節點
當前提交
8a852280eb
共有 4 個檔案被更改,包括 72 行新增72 行删除
  1. 9
    8
      src/include/gpxe/ib_gma.h
  2. 9
    12
      src/net/infiniband/ib_gma.c
  3. 35
    35
      src/net/infiniband/ib_mcast.c
  4. 19
    17
      src/net/infiniband/ib_pathrec.c

+ 9
- 8
src/include/gpxe/ib_gma.h 查看文件

17
 struct ib_completion_queue;
17
 struct ib_completion_queue;
18
 struct ib_queue_pair;
18
 struct ib_queue_pair;
19
 union ib_mad;
19
 union ib_mad;
20
+struct ib_gma;
20
 
21
 
21
-/** A MAD attribute handler */
22
-struct ib_mad_handler {
22
+/** A GMA attribute handler */
23
+struct ib_gma_handler {
23
 	/** Management class */
24
 	/** Management class */
24
 	uint8_t mgmt_class;
25
 	uint8_t mgmt_class;
25
 	/** Class version */
26
 	/** Class version */
32
 	uint16_t attr_id;
33
 	uint16_t attr_id;
33
 	/** Handle attribute
34
 	/** Handle attribute
34
 	 *
35
 	 *
35
-	 * @v ibdev	Infiniband device
36
+	 * @v gma	General management agent
36
 	 * @v mad	MAD
37
 	 * @v mad	MAD
37
 	 * @ret rc	Return status code
38
 	 * @ret rc	Return status code
38
 	 *
39
 	 *
40
 	 * handler returns with a non-zero value in the MAD's @c
41
 	 * handler returns with a non-zero value in the MAD's @c
41
 	 * method field, it will be sent as a response.
42
 	 * method field, it will be sent as a response.
42
 	 */
43
 	 */
43
-	int ( * handle ) ( struct ib_device *ibdev, union ib_mad *mad );
44
+	int ( * handle ) ( struct ib_gma *gma, union ib_mad *mad );
44
 };
45
 };
45
 
46
 
46
-/** MAD attribute handlers */
47
-#define IB_MAD_HANDLERS __table ( struct ib_mad_handler, "ib_mad_handlers" )
47
+/** GMA attribute handlers */
48
+#define IB_GMA_HANDLERS __table ( struct ib_gma_handler, "ib_gma_handlers" )
48
 
49
 
49
-/** Declare a MAD attribute handler */
50
-#define __ib_mad_handler __table_entry ( IB_MAD_HANDLERS, 01 )
50
+/** Declare a GMA attribute handler */
51
+#define __ib_gma_handler __table_entry ( IB_GMA_HANDLERS, 01 )
51
 
52
 
52
 /** An Infiniband General Management Agent */
53
 /** An Infiniband General Management Agent */
53
 struct ib_gma {
54
 struct ib_gma {

+ 9
- 12
src/net/infiniband/ib_gma.c 查看文件

75
 static unsigned int next_request_tid;
75
 static unsigned int next_request_tid;
76
 
76
 
77
 /**
77
 /**
78
- * Identify attribute handler
78
+ * Call attribute handler
79
  *
79
  *
80
- * @v mgmt_class	Management class
81
- * @v class_version	Class version
82
- * @v method		Method
83
- * @v attr_id		Attribute ID (in network byte order)
84
- * @ret handler		Attribute handler (or NULL)
80
+ * @v gma		General management agent
81
+ * @v mad		MAD
82
+ * @ret rc		Return status code
85
  */
83
  */
86
-static int ib_handle_mad ( struct ib_device *ibdev,
87
-			   union ib_mad *mad ) {
84
+static int ib_handle_mad ( struct ib_gma *gma, union ib_mad *mad ) {
88
 	struct ib_mad_hdr *hdr = &mad->hdr;
85
 	struct ib_mad_hdr *hdr = &mad->hdr;
89
-	struct ib_mad_handler *handler;
86
+	struct ib_gma_handler *handler;
90
 
87
 
91
-	for_each_table_entry ( handler, IB_MAD_HANDLERS ) {
88
+	for_each_table_entry ( handler, IB_GMA_HANDLERS ) {
92
 		if ( ( handler->mgmt_class == hdr->mgmt_class ) &&
89
 		if ( ( handler->mgmt_class == hdr->mgmt_class ) &&
93
 		     ( handler->class_version == hdr->class_version ) &&
90
 		     ( handler->class_version == hdr->class_version ) &&
94
 		     ( handler->method == hdr->method ) &&
91
 		     ( handler->method == hdr->method ) &&
95
 		     ( handler->attr_id == hdr->attr_id ) ) {
92
 		     ( handler->attr_id == hdr->attr_id ) ) {
96
 			hdr->method = handler->resp_method;
93
 			hdr->method = handler->resp_method;
97
-			return handler->handle ( ibdev, mad );
94
+			return handler->handle ( gma, mad );
98
 		}
95
 		}
99
 	}
96
 	}
100
 
97
 
163
 	}
160
 	}
164
 
161
 
165
 	/* Handle MAD, if possible */
162
 	/* Handle MAD, if possible */
166
-	if ( ( rc = ib_handle_mad ( ibdev, mad ) ) != 0 ) {
163
+	if ( ( rc = ib_handle_mad ( gma, mad ) ) != 0 ) {
167
 		DBGC ( gma, "GMA %p could not handle TID %08x%08x: %s\n",
164
 		DBGC ( gma, "GMA %p could not handle TID %08x%08x: %s\n",
168
 		       gma, ntohl ( hdr->tid[0] ), ntohl ( hdr->tid[1] ),
165
 		       gma, ntohl ( hdr->tid[0] ), ntohl ( hdr->tid[1] ),
169
 		       strerror ( rc ) );
166
 		       strerror ( rc ) );

+ 35
- 35
src/net/infiniband/ib_mcast.c 查看文件

36
 /**
36
 /**
37
  * Transmit multicast group membership request
37
  * Transmit multicast group membership request
38
  *
38
  *
39
- * @v ibdev		Infiniband device
39
+ * @v gma		General management agent
40
  * @v gid		Multicast GID
40
  * @v gid		Multicast GID
41
  * @v join		Join (rather than leave) group
41
  * @v join		Join (rather than leave) group
42
  * @ret rc		Return status code
42
  * @ret rc		Return status code
43
  */
43
  */
44
-static int ib_mc_member_request ( struct ib_device *ibdev, struct ib_gid *gid,
44
+static int ib_mc_member_request ( struct ib_gma *gma, struct ib_gid *gid,
45
 				  int join ) {
45
 				  int join ) {
46
 	union ib_mad mad;
46
 	union ib_mad mad;
47
 	struct ib_mad_sa *sa = &mad.sa;
47
 	struct ib_mad_sa *sa = &mad.sa;
61
 	sa->sa_data.mc_member_record.scope__join_state = 1;
61
 	sa->sa_data.mc_member_record.scope__join_state = 1;
62
 	memcpy ( &sa->sa_data.mc_member_record.mgid, gid,
62
 	memcpy ( &sa->sa_data.mc_member_record.mgid, gid,
63
 		 sizeof ( sa->sa_data.mc_member_record.mgid ) );
63
 		 sizeof ( sa->sa_data.mc_member_record.mgid ) );
64
-	memcpy ( &sa->sa_data.mc_member_record.port_gid, &ibdev->gid,
64
+	memcpy ( &sa->sa_data.mc_member_record.port_gid, &gma->ibdev->gid,
65
 		 sizeof ( sa->sa_data.mc_member_record.port_gid ) );
65
 		 sizeof ( sa->sa_data.mc_member_record.port_gid ) );
66
 
66
 
67
 	/* Issue multicast membership record request */
67
 	/* Issue multicast membership record request */
68
-	if ( ( rc = ib_gma_request ( &ibdev->gma, &mad, NULL,
69
-				     join ) ) != 0 ) {
70
-		DBGC ( ibdev, "IBDEV %p could not join group: %s\n",
71
-		       ibdev, strerror ( rc ) );
68
+	if ( ( rc = ib_gma_request ( gma, &mad, NULL, join ) ) != 0 ) {
69
+		DBGC ( gma, "GMA %p could not join group: %s\n",
70
+		       gma, strerror ( rc ) );
72
 		return rc;
71
 		return rc;
73
 	}
72
 	}
74
 
73
 
85
  */
84
  */
86
 int ib_mcast_join ( struct ib_device *ibdev, struct ib_queue_pair *qp,
85
 int ib_mcast_join ( struct ib_device *ibdev, struct ib_queue_pair *qp,
87
 		    struct ib_gid *gid ) {
86
 		    struct ib_gid *gid ) {
87
+	struct ib_gma *gma = &ibdev->gma;
88
 	int rc;
88
 	int rc;
89
 
89
 
90
-	DBGC ( ibdev, "IBDEV %p QPN %lx joining %08x:%08x:%08x:%08x\n",
91
-	       ibdev, qp->qpn, ntohl ( gid->u.dwords[0] ),
90
+	DBGC ( gma, "GMA %p QPN %lx joining %08x:%08x:%08x:%08x\n",
91
+	       gma, qp->qpn, ntohl ( gid->u.dwords[0] ),
92
 	       ntohl ( gid->u.dwords[1] ), ntohl ( gid->u.dwords[2] ),
92
 	       ntohl ( gid->u.dwords[1] ), ntohl ( gid->u.dwords[2] ),
93
 	       ntohl ( gid->u.dwords[3] ) );
93
 	       ntohl ( gid->u.dwords[3] ) );
94
 
94
 
95
 	/* Attach queue pair to multicast GID */
95
 	/* Attach queue pair to multicast GID */
96
 	if ( ( rc = ib_mcast_attach ( ibdev, qp, gid ) ) != 0 ) {
96
 	if ( ( rc = ib_mcast_attach ( ibdev, qp, gid ) ) != 0 ) {
97
-		DBGC ( ibdev, "IBDEV %p could not attach: %s\n",
98
-		       ibdev, strerror ( rc ) );
97
+		DBGC ( gma, "GMA %p could not attach: %s\n",
98
+		       gma, strerror ( rc ) );
99
 		goto err_mcast_attach;
99
 		goto err_mcast_attach;
100
 	}
100
 	}
101
 
101
 
102
 	/* Initiate multicast membership join */
102
 	/* Initiate multicast membership join */
103
-	if ( ( rc = ib_mc_member_request ( ibdev, gid, 1 ) ) != 0 )
103
+	if ( ( rc = ib_mc_member_request ( gma, gid, 1 ) ) != 0 )
104
 		goto err_mc_member_record;
104
 		goto err_mc_member_record;
105
 
105
 
106
 	return 0;
106
 	return 0;
120
  */
120
  */
121
 void ib_mcast_leave ( struct ib_device *ibdev, struct ib_queue_pair *qp,
121
 void ib_mcast_leave ( struct ib_device *ibdev, struct ib_queue_pair *qp,
122
 		      struct ib_gid *gid ) {
122
 		      struct ib_gid *gid ) {
123
+	struct ib_gma *gma = &ibdev->gma;
123
 
124
 
124
-	DBGC ( ibdev, "IBDEV %p QPN %lx leaving %08x:%08x:%08x:%08x\n",
125
-	       ibdev, qp->qpn, ntohl ( gid->u.dwords[0] ),
125
+	DBGC ( gma, "GMA %p QPN %lx leaving %08x:%08x:%08x:%08x\n",
126
+	       gma, qp->qpn, ntohl ( gid->u.dwords[0] ),
126
 	       ntohl ( gid->u.dwords[1] ), ntohl ( gid->u.dwords[2] ),
127
 	       ntohl ( gid->u.dwords[1] ), ntohl ( gid->u.dwords[2] ),
127
 	       ntohl ( gid->u.dwords[3] ) );
128
 	       ntohl ( gid->u.dwords[3] ) );
128
 
129
 
130
 	ib_mcast_detach ( ibdev, qp, gid );
131
 	ib_mcast_detach ( ibdev, qp, gid );
131
 
132
 
132
 	/* Initiate multicast membership leave */
133
 	/* Initiate multicast membership leave */
133
-	ib_mc_member_request ( ibdev, gid, 0 );
134
+	ib_mc_member_request ( gma, gid, 0 );
134
 }
135
 }
135
 
136
 
136
 /**
137
 /**
137
  * Handle multicast membership record join response
138
  * Handle multicast membership record join response
138
  *
139
  *
139
- * @v ibdev		Infiniband device
140
+ * @v gma		General management agent
140
  * @v mad		MAD
141
  * @v mad		MAD
141
  * @ret rc		Return status code
142
  * @ret rc		Return status code
142
  */
143
  */
143
-static int ib_handle_mc_member_join ( struct ib_device *ibdev,
144
+static int ib_handle_mc_member_join ( struct ib_gma *gma,
144
 				      union ib_mad *mad ) {
145
 				      union ib_mad *mad ) {
146
+	struct ib_device *ibdev = gma->ibdev;
145
 	struct ib_mc_member_record *mc_member_record =
147
 	struct ib_mc_member_record *mc_member_record =
146
 		&mad->sa.sa_data.mc_member_record;
148
 		&mad->sa.sa_data.mc_member_record;
147
 	struct ib_queue_pair *qp;
149
 	struct ib_queue_pair *qp;
151
 
153
 
152
 	/* Ignore if not a success */
154
 	/* Ignore if not a success */
153
 	if ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ) {
155
 	if ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ) {
154
-		DBGC ( ibdev, "IBDEV %p join failed with status %04x\n",
155
-		       ibdev, ntohs ( mad->hdr.status ) );
156
+		DBGC ( gma, "GMA %p join failed with status %04x\n",
157
+		       gma, ntohs ( mad->hdr.status ) );
156
 		return -EINVAL;
158
 		return -EINVAL;
157
 	}
159
 	}
158
 
160
 
163
 	/* Locate matching queue pair */
165
 	/* Locate matching queue pair */
164
 	qp = ib_find_qp_mgid ( ibdev, gid );
166
 	qp = ib_find_qp_mgid ( ibdev, gid );
165
 	if ( ! qp ) {
167
 	if ( ! qp ) {
166
-		DBGC ( ibdev, "IBDEV %p has no QP to join "
167
-		       "%08x:%08x:%08x:%08x\n", ibdev,
168
-		       ntohl ( gid->u.dwords[0] ),
168
+		DBGC ( gma, "GMA %p has no QP to join %08x:%08x:%08x:%08x\n",
169
+		       gma, ntohl ( gid->u.dwords[0] ),
169
 		       ntohl ( gid->u.dwords[1] ),
170
 		       ntohl ( gid->u.dwords[1] ),
170
 		       ntohl ( gid->u.dwords[2] ),
171
 		       ntohl ( gid->u.dwords[2] ),
171
 		       ntohl ( gid->u.dwords[3] ) );
172
 		       ntohl ( gid->u.dwords[3] ) );
172
 		return -ENOENT;
173
 		return -ENOENT;
173
 	}
174
 	}
174
-	DBGC ( ibdev, "IBDEV %p QPN %lx joined %08x:%08x:%08x:%08x qkey "
175
-	       "%lx\n", ibdev, qp->qpn,
176
-	       ntohl ( gid->u.dwords[0] ), ntohl ( gid->u.dwords[1] ),
177
-	       ntohl ( gid->u.dwords[2] ), ntohl ( gid->u.dwords[3] ),
178
-	       qkey );
175
+	DBGC ( gma, "GMA %p QPN %lx joined %08x:%08x:%08x:%08x qkey %lx\n",
176
+	       gma, qp->qpn, ntohl ( gid->u.dwords[0] ),
177
+	       ntohl ( gid->u.dwords[1] ), ntohl ( gid->u.dwords[2] ),
178
+	       ntohl ( gid->u.dwords[3] ), qkey );
179
 
179
 
180
 	/* Set queue key */
180
 	/* Set queue key */
181
 	if ( ( rc = ib_modify_qp ( ibdev, qp, IB_MODIFY_QKEY, qkey ) ) != 0 ) {
181
 	if ( ( rc = ib_modify_qp ( ibdev, qp, IB_MODIFY_QKEY, qkey ) ) != 0 ) {
182
-		DBGC ( ibdev, "IBDEV %p QPN %lx could not modify qkey: %s\n",
183
-		       ibdev, qp->qpn, strerror ( rc ) );
182
+		DBGC ( gma, "GMA %p QPN %lx could not modify qkey: %s\n",
183
+		       gma, qp->qpn, strerror ( rc ) );
184
 		return rc;
184
 		return rc;
185
 	}
185
 	}
186
 
186
 
190
 /**
190
 /**
191
  * Handle multicast membership record leave response
191
  * Handle multicast membership record leave response
192
  *
192
  *
193
- * @v ibdev		Infiniband device
193
+ * @v gma		General management agent
194
  * @v mad		MAD
194
  * @v mad		MAD
195
  * @ret rc		Return status code
195
  * @ret rc		Return status code
196
  */
196
  */
197
-static int ib_handle_mc_member_leave ( struct ib_device *ibdev,
197
+static int ib_handle_mc_member_leave ( struct ib_gma *gma,
198
 				       union ib_mad *mad ) {
198
 				       union ib_mad *mad ) {
199
 	struct ib_mc_member_record *mc_member_record =
199
 	struct ib_mc_member_record *mc_member_record =
200
 		&mad->sa.sa_data.mc_member_record;
200
 		&mad->sa.sa_data.mc_member_record;
202
 
202
 
203
 	/* Ignore if not a success */
203
 	/* Ignore if not a success */
204
 	if ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ) {
204
 	if ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ) {
205
-		DBGC ( ibdev, "IBDEV %p leave failed with status %04x\n",
206
-		       ibdev, ntohs ( mad->hdr.status ) );
205
+		DBGC ( gma, "GMA %p leave failed with status %04x\n",
206
+		       gma, ntohs ( mad->hdr.status ) );
207
 		return -EINVAL;
207
 		return -EINVAL;
208
 	}
208
 	}
209
 
209
 
210
 	/* Extract MAD parameters */
210
 	/* Extract MAD parameters */
211
 	gid = &mc_member_record->mgid;
211
 	gid = &mc_member_record->mgid;
212
-	DBGC ( ibdev, "IBDEV %p left %08x:%08x:%08x:%08x\n", ibdev,
212
+	DBGC ( gma, "GMA %p left %08x:%08x:%08x:%08x\n", gma,
213
 	       ntohl ( gid->u.dwords[0] ), ntohl ( gid->u.dwords[1] ),
213
 	       ntohl ( gid->u.dwords[0] ), ntohl ( gid->u.dwords[1] ),
214
 	       ntohl ( gid->u.dwords[2] ), ntohl ( gid->u.dwords[3] ) );
214
 	       ntohl ( gid->u.dwords[2] ), ntohl ( gid->u.dwords[3] ) );
215
 
215
 
217
 }
217
 }
218
 
218
 
219
 /** Multicast membership record response handler */
219
 /** Multicast membership record response handler */
220
-struct ib_mad_handler ib_mc_member_record_handlers[] __ib_mad_handler = {
220
+struct ib_gma_handler ib_mc_member_record_handlers[] __ib_gma_handler = {
221
 	{
221
 	{
222
 		.mgmt_class = IB_MGMT_CLASS_SUBN_ADM,
222
 		.mgmt_class = IB_MGMT_CLASS_SUBN_ADM,
223
 		.class_version = IB_SA_CLASS_VERSION,
223
 		.class_version = IB_SA_CLASS_VERSION,

+ 19
- 17
src/net/infiniband/ib_pathrec.c 查看文件

98
  */
98
  */
99
 int ib_resolve_path ( struct ib_device *ibdev,
99
 int ib_resolve_path ( struct ib_device *ibdev,
100
 		      struct ib_address_vector *av ) {
100
 		      struct ib_address_vector *av ) {
101
+	struct ib_gma *gma = &ibdev->gma;
101
 	struct ib_gid *gid = &av->gid;
102
 	struct ib_gid *gid = &av->gid;
102
 	struct ib_cached_path_record *cached;
103
 	struct ib_cached_path_record *cached;
103
 	union ib_mad mad;
104
 	union ib_mad mad;
107
 
108
 
108
 	/* Sanity check */
109
 	/* Sanity check */
109
 	if ( ! av->gid_present ) {
110
 	if ( ! av->gid_present ) {
110
-		DBGC ( ibdev, "IBDEV %p attempt to look up path record "
111
-		       "without GID\n", ibdev );
111
+		DBGC ( gma, "GMA %p attempt to look up path record "
112
+		       "without GID\n", gma );
112
 		return -EINVAL;
113
 		return -EINVAL;
113
 	}
114
 	}
114
 
115
 
119
 		av->lid = cached->dlid;
120
 		av->lid = cached->dlid;
120
 		av->rate = cached->rate;
121
 		av->rate = cached->rate;
121
 		av->sl = cached->sl;
122
 		av->sl = cached->sl;
122
-		DBGC2 ( ibdev, "IBDEV %p cache hit for %08x:%08x:%08x:%08x\n",
123
-			ibdev, htonl ( gid->u.dwords[0] ),
123
+		DBGC2 ( gma, "GMA %p cache hit for %08x:%08x:%08x:%08x\n",
124
+			gma, htonl ( gid->u.dwords[0] ),
124
 			htonl ( gid->u.dwords[1] ), htonl ( gid->u.dwords[2] ),
125
 			htonl ( gid->u.dwords[1] ), htonl ( gid->u.dwords[2] ),
125
 			htonl ( gid->u.dwords[3] ) );
126
 			htonl ( gid->u.dwords[3] ) );
126
 		return 0;
127
 		return 0;
127
 	}
128
 	}
128
-	DBGC ( ibdev, "IBDEV %p cache miss for %08x:%08x:%08x:%08x%s\n", ibdev,
129
+	DBGC ( gma, "GMA %p cache miss for %08x:%08x:%08x:%08x%s\n", gma,
129
 	       htonl ( gid->u.dwords[0] ), htonl ( gid->u.dwords[1] ),
130
 	       htonl ( gid->u.dwords[0] ), htonl ( gid->u.dwords[1] ),
130
 	       htonl ( gid->u.dwords[2] ), htonl ( gid->u.dwords[3] ),
131
 	       htonl ( gid->u.dwords[2] ), htonl ( gid->u.dwords[3] ),
131
 	       ( cached ? " (in progress)" : "" ) );
132
 	       ( cached ? " (in progress)" : "" ) );
154
 		 sizeof ( sa->sa_data.path_record.sgid ) );
155
 		 sizeof ( sa->sa_data.path_record.sgid ) );
155
 
156
 
156
 	/* Issue path record request */
157
 	/* Issue path record request */
157
-	if ( ( rc = ib_gma_request ( &ibdev->gma, &mad, NULL, 1 ) ) != 0 ) {
158
-		DBGC ( ibdev, "IBDEV %p could not get path record: %s\n",
159
-		       ibdev, strerror ( rc ) );
158
+	if ( ( rc = ib_gma_request ( gma, &mad, NULL, 1 ) ) != 0 ) {
159
+		DBGC ( gma, "GMA %p could not get path record: %s\n",
160
+		       gma, strerror ( rc ) );
160
 		return rc;
161
 		return rc;
161
 	}
162
 	}
162
 
163
 
167
 /**
168
 /**
168
  * Handle path record response
169
  * Handle path record response
169
  *
170
  *
170
- * @v ibdev		Infiniband device
171
+ * @v gma		General management agent
171
  * @v mad		MAD
172
  * @v mad		MAD
172
  * @ret rc		Return status code
173
  * @ret rc		Return status code
173
  */
174
  */
174
-static int ib_handle_path_record ( struct ib_device *ibdev,
175
+static int ib_handle_path_record ( struct ib_gma *gma,
175
 				   union ib_mad *mad ) {
176
 				   union ib_mad *mad ) {
177
+	struct ib_device *ibdev = gma->ibdev;
176
 	struct ib_path_record *path_record = &mad->sa.sa_data.path_record;
178
 	struct ib_path_record *path_record = &mad->sa.sa_data.path_record;
177
 	struct ib_gid *dgid = &path_record->dgid;
179
 	struct ib_gid *dgid = &path_record->dgid;
178
 	struct ib_cached_path_record *cached;
180
 	struct ib_cached_path_record *cached;
182
 
184
 
183
 	/* Ignore if not a success */
185
 	/* Ignore if not a success */
184
 	if ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ) {
186
 	if ( mad->hdr.status != htons ( IB_MGMT_STATUS_OK ) ) {
185
-		DBGC ( ibdev, "IBDEV %p path record lookup failed with status "
186
-		       "%04x\n", ibdev, ntohs ( mad->hdr.status ) );
187
+		DBGC ( gma, "GMA %p path record lookup failed with status "
188
+		       "%04x\n", gma, ntohs ( mad->hdr.status ) );
187
 		return -EINVAL;
189
 		return -EINVAL;
188
 	}
190
 	}
189
 
191
 
191
 	dlid = ntohs ( path_record->dlid );
193
 	dlid = ntohs ( path_record->dlid );
192
 	sl = ( path_record->reserved__sl & 0x0f );
194
 	sl = ( path_record->reserved__sl & 0x0f );
193
 	rate = ( path_record->rate_selector__rate & 0x3f );
195
 	rate = ( path_record->rate_selector__rate & 0x3f );
194
-	DBGC ( ibdev, "IBDEV %p path to %08x:%08x:%08x:%08x is %04x sl %d "
195
-	       "rate %d\n", ibdev, htonl ( dgid->u.dwords[0] ),
196
+	DBGC ( gma, "GMA %p path to %08x:%08x:%08x:%08x is %04x sl %d "
197
+	       "rate %d\n", gma, htonl ( dgid->u.dwords[0] ),
196
 	       htonl ( dgid->u.dwords[1] ), htonl ( dgid->u.dwords[2] ),
198
 	       htonl ( dgid->u.dwords[1] ), htonl ( dgid->u.dwords[2] ),
197
 	       htonl ( dgid->u.dwords[3] ), dlid, sl, rate );
199
 	       htonl ( dgid->u.dwords[3] ), dlid, sl, rate );
198
 
200
 
199
 	/* Look for a matching cache entry to fill in */
201
 	/* Look for a matching cache entry to fill in */
200
 	if ( ( cached = ib_find_path_cache_entry ( ibdev, dgid ) ) != NULL ) {
202
 	if ( ( cached = ib_find_path_cache_entry ( ibdev, dgid ) ) != NULL ) {
201
-		DBGC ( ibdev, "IBDEV %p cache add for %08x:%08x:%08x:%08x\n",
202
-		       ibdev, htonl ( dgid->u.dwords[0] ),
203
+		DBGC ( gma, "GMA %p cache add for %08x:%08x:%08x:%08x\n",
204
+		       gma, htonl ( dgid->u.dwords[0] ),
203
 		       htonl ( dgid->u.dwords[1] ),
205
 		       htonl ( dgid->u.dwords[1] ),
204
 		       htonl ( dgid->u.dwords[2] ),
206
 		       htonl ( dgid->u.dwords[2] ),
205
 		       htonl ( dgid->u.dwords[3] ) );
207
 		       htonl ( dgid->u.dwords[3] ) );
212
 }
214
 }
213
 
215
 
214
 /** Path record response handler */
216
 /** Path record response handler */
215
-struct ib_mad_handler ib_path_record_handler __ib_mad_handler = {
217
+struct ib_gma_handler ib_path_record_handler __ib_gma_handler = {
216
 	.mgmt_class = IB_MGMT_CLASS_SUBN_ADM,
218
 	.mgmt_class = IB_MGMT_CLASS_SUBN_ADM,
217
 	.class_version = IB_SA_CLASS_VERSION,
219
 	.class_version = IB_SA_CLASS_VERSION,
218
 	.method = IB_MGMT_METHOD_GET_RESP,
220
 	.method = IB_MGMT_METHOD_GET_RESP,

Loading…
取消
儲存