|
@@ -27,12 +27,13 @@ struct arbel_send_work_queue {
|
27
|
27
|
/** Doorbell number */
|
28
|
28
|
unsigned int doorbell_idx;
|
29
|
29
|
/** Work queue entries */
|
30
|
|
- struct ud_send_wqe_st *wqe;
|
|
30
|
+ // struct ud_send_wqe_st *wqe;
|
|
31
|
+ union ud_send_wqe_u *wqe_u;
|
31
|
32
|
};
|
32
|
33
|
|
33
|
34
|
struct arbel {
|
34
|
35
|
/** User Access Region */
|
35
|
|
- unsigned long uar;
|
|
36
|
+ void *uar;
|
36
|
37
|
/** Doorbell records */
|
37
|
38
|
union db_record_st *db_rec;
|
38
|
39
|
};
|
|
@@ -88,7 +89,6 @@ static uint8_t ib_broadcast[IB_ALEN] = { 0xff, };
|
88
|
89
|
static int mlx_transmit ( struct net_device *netdev,
|
89
|
90
|
struct io_buffer *iobuf ) {
|
90
|
91
|
struct mlx_nic *mlx = netdev->priv;
|
91
|
|
- ud_av_t av = iobuf->data;
|
92
|
92
|
ud_send_wqe_t snd_wqe;
|
93
|
93
|
int rc;
|
94
|
94
|
|
|
@@ -110,6 +110,58 @@ static int mlx_transmit ( struct net_device *netdev,
|
110
|
110
|
return 0;
|
111
|
111
|
}
|
112
|
112
|
|
|
113
|
+static int arbel_post_send ( struct ib_device *ibdev, struct io_buffer *iobuf,
|
|
114
|
+ struct ib_address_vector *av,
|
|
115
|
+ struct ib_queue_pair *qp );
|
|
116
|
+
|
|
117
|
+static struct io_buffer *tx_ring[NUM_IPOIB_SND_WQES];
|
|
118
|
+static int tx_posted = 0;
|
|
119
|
+
|
|
120
|
+static int mlx_transmit_direct ( struct net_device *netdev,
|
|
121
|
+ struct io_buffer *iobuf ) {
|
|
122
|
+ struct mlx_nic *mlx = netdev->priv;
|
|
123
|
+ int rc;
|
|
124
|
+
|
|
125
|
+ struct arbel arbel = {
|
|
126
|
+ .uar = memfree_pci_dev.uar,
|
|
127
|
+ .db_rec = dev_ib_data.uar_context_base,
|
|
128
|
+ };
|
|
129
|
+ struct arbel_send_work_queue arbel_send_queue = {
|
|
130
|
+ .doorbell_idx = IPOIB_SND_QP_DB_IDX,
|
|
131
|
+ .wqe_u = ( (struct udqp_st *) ipoib_data.ipoib_qph )->snd_wq,
|
|
132
|
+ };
|
|
133
|
+ struct ib_device ibdev = {
|
|
134
|
+ .priv = &arbel,
|
|
135
|
+ };
|
|
136
|
+ struct ib_queue_pair qp = {
|
|
137
|
+ .qpn = ib_get_qpn ( mlx->ipoib_qph ),
|
|
138
|
+ .send = {
|
|
139
|
+ .num_wqes = NUM_IPOIB_SND_WQES,
|
|
140
|
+ .posted = tx_posted,
|
|
141
|
+ .iobufs = tx_ring,
|
|
142
|
+ .priv = &arbel_send_queue,
|
|
143
|
+ },
|
|
144
|
+ };
|
|
145
|
+ struct ud_av_st *bcast_av = mlx->bcast_av;
|
|
146
|
+ struct address_vector_st *bav = &bcast_av->av;
|
|
147
|
+ struct ib_address_vector av = {
|
|
148
|
+ .dest_qp = bcast_av->dest_qp,
|
|
149
|
+ .qkey = bcast_av->qkey,
|
|
150
|
+ .dlid = MLX_EXTRACT ( bav, arbelprm_ud_address_vector_st, rlid ),
|
|
151
|
+ .rate = ( MLX_EXTRACT ( bav, arbelprm_ud_address_vector_st, max_stat_rate ) ? 1 : 4 ),
|
|
152
|
+ .sl = MLX_EXTRACT ( bav, arbelprm_ud_address_vector_st, sl ),
|
|
153
|
+ .gid_present = 1,
|
|
154
|
+ };
|
|
155
|
+ memcpy ( &av.gid, ( ( void * ) bav ) + 16, 16 );
|
|
156
|
+
|
|
157
|
+ rc = arbel_post_send ( &ibdev, iobuf, &av, &qp );
|
|
158
|
+
|
|
159
|
+ tx_posted = qp.send.posted;
|
|
160
|
+
|
|
161
|
+ return rc;
|
|
162
|
+}
|
|
163
|
+
|
|
164
|
+
|
113
|
165
|
/**
|
114
|
166
|
* Handle TX completion
|
115
|
167
|
*
|
|
@@ -234,7 +286,7 @@ static void mlx_irq ( struct net_device *netdev, int enable ) {
|
234
|
286
|
static struct net_device_operations mlx_operations = {
|
235
|
287
|
.open = mlx_open,
|
236
|
288
|
.close = mlx_close,
|
237
|
|
- .transmit = mlx_transmit,
|
|
289
|
+ .transmit = mlx_transmit_direct,
|
238
|
290
|
.poll = mlx_poll,
|
239
|
291
|
.irq = mlx_irq,
|
240
|
292
|
};
|
|
@@ -274,12 +326,13 @@ static int arbel_post_send ( struct ib_device *ibdev, struct io_buffer *iobuf,
|
274
|
326
|
/* Allocate work queue entry */
|
275
|
327
|
prev_wqe_idx = wq->posted;
|
276
|
328
|
wqe_idx = ( prev_wqe_idx + 1 );
|
277
|
|
- if ( wq->iobuf[wqe_idx & wqe_idx_mask] ) {
|
|
329
|
+ if ( wq->iobufs[wqe_idx & wqe_idx_mask] ) {
|
278
|
330
|
DBGC ( arbel, "ARBEL %p send queue full", arbel );
|
279
|
331
|
return -ENOBUFS;
|
280
|
332
|
}
|
281
|
|
- prev_wqe = &arbel_wq->wqe[prev_wqe_idx & wqe_idx_mask];
|
282
|
|
- wqe = &arbel_wq->wqe[wqe_idx & wqe_idx_mask];
|
|
333
|
+ wq->iobufs[wqe_idx & wqe_idx_mask] = iobuf;
|
|
334
|
+ prev_wqe = &arbel_wq->wqe_u[prev_wqe_idx & wqe_idx_mask].wqe_cont.wqe;
|
|
335
|
+ wqe = &arbel_wq->wqe_u[wqe_idx & wqe_idx_mask].wqe_cont.wqe;
|
283
|
336
|
|
284
|
337
|
/* Construct work queue entry */
|
285
|
338
|
memset ( &wqe->next.control, 0,
|