|
@@ -30,7 +30,6 @@
|
30
|
30
|
#include <gpxe/umalloc.h>
|
31
|
31
|
#include <gpxe/iobuf.h>
|
32
|
32
|
#include <gpxe/netdevice.h>
|
33
|
|
-#include <gpxe/process.h>
|
34
|
33
|
#include <gpxe/infiniband.h>
|
35
|
34
|
#include "hermon.h"
|
36
|
35
|
|
|
@@ -1226,215 +1225,6 @@ static void hermon_poll_cq ( struct ib_device *ibdev,
|
1226
|
1225
|
}
|
1227
|
1226
|
}
|
1228
|
1227
|
|
1229
|
|
-/***************************************************************************
|
1230
|
|
- *
|
1231
|
|
- * Infiniband link-layer operations
|
1232
|
|
- *
|
1233
|
|
- ***************************************************************************
|
1234
|
|
- */
|
1235
|
|
-
|
1236
|
|
-/**
|
1237
|
|
- * Initialise Infiniband link
|
1238
|
|
- *
|
1239
|
|
- * @v ibdev Infiniband device
|
1240
|
|
- * @ret rc Return status code
|
1241
|
|
- */
|
1242
|
|
-static int hermon_open ( struct ib_device *ibdev ) {
|
1243
|
|
- struct hermon *hermon = ib_get_drvdata ( ibdev );
|
1244
|
|
- struct hermonprm_init_port init_port;
|
1245
|
|
- int rc;
|
1246
|
|
-
|
1247
|
|
- memset ( &init_port, 0, sizeof ( init_port ) );
|
1248
|
|
- MLX_FILL_2 ( &init_port, 0,
|
1249
|
|
- port_width_cap, 3,
|
1250
|
|
- vl_cap, 1 );
|
1251
|
|
- MLX_FILL_2 ( &init_port, 1,
|
1252
|
|
- mtu, HERMON_MTU_2048,
|
1253
|
|
- max_gid, 1 );
|
1254
|
|
- MLX_FILL_1 ( &init_port, 2, max_pkey, 64 );
|
1255
|
|
- if ( ( rc = hermon_cmd_init_port ( hermon, ibdev->port,
|
1256
|
|
- &init_port ) ) != 0 ) {
|
1257
|
|
- DBGC ( hermon, "Hermon %p could not intialise port: %s\n",
|
1258
|
|
- hermon, strerror ( rc ) );
|
1259
|
|
- return rc;
|
1260
|
|
- }
|
1261
|
|
-
|
1262
|
|
- return 0;
|
1263
|
|
-}
|
1264
|
|
-
|
1265
|
|
-/**
|
1266
|
|
- * Close Infiniband link
|
1267
|
|
- *
|
1268
|
|
- * @v ibdev Infiniband device
|
1269
|
|
- */
|
1270
|
|
-static void hermon_close ( struct ib_device *ibdev ) {
|
1271
|
|
- struct hermon *hermon = ib_get_drvdata ( ibdev );
|
1272
|
|
- int rc;
|
1273
|
|
-
|
1274
|
|
- if ( ( rc = hermon_cmd_close_port ( hermon, ibdev->port ) ) != 0 ) {
|
1275
|
|
- DBGC ( hermon, "Hermon %p could not close port: %s\n",
|
1276
|
|
- hermon, strerror ( rc ) );
|
1277
|
|
- /* Nothing we can do about this */
|
1278
|
|
- }
|
1279
|
|
-}
|
1280
|
|
-
|
1281
|
|
-/***************************************************************************
|
1282
|
|
- *
|
1283
|
|
- * Multicast group operations
|
1284
|
|
- *
|
1285
|
|
- ***************************************************************************
|
1286
|
|
- */
|
1287
|
|
-
|
1288
|
|
-/**
|
1289
|
|
- * Attach to multicast group
|
1290
|
|
- *
|
1291
|
|
- * @v ibdev Infiniband device
|
1292
|
|
- * @v qp Queue pair
|
1293
|
|
- * @v gid Multicast GID
|
1294
|
|
- * @ret rc Return status code
|
1295
|
|
- */
|
1296
|
|
-static int hermon_mcast_attach ( struct ib_device *ibdev,
|
1297
|
|
- struct ib_queue_pair *qp,
|
1298
|
|
- struct ib_gid *gid ) {
|
1299
|
|
- struct hermon *hermon = ib_get_drvdata ( ibdev );
|
1300
|
|
- struct hermonprm_mgm_hash hash;
|
1301
|
|
- struct hermonprm_mcg_entry mcg;
|
1302
|
|
- unsigned int index;
|
1303
|
|
- int rc;
|
1304
|
|
-
|
1305
|
|
- /* Generate hash table index */
|
1306
|
|
- if ( ( rc = hermon_cmd_mgid_hash ( hermon, gid, &hash ) ) != 0 ) {
|
1307
|
|
- DBGC ( hermon, "Hermon %p could not hash GID: %s\n",
|
1308
|
|
- hermon, strerror ( rc ) );
|
1309
|
|
- return rc;
|
1310
|
|
- }
|
1311
|
|
- index = MLX_GET ( &hash, hash );
|
1312
|
|
-
|
1313
|
|
- /* Check for existing hash table entry */
|
1314
|
|
- if ( ( rc = hermon_cmd_read_mcg ( hermon, index, &mcg ) ) != 0 ) {
|
1315
|
|
- DBGC ( hermon, "Hermon %p could not read MCG %#x: %s\n",
|
1316
|
|
- hermon, index, strerror ( rc ) );
|
1317
|
|
- return rc;
|
1318
|
|
- }
|
1319
|
|
- if ( MLX_GET ( &mcg, hdr.members_count ) != 0 ) {
|
1320
|
|
- /* FIXME: this implementation allows only a single QP
|
1321
|
|
- * per multicast group, and doesn't handle hash
|
1322
|
|
- * collisions. Sufficient for IPoIB but may need to
|
1323
|
|
- * be extended in future.
|
1324
|
|
- */
|
1325
|
|
- DBGC ( hermon, "Hermon %p MGID index %#x already in use\n",
|
1326
|
|
- hermon, index );
|
1327
|
|
- return -EBUSY;
|
1328
|
|
- }
|
1329
|
|
-
|
1330
|
|
- /* Update hash table entry */
|
1331
|
|
- MLX_FILL_1 ( &mcg, 1, hdr.members_count, 1 );
|
1332
|
|
- MLX_FILL_1 ( &mcg, 8, qp[0].qpn, qp->qpn );
|
1333
|
|
- memcpy ( &mcg.u.dwords[4], gid, sizeof ( *gid ) );
|
1334
|
|
- if ( ( rc = hermon_cmd_write_mcg ( hermon, index, &mcg ) ) != 0 ) {
|
1335
|
|
- DBGC ( hermon, "Hermon %p could not write MCG %#x: %s\n",
|
1336
|
|
- hermon, index, strerror ( rc ) );
|
1337
|
|
- return rc;
|
1338
|
|
- }
|
1339
|
|
-
|
1340
|
|
- return 0;
|
1341
|
|
-}
|
1342
|
|
-
|
1343
|
|
-/**
|
1344
|
|
- * Detach from multicast group
|
1345
|
|
- *
|
1346
|
|
- * @v ibdev Infiniband device
|
1347
|
|
- * @v qp Queue pair
|
1348
|
|
- * @v gid Multicast GID
|
1349
|
|
- */
|
1350
|
|
-static void hermon_mcast_detach ( struct ib_device *ibdev,
|
1351
|
|
- struct ib_queue_pair *qp __unused,
|
1352
|
|
- struct ib_gid *gid ) {
|
1353
|
|
- struct hermon *hermon = ib_get_drvdata ( ibdev );
|
1354
|
|
- struct hermonprm_mgm_hash hash;
|
1355
|
|
- struct hermonprm_mcg_entry mcg;
|
1356
|
|
- unsigned int index;
|
1357
|
|
- int rc;
|
1358
|
|
-
|
1359
|
|
- /* Generate hash table index */
|
1360
|
|
- if ( ( rc = hermon_cmd_mgid_hash ( hermon, gid, &hash ) ) != 0 ) {
|
1361
|
|
- DBGC ( hermon, "Hermon %p could not hash GID: %s\n",
|
1362
|
|
- hermon, strerror ( rc ) );
|
1363
|
|
- return;
|
1364
|
|
- }
|
1365
|
|
- index = MLX_GET ( &hash, hash );
|
1366
|
|
-
|
1367
|
|
- /* Clear hash table entry */
|
1368
|
|
- memset ( &mcg, 0, sizeof ( mcg ) );
|
1369
|
|
- if ( ( rc = hermon_cmd_write_mcg ( hermon, index, &mcg ) ) != 0 ) {
|
1370
|
|
- DBGC ( hermon, "Hermon %p could not write MCG %#x: %s\n",
|
1371
|
|
- hermon, index, strerror ( rc ) );
|
1372
|
|
- return;
|
1373
|
|
- }
|
1374
|
|
-}
|
1375
|
|
-
|
1376
|
|
-/***************************************************************************
|
1377
|
|
- *
|
1378
|
|
- * MAD operations
|
1379
|
|
- *
|
1380
|
|
- ***************************************************************************
|
1381
|
|
- */
|
1382
|
|
-
|
1383
|
|
-/**
|
1384
|
|
- * Issue management datagram
|
1385
|
|
- *
|
1386
|
|
- * @v ibdev Infiniband device
|
1387
|
|
- * @v mad Management datagram
|
1388
|
|
- * @v len Length of management datagram
|
1389
|
|
- * @ret rc Return status code
|
1390
|
|
- */
|
1391
|
|
-static int hermon_mad ( struct ib_device *ibdev, struct ib_mad_hdr *mad,
|
1392
|
|
- size_t len ) {
|
1393
|
|
- struct hermon *hermon = ib_get_drvdata ( ibdev );
|
1394
|
|
- union hermonprm_mad mad_ifc;
|
1395
|
|
- int rc;
|
1396
|
|
-
|
1397
|
|
- /* Copy in request packet */
|
1398
|
|
- memset ( &mad_ifc, 0, sizeof ( mad_ifc ) );
|
1399
|
|
- assert ( len <= sizeof ( mad_ifc.mad ) );
|
1400
|
|
- memcpy ( &mad_ifc.mad, mad, len );
|
1401
|
|
-
|
1402
|
|
- /* Issue MAD */
|
1403
|
|
- if ( ( rc = hermon_cmd_mad_ifc ( hermon, ibdev->port,
|
1404
|
|
- &mad_ifc ) ) != 0 ) {
|
1405
|
|
- DBGC ( hermon, "Hermon %p could not issue MAD IFC: %s\n",
|
1406
|
|
- hermon, strerror ( rc ) );
|
1407
|
|
- return rc;
|
1408
|
|
- }
|
1409
|
|
-
|
1410
|
|
- /* Copy out reply packet */
|
1411
|
|
- memcpy ( mad, &mad_ifc.mad, len );
|
1412
|
|
-
|
1413
|
|
- if ( mad->status != 0 ) {
|
1414
|
|
- DBGC ( hermon, "Hermon %p MAD IFC status %04x\n",
|
1415
|
|
- hermon, ntohs ( mad->status ) );
|
1416
|
|
- return -EIO;
|
1417
|
|
- }
|
1418
|
|
- return 0;
|
1419
|
|
-}
|
1420
|
|
-
|
1421
|
|
-/** Hermon Infiniband operations */
|
1422
|
|
-static struct ib_device_operations hermon_ib_operations = {
|
1423
|
|
- .create_cq = hermon_create_cq,
|
1424
|
|
- .destroy_cq = hermon_destroy_cq,
|
1425
|
|
- .create_qp = hermon_create_qp,
|
1426
|
|
- .modify_qp = hermon_modify_qp,
|
1427
|
|
- .destroy_qp = hermon_destroy_qp,
|
1428
|
|
- .post_send = hermon_post_send,
|
1429
|
|
- .post_recv = hermon_post_recv,
|
1430
|
|
- .poll_cq = hermon_poll_cq,
|
1431
|
|
- .open = hermon_open,
|
1432
|
|
- .close = hermon_close,
|
1433
|
|
- .mcast_attach = hermon_mcast_attach,
|
1434
|
|
- .mcast_detach = hermon_mcast_detach,
|
1435
|
|
- .mad = hermon_mad,
|
1436
|
|
-};
|
1437
|
|
-
|
1438
|
1228
|
/***************************************************************************
|
1439
|
1229
|
*
|
1440
|
1230
|
* Event queues
|
|
@@ -1597,9 +1387,10 @@ static void hermon_event_port_state_change ( struct hermon *hermon,
|
1597
|
1387
|
/**
|
1598
|
1388
|
* Poll event queue
|
1599
|
1389
|
*
|
1600
|
|
- * @v hermon Hermon device
|
|
1390
|
+ * @v ibdev Infiniband device
|
1601
|
1391
|
*/
|
1602
|
|
-static void hermon_poll_eq ( struct hermon *hermon ) {
|
|
1392
|
+static void hermon_poll_eq ( struct ib_device *ibdev ) {
|
|
1393
|
+ struct hermon *hermon = ib_get_drvdata ( ibdev );
|
1603
|
1394
|
struct hermon_event_queue *hermon_eq = &hermon->eq;
|
1604
|
1395
|
union hermonprm_event_entry *eqe;
|
1605
|
1396
|
union hermonprm_doorbell_register db_reg;
|
|
@@ -1644,18 +1435,216 @@ static void hermon_poll_eq ( struct hermon *hermon ) {
|
1644
|
1435
|
}
|
1645
|
1436
|
}
|
1646
|
1437
|
|
|
1438
|
+/***************************************************************************
|
|
1439
|
+ *
|
|
1440
|
+ * Infiniband link-layer operations
|
|
1441
|
+ *
|
|
1442
|
+ ***************************************************************************
|
|
1443
|
+ */
|
|
1444
|
+
|
|
1445
|
+/**
|
|
1446
|
+ * Initialise Infiniband link
|
|
1447
|
+ *
|
|
1448
|
+ * @v ibdev Infiniband device
|
|
1449
|
+ * @ret rc Return status code
|
|
1450
|
+ */
|
|
1451
|
+static int hermon_open ( struct ib_device *ibdev ) {
|
|
1452
|
+ struct hermon *hermon = ib_get_drvdata ( ibdev );
|
|
1453
|
+ struct hermonprm_init_port init_port;
|
|
1454
|
+ int rc;
|
|
1455
|
+
|
|
1456
|
+ memset ( &init_port, 0, sizeof ( init_port ) );
|
|
1457
|
+ MLX_FILL_2 ( &init_port, 0,
|
|
1458
|
+ port_width_cap, 3,
|
|
1459
|
+ vl_cap, 1 );
|
|
1460
|
+ MLX_FILL_2 ( &init_port, 1,
|
|
1461
|
+ mtu, HERMON_MTU_2048,
|
|
1462
|
+ max_gid, 1 );
|
|
1463
|
+ MLX_FILL_1 ( &init_port, 2, max_pkey, 64 );
|
|
1464
|
+ if ( ( rc = hermon_cmd_init_port ( hermon, ibdev->port,
|
|
1465
|
+ &init_port ) ) != 0 ) {
|
|
1466
|
+ DBGC ( hermon, "Hermon %p could not intialise port: %s\n",
|
|
1467
|
+ hermon, strerror ( rc ) );
|
|
1468
|
+ return rc;
|
|
1469
|
+ }
|
|
1470
|
+
|
|
1471
|
+ return 0;
|
|
1472
|
+}
|
|
1473
|
+
|
1647
|
1474
|
/**
|
1648
|
|
- * Event queue poll processor
|
|
1475
|
+ * Close Infiniband link
|
1649
|
1476
|
*
|
1650
|
|
- * @v process Hermon event queue process
|
|
1477
|
+ * @v ibdev Infiniband device
|
1651
|
1478
|
*/
|
1652
|
|
-static void hermon_step ( struct process *process ) {
|
1653
|
|
- struct hermon *hermon =
|
1654
|
|
- container_of ( process, struct hermon, event_process );
|
|
1479
|
+static void hermon_close ( struct ib_device *ibdev ) {
|
|
1480
|
+ struct hermon *hermon = ib_get_drvdata ( ibdev );
|
|
1481
|
+ int rc;
|
1655
|
1482
|
|
1656
|
|
- hermon_poll_eq ( hermon );
|
|
1483
|
+ if ( ( rc = hermon_cmd_close_port ( hermon, ibdev->port ) ) != 0 ) {
|
|
1484
|
+ DBGC ( hermon, "Hermon %p could not close port: %s\n",
|
|
1485
|
+ hermon, strerror ( rc ) );
|
|
1486
|
+ /* Nothing we can do about this */
|
|
1487
|
+ }
|
1657
|
1488
|
}
|
1658
|
1489
|
|
|
1490
|
+/***************************************************************************
|
|
1491
|
+ *
|
|
1492
|
+ * Multicast group operations
|
|
1493
|
+ *
|
|
1494
|
+ ***************************************************************************
|
|
1495
|
+ */
|
|
1496
|
+
|
|
1497
|
+/**
|
|
1498
|
+ * Attach to multicast group
|
|
1499
|
+ *
|
|
1500
|
+ * @v ibdev Infiniband device
|
|
1501
|
+ * @v qp Queue pair
|
|
1502
|
+ * @v gid Multicast GID
|
|
1503
|
+ * @ret rc Return status code
|
|
1504
|
+ */
|
|
1505
|
+static int hermon_mcast_attach ( struct ib_device *ibdev,
|
|
1506
|
+ struct ib_queue_pair *qp,
|
|
1507
|
+ struct ib_gid *gid ) {
|
|
1508
|
+ struct hermon *hermon = ib_get_drvdata ( ibdev );
|
|
1509
|
+ struct hermonprm_mgm_hash hash;
|
|
1510
|
+ struct hermonprm_mcg_entry mcg;
|
|
1511
|
+ unsigned int index;
|
|
1512
|
+ int rc;
|
|
1513
|
+
|
|
1514
|
+ /* Generate hash table index */
|
|
1515
|
+ if ( ( rc = hermon_cmd_mgid_hash ( hermon, gid, &hash ) ) != 0 ) {
|
|
1516
|
+ DBGC ( hermon, "Hermon %p could not hash GID: %s\n",
|
|
1517
|
+ hermon, strerror ( rc ) );
|
|
1518
|
+ return rc;
|
|
1519
|
+ }
|
|
1520
|
+ index = MLX_GET ( &hash, hash );
|
|
1521
|
+
|
|
1522
|
+ /* Check for existing hash table entry */
|
|
1523
|
+ if ( ( rc = hermon_cmd_read_mcg ( hermon, index, &mcg ) ) != 0 ) {
|
|
1524
|
+ DBGC ( hermon, "Hermon %p could not read MCG %#x: %s\n",
|
|
1525
|
+ hermon, index, strerror ( rc ) );
|
|
1526
|
+ return rc;
|
|
1527
|
+ }
|
|
1528
|
+ if ( MLX_GET ( &mcg, hdr.members_count ) != 0 ) {
|
|
1529
|
+ /* FIXME: this implementation allows only a single QP
|
|
1530
|
+ * per multicast group, and doesn't handle hash
|
|
1531
|
+ * collisions. Sufficient for IPoIB but may need to
|
|
1532
|
+ * be extended in future.
|
|
1533
|
+ */
|
|
1534
|
+ DBGC ( hermon, "Hermon %p MGID index %#x already in use\n",
|
|
1535
|
+ hermon, index );
|
|
1536
|
+ return -EBUSY;
|
|
1537
|
+ }
|
|
1538
|
+
|
|
1539
|
+ /* Update hash table entry */
|
|
1540
|
+ MLX_FILL_1 ( &mcg, 1, hdr.members_count, 1 );
|
|
1541
|
+ MLX_FILL_1 ( &mcg, 8, qp[0].qpn, qp->qpn );
|
|
1542
|
+ memcpy ( &mcg.u.dwords[4], gid, sizeof ( *gid ) );
|
|
1543
|
+ if ( ( rc = hermon_cmd_write_mcg ( hermon, index, &mcg ) ) != 0 ) {
|
|
1544
|
+ DBGC ( hermon, "Hermon %p could not write MCG %#x: %s\n",
|
|
1545
|
+ hermon, index, strerror ( rc ) );
|
|
1546
|
+ return rc;
|
|
1547
|
+ }
|
|
1548
|
+
|
|
1549
|
+ return 0;
|
|
1550
|
+}
|
|
1551
|
+
|
|
1552
|
+/**
|
|
1553
|
+ * Detach from multicast group
|
|
1554
|
+ *
|
|
1555
|
+ * @v ibdev Infiniband device
|
|
1556
|
+ * @v qp Queue pair
|
|
1557
|
+ * @v gid Multicast GID
|
|
1558
|
+ */
|
|
1559
|
+static void hermon_mcast_detach ( struct ib_device *ibdev,
|
|
1560
|
+ struct ib_queue_pair *qp __unused,
|
|
1561
|
+ struct ib_gid *gid ) {
|
|
1562
|
+ struct hermon *hermon = ib_get_drvdata ( ibdev );
|
|
1563
|
+ struct hermonprm_mgm_hash hash;
|
|
1564
|
+ struct hermonprm_mcg_entry mcg;
|
|
1565
|
+ unsigned int index;
|
|
1566
|
+ int rc;
|
|
1567
|
+
|
|
1568
|
+ /* Generate hash table index */
|
|
1569
|
+ if ( ( rc = hermon_cmd_mgid_hash ( hermon, gid, &hash ) ) != 0 ) {
|
|
1570
|
+ DBGC ( hermon, "Hermon %p could not hash GID: %s\n",
|
|
1571
|
+ hermon, strerror ( rc ) );
|
|
1572
|
+ return;
|
|
1573
|
+ }
|
|
1574
|
+ index = MLX_GET ( &hash, hash );
|
|
1575
|
+
|
|
1576
|
+ /* Clear hash table entry */
|
|
1577
|
+ memset ( &mcg, 0, sizeof ( mcg ) );
|
|
1578
|
+ if ( ( rc = hermon_cmd_write_mcg ( hermon, index, &mcg ) ) != 0 ) {
|
|
1579
|
+ DBGC ( hermon, "Hermon %p could not write MCG %#x: %s\n",
|
|
1580
|
+ hermon, index, strerror ( rc ) );
|
|
1581
|
+ return;
|
|
1582
|
+ }
|
|
1583
|
+}
|
|
1584
|
+
|
|
1585
|
+/***************************************************************************
|
|
1586
|
+ *
|
|
1587
|
+ * MAD operations
|
|
1588
|
+ *
|
|
1589
|
+ ***************************************************************************
|
|
1590
|
+ */
|
|
1591
|
+
|
|
1592
|
+/**
|
|
1593
|
+ * Issue management datagram
|
|
1594
|
+ *
|
|
1595
|
+ * @v ibdev Infiniband device
|
|
1596
|
+ * @v mad Management datagram
|
|
1597
|
+ * @v len Length of management datagram
|
|
1598
|
+ * @ret rc Return status code
|
|
1599
|
+ */
|
|
1600
|
+static int hermon_mad ( struct ib_device *ibdev, struct ib_mad_hdr *mad,
|
|
1601
|
+ size_t len ) {
|
|
1602
|
+ struct hermon *hermon = ib_get_drvdata ( ibdev );
|
|
1603
|
+ union hermonprm_mad mad_ifc;
|
|
1604
|
+ int rc;
|
|
1605
|
+
|
|
1606
|
+ /* Copy in request packet */
|
|
1607
|
+ memset ( &mad_ifc, 0, sizeof ( mad_ifc ) );
|
|
1608
|
+ assert ( len <= sizeof ( mad_ifc.mad ) );
|
|
1609
|
+ memcpy ( &mad_ifc.mad, mad, len );
|
|
1610
|
+
|
|
1611
|
+ /* Issue MAD */
|
|
1612
|
+ if ( ( rc = hermon_cmd_mad_ifc ( hermon, ibdev->port,
|
|
1613
|
+ &mad_ifc ) ) != 0 ) {
|
|
1614
|
+ DBGC ( hermon, "Hermon %p could not issue MAD IFC: %s\n",
|
|
1615
|
+ hermon, strerror ( rc ) );
|
|
1616
|
+ return rc;
|
|
1617
|
+ }
|
|
1618
|
+
|
|
1619
|
+ /* Copy out reply packet */
|
|
1620
|
+ memcpy ( mad, &mad_ifc.mad, len );
|
|
1621
|
+
|
|
1622
|
+ if ( mad->status != 0 ) {
|
|
1623
|
+ DBGC ( hermon, "Hermon %p MAD IFC status %04x\n",
|
|
1624
|
+ hermon, ntohs ( mad->status ) );
|
|
1625
|
+ return -EIO;
|
|
1626
|
+ }
|
|
1627
|
+ return 0;
|
|
1628
|
+}
|
|
1629
|
+
|
|
1630
|
+/** Hermon Infiniband operations */
|
|
1631
|
+static struct ib_device_operations hermon_ib_operations = {
|
|
1632
|
+ .create_cq = hermon_create_cq,
|
|
1633
|
+ .destroy_cq = hermon_destroy_cq,
|
|
1634
|
+ .create_qp = hermon_create_qp,
|
|
1635
|
+ .modify_qp = hermon_modify_qp,
|
|
1636
|
+ .destroy_qp = hermon_destroy_qp,
|
|
1637
|
+ .post_send = hermon_post_send,
|
|
1638
|
+ .post_recv = hermon_post_recv,
|
|
1639
|
+ .poll_cq = hermon_poll_cq,
|
|
1640
|
+ .poll_eq = hermon_poll_eq,
|
|
1641
|
+ .open = hermon_open,
|
|
1642
|
+ .close = hermon_close,
|
|
1643
|
+ .mcast_attach = hermon_mcast_attach,
|
|
1644
|
+ .mcast_detach = hermon_mcast_detach,
|
|
1645
|
+ .mad = hermon_mad,
|
|
1646
|
+};
|
|
1647
|
+
|
1659
|
1648
|
/***************************************************************************
|
1660
|
1649
|
*
|
1661
|
1650
|
* Firmware control
|
|
@@ -2168,7 +2157,6 @@ static int hermon_probe ( struct pci_device *pci,
|
2168
|
2157
|
goto err_alloc_hermon;
|
2169
|
2158
|
}
|
2170
|
2159
|
pci_set_drvdata ( pci, hermon );
|
2171
|
|
- process_init ( &hermon->event_process, hermon_step, NULL );
|
2172
|
2160
|
|
2173
|
2161
|
/* Allocate Infiniband devices */
|
2174
|
2162
|
for ( i = 0 ; i < HERMON_NUM_PORTS ; i++ ) {
|
|
@@ -2270,8 +2258,7 @@ static int hermon_probe ( struct pci_device *pci,
|
2270
|
2258
|
i = ( HERMON_NUM_PORTS - 1 );
|
2271
|
2259
|
err_alloc_ibdev:
|
2272
|
2260
|
for ( ; i >= 0 ; i-- )
|
2273
|
|
- free_ibdev ( hermon->ibdev[i] );
|
2274
|
|
- process_del ( &hermon->event_process );
|
|
2261
|
+ ibdev_put ( hermon->ibdev[i] );
|
2275
|
2262
|
free ( hermon );
|
2276
|
2263
|
err_alloc_hermon:
|
2277
|
2264
|
return rc;
|
|
@@ -2296,8 +2283,7 @@ static void hermon_remove ( struct pci_device *pci ) {
|
2296
|
2283
|
free_dma ( hermon->mailbox_out, HERMON_MBOX_SIZE );
|
2297
|
2284
|
free_dma ( hermon->mailbox_in, HERMON_MBOX_SIZE );
|
2298
|
2285
|
for ( i = ( HERMON_NUM_PORTS - 1 ) ; i >= 0 ; i-- )
|
2299
|
|
- free_ibdev ( hermon->ibdev[i] );
|
2300
|
|
- process_del ( &hermon->event_process );
|
|
2286
|
+ ibdev_put ( hermon->ibdev[i] );
|
2301
|
2287
|
free ( hermon );
|
2302
|
2288
|
}
|
2303
|
2289
|
|