| 1453 | } |
| 1454 | |
| 1455 | static int |
| 1456 | ionic_lif_notifyq_init(struct ionic_lif *lif) |
| 1457 | { |
| 1458 | struct ionic_dev *idev = &lif->adapter->idev; |
| 1459 | struct ionic_notify_qcq *nqcq = lif->notifyqcq; |
| 1460 | struct ionic_queue *q = &nqcq->qcq.q; |
| 1461 | uint16_t flags = IONIC_QINIT_F_ENA; |
| 1462 | int err; |
| 1463 | |
| 1464 | struct ionic_admin_ctx ctx = { |
| 1465 | .pending_work = true, |
| 1466 | .cmd.q_init = { |
| 1467 | .opcode = IONIC_CMD_Q_INIT, |
| 1468 | .type = q->type, |
| 1469 | .ver = lif->qtype_info[q->type].version, |
| 1470 | .index = rte_cpu_to_le_32(q->index), |
| 1471 | .intr_index = rte_cpu_to_le_16(IONIC_INTR_NONE), |
| 1472 | .ring_size = rte_log2_u32(q->num_descs), |
| 1473 | .ring_base = rte_cpu_to_le_64(q->base_pa), |
| 1474 | } |
| 1475 | }; |
| 1476 | |
| 1477 | /* Only enable an interrupt if the device supports them */ |
| 1478 | if (lif->adapter->intf->configure_intr != NULL) { |
| 1479 | flags |= IONIC_QINIT_F_IRQ; |
| 1480 | ctx.cmd.q_init.intr_index = rte_cpu_to_le_16(nqcq->intr.index); |
| 1481 | } |
| 1482 | ctx.cmd.q_init.flags = rte_cpu_to_le_16(flags); |
| 1483 | |
| 1484 | IONIC_PRINT(DEBUG, "notifyq_init.index %d", q->index); |
| 1485 | IONIC_PRINT(DEBUG, "notifyq_init.ring_base 0x%" PRIx64 "", q->base_pa); |
| 1486 | IONIC_PRINT(DEBUG, "notifyq_init.ring_size %d", |
| 1487 | ctx.cmd.q_init.ring_size); |
| 1488 | IONIC_PRINT(DEBUG, "notifyq_init.ver %u", ctx.cmd.q_init.ver); |
| 1489 | |
| 1490 | err = ionic_adminq_post_wait(lif, &ctx); |
| 1491 | if (err) |
| 1492 | return err; |
| 1493 | |
| 1494 | q->hw_type = ctx.comp.q_init.hw_type; |
| 1495 | q->hw_index = rte_le_to_cpu_32(ctx.comp.q_init.hw_index); |
| 1496 | q->db = NULL; |
| 1497 | |
| 1498 | IONIC_PRINT(DEBUG, "notifyq->hw_type %d", q->hw_type); |
| 1499 | IONIC_PRINT(DEBUG, "notifyq->hw_index %d", q->hw_index); |
| 1500 | IONIC_PRINT(DEBUG, "notifyq->db %p", q->db); |
| 1501 | |
| 1502 | ionic_intr_mask(idev->intr_ctrl, nqcq->intr.index, |
| 1503 | IONIC_INTR_MASK_CLEAR); |
| 1504 | |
| 1505 | nqcq->flags |= IONIC_QCQ_F_INITED; |
| 1506 | |
| 1507 | return 0; |
| 1508 | } |
| 1509 | |
| 1510 | int |
| 1511 | ionic_lif_set_features(struct ionic_lif *lif) |
no test coverage detected