if ((c->flags & (VFCF_FC_INITIATOR)) == 0) {
dev_info(&fnic->pdev->dev, "vNIC role not defined (def role: FC Init)\n");
c->flags |= VFCF_FC_INITIATOR;
}
/* Allocate Raw WQ used for FCS frames */ for (i = 0; i < fnic->raw_wq_count; i++) {
err = vnic_wq_alloc(fnic->vdev, &fnic->wq[i], i,
fnic->config.wq_enet_desc_count, sizeof(struct wq_enet_desc)); if (err) goto err_out_cleanup;
}
/* Allocate Copy WQs used for SCSI IOs */ for (i = 0; i < fnic->wq_copy_count; i++) {
err = vnic_wq_copy_alloc(fnic->vdev, &fnic->hw_copy_wq[i],
(fnic->raw_wq_count + i),
fnic->config.wq_copy_desc_count, sizeof(struct fcpio_host_req)); if (err) goto err_out_cleanup;
}
/* RQ for receiving FCS frames */ for (i = 0; i < fnic->rq_count; i++) {
err = vnic_rq_alloc(fnic->vdev, &fnic->rq[i], i,
fnic->config.rq_desc_count, sizeof(struct rq_enet_desc)); if (err) goto err_out_cleanup;
}
/* CQ for each RQ */ for (i = 0; i < fnic->rq_count; i++) {
cq_index = i;
err = vnic_cq_alloc(fnic->vdev,
&fnic->cq[cq_index], cq_index,
fnic->config.rq_desc_count, sizeof(struct cq_enet_rq_desc)); if (err) goto err_out_cleanup;
}
/* CQ for each WQ */ for (i = 0; i < fnic->raw_wq_count; i++) {
cq_index = fnic->rq_count + i;
err = vnic_cq_alloc(fnic->vdev, &fnic->cq[cq_index], cq_index,
fnic->config.wq_enet_desc_count, sizeof(struct cq_enet_wq_desc)); if (err) goto err_out_cleanup;
}
/* CQ for each COPY WQ */
wq_copy_cq_desc_count = (fnic->config.wq_copy_desc_count * 3); for (i = 0; i < fnic->wq_copy_count; i++) {
cq_index = fnic->raw_wq_count + fnic->rq_count + i;
err = vnic_cq_alloc(fnic->vdev, &fnic->cq[cq_index],
cq_index,
wq_copy_cq_desc_count, sizeof(struct fcpio_fw_req)); if (err) goto err_out_cleanup;
}
for (i = 0; i < fnic->intr_count; i++) {
err = vnic_intr_alloc(fnic->vdev, &fnic->intr[i], i); if (err) goto err_out_cleanup;
}
if (!fnic->legacy_pba && intr_mode == VNIC_DEV_INTR_MODE_INTX) {
dev_err(&fnic->pdev->dev, "Failed to hook legacy pba resource\n");
err = -ENODEV; goto err_out_cleanup;
}
/* * Init RQ/WQ resources. * * RQ[0 to n-1] point to CQ[0 to n-1] * WQ[0 to m-1] point to CQ[n to n+m-1] * WQ_COPY[0 to k-1] points to CQ[n+m to n+m+k-1] * * Note for copy wq we always initialize with cq_index = 0 * * Error interrupt is not enabled for MSI.
*/
for (i = 0; i < fnic->rq_count; i++) {
cq_index = i;
vnic_rq_init(&fnic->rq[i],
cq_index,
error_interrupt_enable,
error_interrupt_offset);
}
for (i = 0; i < fnic->raw_wq_count; i++) {
cq_index = i + fnic->rq_count;
vnic_wq_init(&fnic->wq[i],
cq_index,
error_interrupt_enable,
error_interrupt_offset);
}
for (i = 0; i < fnic->wq_copy_count; i++) {
vnic_wq_copy_init(&fnic->hw_copy_wq[i],
0 /* cq_index 0 - always */,
error_interrupt_enable,
error_interrupt_offset);
}
/* * Init INTR resources * * mask_on_assertion is not used for INTx due to the level- * triggered nature of INTx
*/
switch (intr_mode) { case VNIC_DEV_INTR_MODE_MSI: case VNIC_DEV_INTR_MODE_MSIX:
mask_on_assertion = 1; break; default:
mask_on_assertion = 0; break;
}
for (i = 0; i < fnic->intr_count; i++) {
vnic_intr_init(&fnic->intr[i],
fnic->config.intr_timer,
fnic->config.intr_timer_type,
mask_on_assertion);
}
/* init the stats memory by making the first call here */
err = vnic_dev_stats_dump(fnic->vdev, &fnic->stats); if (err) {
dev_err(&fnic->pdev->dev, "vnic_dev_stats_dump failed - x%x\n", err); goto err_out_cleanup;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.