|
@@ -235,6 +235,22 @@ arbel_cmd_init_hca ( struct arbel *arbel,
|
235
|
235
|
0, init_hca, 0, NULL );
|
236
|
236
|
}
|
237
|
237
|
|
|
238
|
+static inline int
|
|
239
|
+arbel_cmd_close_hca ( struct arbel *arbel ) {
|
|
240
|
+ return arbel_cmd ( arbel,
|
|
241
|
+ ARBEL_HCR_VOID_CMD ( ARBEL_HCR_CLOSE_HCA ),
|
|
242
|
+ 0, NULL, 0, NULL );
|
|
243
|
+}
|
|
244
|
+
|
|
245
|
+static inline int
|
|
246
|
+arbel_cmd_sw2hw_mpt ( struct arbel *arbel, unsigned int index,
|
|
247
|
+ const struct arbelprm_mpt *mpt ) {
|
|
248
|
+ return arbel_cmd ( arbel,
|
|
249
|
+ ARBEL_HCR_IN_CMD ( ARBEL_HCR_SW2HW_MPT,
|
|
250
|
+ 1, sizeof ( *mpt ) ),
|
|
251
|
+ 0, mpt, index, NULL );
|
|
252
|
+}
|
|
253
|
+
|
238
|
254
|
static inline int
|
239
|
255
|
arbel_cmd_sw2hw_cq ( struct arbel *arbel, unsigned long cqn,
|
240
|
256
|
const struct arbelprm_completion_queue_context *cqctx ) {
|
|
@@ -405,6 +421,16 @@ arbel_cmd_map_fa ( struct arbel *arbel,
|
405
|
421
|
0, map, 1, NULL );
|
406
|
422
|
}
|
407
|
423
|
|
|
424
|
+/***************************************************************************
|
|
425
|
+ *
|
|
426
|
+ * Event queue operations
|
|
427
|
+ *
|
|
428
|
+ ***************************************************************************
|
|
429
|
+ */
|
|
430
|
+
|
|
431
|
+static int arbel_create_eq ( struct arbel *arbel ) {
|
|
432
|
+}
|
|
433
|
+
|
408
|
434
|
/***************************************************************************
|
409
|
435
|
*
|
410
|
436
|
* Completion queue operations
|
|
@@ -1800,6 +1826,42 @@ static void arbel_free_icm ( struct arbel *arbel ) {
|
1800
|
1826
|
***************************************************************************
|
1801
|
1827
|
*/
|
1802
|
1828
|
|
|
1829
|
+/**
|
|
1830
|
+ * Set up memory protection table
|
|
1831
|
+ *
|
|
1832
|
+ * @v arbel Arbel device
|
|
1833
|
+ * @ret rc Return status code
|
|
1834
|
+ */
|
|
1835
|
+static int arbel_setup_mpt ( struct arbel *arbel ) {
|
|
1836
|
+ struct arbelprm_mpt mpt;
|
|
1837
|
+ uint32_t key;
|
|
1838
|
+ int rc;
|
|
1839
|
+
|
|
1840
|
+ /* Derive key */
|
|
1841
|
+ key = ( arbel->limits.reserved_mrws | ARBEL_MKEY_PREFIX );
|
|
1842
|
+ arbel->reserved_lkey = ( ( key << 8 ) | ( key >> 24 ) );
|
|
1843
|
+
|
|
1844
|
+ /* Initialise memory protection table */
|
|
1845
|
+ memset ( &mpt, 0, sizeof ( mpt ) );
|
|
1846
|
+ MLX_FILL_4 ( &mpt, 0,
|
|
1847
|
+ r_w, 1,
|
|
1848
|
+ pa, 1,
|
|
1849
|
+ lr, 1,
|
|
1850
|
+ lw, 1 );
|
|
1851
|
+ MLX_FILL_1 ( &mpt, 2, mem_key, key );
|
|
1852
|
+ MLX_FILL_1 ( &mpt, 3, pd, ARBEL_GLOBAL_PD );
|
|
1853
|
+ MLX_FILL_1 ( &mpt, 6, reg_wnd_len_h, 0xffffffffUL );
|
|
1854
|
+ MLX_FILL_1 ( &mpt, 7, reg_wnd_len_l, 0xffffffffUL );
|
|
1855
|
+ if ( ( rc = arbel_cmd_sw2hw_mpt ( arbel, arbel->limits.reserved_mrws,
|
|
1856
|
+ &mpt ) ) != 0 ) {
|
|
1857
|
+ DBGC ( arbel, "Arbel %p could not set up MPT: %s\n",
|
|
1858
|
+ arbel, strerror ( rc ) );
|
|
1859
|
+ return rc;
|
|
1860
|
+ }
|
|
1861
|
+
|
|
1862
|
+ return 0;
|
|
1863
|
+}
|
|
1864
|
+
|
1803
|
1865
|
/**
|
1804
|
1866
|
* Probe PCI device
|
1805
|
1867
|
*
|
|
@@ -1878,6 +1940,12 @@ static int arbel_probe ( struct pci_device *pci,
|
1878
|
1940
|
arbel, strerror ( rc ) );
|
1879
|
1941
|
goto err_init_hca;
|
1880
|
1942
|
}
|
|
1943
|
+
|
|
1944
|
+ /* Set up memory protection */
|
|
1945
|
+ if ( ( rc = arbel_setup_mpt ( arbel ) ) != 0 )
|
|
1946
|
+ goto err_setup_mpt;
|
|
1947
|
+
|
|
1948
|
+
|
1881
|
1949
|
#endif
|
1882
|
1950
|
|
1883
|
1951
|
|
|
@@ -1889,8 +1957,10 @@ static int arbel_probe ( struct pci_device *pci,
|
1889
|
1957
|
arbel->mailbox_in = dev_buffers_p->inprm_buf;
|
1890
|
1958
|
arbel->mailbox_out = dev_buffers_p->outprm_buf;
|
1891
|
1959
|
#endif
|
1892
|
|
- arbel->db_rec = dev_ib_data.uar_context_base;
|
|
1960
|
+#if ! SELF_INIT
|
1893
|
1961
|
arbel->reserved_lkey = dev_ib_data.mkey;
|
|
1962
|
+#endif
|
|
1963
|
+ arbel->db_rec = dev_ib_data.uar_context_base;
|
1894
|
1964
|
arbel->eqn = dev_ib_data.eq.eqn;
|
1895
|
1965
|
|
1896
|
1966
|
|
|
@@ -1912,7 +1982,8 @@ static int arbel_probe ( struct pci_device *pci,
|
1912
|
1982
|
ib_driver_close ( 0 );
|
1913
|
1983
|
err_ib_driver_init:
|
1914
|
1984
|
|
1915
|
|
-
|
|
1985
|
+ err_setup_mpt:
|
|
1986
|
+ arbel_cmd_close_hca ( arbel );
|
1916
|
1987
|
err_init_hca:
|
1917
|
1988
|
arbel_free_icm ( arbel );
|
1918
|
1989
|
err_alloc_icm:
|