Browse Source

Hack up IB structures at start-of-day, instead of on each use.

tags/v0.9.3
Michael Brown 16 years ago
parent
commit
31b82ea1dd
1 changed files with 54 additions and 0 deletions
  1. 54
    0
      src/drivers/net/mlx_ipoib/mt25218.c

+ 54
- 0
src/drivers/net/mlx_ipoib/mt25218.c View File

@@ -38,6 +38,37 @@ struct mlx_nic {
38 38
 	cq_t rcv_cqh;
39 39
 };
40 40
 
41
+
42
+static struct io_buffer *static_ipoib_tx_ring[NUM_IPOIB_SND_WQES];
43
+
44
+static struct arbel static_arbel;
45
+static struct arbel_send_work_queue static_arbel_ipoib_send_wq = {
46
+	.doorbell_idx = IPOIB_SND_QP_DB_IDX,
47
+};
48
+static struct arbel_completion_queue static_arbel_ipoib_send_cq = {
49
+	.doorbell_idx = IPOIB_SND_CQ_CI_DB_IDX,
50
+};
51
+
52
+static struct ib_device static_ibdev = {
53
+	.dev_priv = &static_arbel,
54
+};
55
+static struct ib_queue_pair static_ipoib_qp = {
56
+	.send = {
57
+		.num_wqes = NUM_IPOIB_SND_WQES,
58
+		.iobufs = static_ipoib_tx_ring,
59
+		.dev_priv = &static_arbel_ipoib_send_wq,
60
+	},
61
+	.list = LIST_HEAD_INIT ( static_ipoib_qp.list ),
62
+};
63
+static struct ib_completion_queue static_ipoib_send_cq = {
64
+	.cqn = 1234, /* Only used for debug messages */
65
+	.num_cqes = NUM_IPOIB_SND_CQES,
66
+	.dev_priv = &static_arbel_ipoib_send_cq,
67
+	.queue_pairs = LIST_HEAD_INIT ( static_ipoib_send_cq.queue_pairs ),
68
+};
69
+
70
+
71
+
41 72
 /**
42 73
  * Open network device
43 74
  *
@@ -110,6 +141,7 @@ static int mlx_transmit_direct ( struct net_device *netdev,
110 141
 	struct mlx_nic *mlx = netdev->priv;
111 142
 	int rc;
112 143
 
144
+#if 0
113 145
 	struct arbel arbel = {
114 146
 		.uar = memfree_pci_dev.uar,
115 147
 		.db_rec = dev_ib_data.uar_context_base,
@@ -130,6 +162,7 @@ static int mlx_transmit_direct ( struct net_device *netdev,
130 162
 			.dev_priv = &arbel_send_queue,
131 163
 		},
132 164
 	};
165
+#endif
133 166
 	struct ud_av_st *bcast_av = mlx->bcast_av;
134 167
 	struct arbelprm_ud_address_vector *bav =
135 168
 		( struct arbelprm_ud_address_vector * ) &bcast_av->av;
@@ -143,9 +176,13 @@ static int mlx_transmit_direct ( struct net_device *netdev,
143 176
 	};
144 177
 	memcpy ( &av.gid, ( ( void * ) bav ) + 16, 16 );
145 178
 
179
+#if 0
146 180
 	rc = arbel_post_send ( &ibdev, &qp, &av, iobuf );
147 181
 
148 182
 	next_tx_idx = qp.send.next_idx;
183
+#endif
184
+	rc = arbel_post_send ( &static_ibdev, &static_ipoib_qp, &av, iobuf );
185
+
149 186
 
150 187
 	return rc;
151 188
 }
@@ -179,6 +216,7 @@ static int next_cq_idx = 0;
179 216
 static void mlx_poll_cq_direct ( struct net_device *netdev ) {
180 217
 	struct mlx_nic *mlx = netdev->priv;
181 218
 
219
+#if 0
182 220
 	struct arbel arbel = {
183 221
 		.uar = memfree_pci_dev.uar,
184 222
 		.db_rec = dev_ib_data.uar_context_base,
@@ -218,6 +256,10 @@ static void mlx_poll_cq_direct ( struct net_device *netdev ) {
218 256
 	arbel_poll_cq ( &ibdev, &cq, temp_complete_send, temp_complete_recv );
219 257
 
220 258
 	next_cq_idx = cq.next_idx;
259
+#endif
260
+
261
+	arbel_poll_cq ( &static_ibdev, &static_ipoib_send_cq,
262
+			temp_complete_send, temp_complete_recv );
221 263
 }
222 264
 
223 265
 /**
@@ -674,6 +716,18 @@ static int arbel_probe ( struct pci_device *pci,
674 716
 	mac->qpn = htonl ( ib_get_qpn ( mlx->ipoib_qph ) );
675 717
 	memcpy ( &mac->gid, ib_data.port_gid.raw, sizeof ( mac->gid ) );
676 718
 
719
+	/* Hack up IB structures */
720
+	static_arbel.uar = memfree_pci_dev.uar;
721
+	static_arbel.db_rec = dev_ib_data.uar_context_base;
722
+	static_arbel_ipoib_send_wq.wqe =
723
+		( ( struct udqp_st * ) qph )->snd_wq;
724
+	static_arbel_ipoib_send_cq.cqe =
725
+		( ( struct cq_st * ) ib_data.ipoib_snd_cq )->cq_buf;
726
+	static_ipoib_qp.qpn = ib_get_qpn ( qph );
727
+	static_ipoib_qp.priv = netdev;
728
+	list_add ( &static_ipoib_qp.list,
729
+		   &static_ipoib_send_cq.queue_pairs );
730
+
677 731
 	/* Register network device */
678 732
 	if ( ( rc = register_netdev ( netdev ) ) != 0 )
679 733
 		goto err_register_netdev;

Loading…
Cancel
Save