Browse Source

Proof-of-concept to manually parse completion event

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
e69863b5fb
1 changed files with 21 additions and 2 deletions
  1. 21
    2
      src/drivers/net/mlx_ipoib/mt25218.c

+ 21
- 2
src/drivers/net/mlx_ipoib/mt25218.c View File

27
 #include "mt_version.c"
27
 #include "mt_version.c"
28
 #include "mt25218_imp.c"
28
 #include "mt25218_imp.c"
29
 
29
 
30
-/* NIC specific static variables go here */
31
 
30
 
32
 int prompt_key(int secs, unsigned char *ch_p)
31
 int prompt_key(int secs, unsigned char *ch_p)
33
 {
32
 {
265
  * @v netdev		Network device
264
  * @v netdev		Network device
266
  * @v cq		Completion queue
265
  * @v cq		Completion queue
267
  */
266
  */
268
-static void mlx_poll_cq ( struct net_device *netdev, cq_t cq ) {
267
+static void mlx_poll_cq ( struct net_device *netdev,
268
+			  struct cq_st *cq ) {
269
 	struct mlx_nic *mlx = netdev->priv;
269
 	struct mlx_nic *mlx = netdev->priv;
270
 	struct ib_cqe_st cqe;
270
 	struct ib_cqe_st cqe;
271
 	uint8_t num_cqes;
271
 	uint8_t num_cqes;
272
 
272
 
273
 	while ( 1 ) {
273
 	while ( 1 ) {
274
+
275
+		unsigned long cons_idx;
276
+		union cqe_st *temp;
277
+
278
+		cons_idx = ( cq->cons_counter & ( cq->num_cqes - 1 ) );
279
+		temp = &cq->cq_buf[cons_idx];
280
+		if ( EX_FLD_BE ( temp, arbelprm_completion_queue_entry_st,
281
+				 owner ) == 0 ) {
282
+			DBG ( "software owned\n" );
283
+			DBGC_HD ( mlx, temp, sizeof ( *temp ) );
284
+			DBG ( "my_qpn=%lx, g=%ld, s=%ld, op=%02lx, cnt=%lx\n",
285
+			      EX_FLD_BE ( temp, arbelprm_completion_queue_entry_st, my_qpn ),
286
+			      EX_FLD_BE ( temp, arbelprm_completion_queue_entry_st, g ),
287
+			      EX_FLD_BE ( temp, arbelprm_completion_queue_entry_st, s ),
288
+			      EX_FLD_BE ( temp, arbelprm_completion_queue_entry_st, opcode ),
289
+			      EX_FLD_BE ( temp, arbelprm_completion_queue_entry_st, byte_cnt ) );
290
+		}
291
+
274
 		/* Poll for single completion queue entry */
292
 		/* Poll for single completion queue entry */
275
 		ib_poll_cq ( cq, &cqe, &num_cqes );
293
 		ib_poll_cq ( cq, &cqe, &num_cqes );
276
 
294
 
312
 		return;
330
 		return;
313
 	}
331
 	}
314
 
332
 
333
+	//	mlx_poll_cq ( netdev, ipoib_data.snd_cqh );
315
 	mlx_poll_cq ( netdev, ipoib_data.rcv_cqh );
334
 	mlx_poll_cq ( netdev, ipoib_data.rcv_cqh );
316
 }
335
 }
317
 
336
 

Loading…
Cancel
Save