MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ionic_lif_notifyq_init

Function ionic_lif_notifyq_init

dpdk/drivers/net/ionic/ionic_lif.c:1455–1508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1453}
1454
1455static int
1456ionic_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
1510int
1511ionic_lif_set_features(struct ionic_lif *lif)

Callers 1

ionic_lif_initFunction · 0.85

Calls 3

ionic_adminq_post_waitFunction · 0.85
ionic_intr_maskFunction · 0.85
rte_log2_u32Function · 0.50

Tested by

no test coverage detected