| 586 | } |
| 587 | |
| 588 | static int |
| 589 | intel_ntb_vector_bind(const struct rte_rawdev *dev, uint8_t intr, uint8_t msix) |
| 590 | { |
| 591 | struct ntb_hw *hw = dev->dev_private; |
| 592 | uint8_t reg_off; |
| 593 | void *reg_addr; |
| 594 | |
| 595 | if (intr >= hw->db_cnt) { |
| 596 | NTB_LOG(ERR, "Invalid intr source."); |
| 597 | return -EINVAL; |
| 598 | } |
| 599 | |
| 600 | /* Bind intr source to msix vector */ |
| 601 | if (is_gen3_ntb(hw)) |
| 602 | reg_off = XEON_GEN3_INTVEC_OFFSET; |
| 603 | else if (is_gen4_ntb(hw)) |
| 604 | reg_off = XEON_GEN4_INTVEC_OFFSET; |
| 605 | else { |
| 606 | NTB_LOG(ERR, "Cannot bind vectors for unsupported device."); |
| 607 | return -ENOTSUP; |
| 608 | } |
| 609 | reg_addr = hw->hw_addr + reg_off + intr; |
| 610 | |
| 611 | rte_write8(msix, reg_addr); |
| 612 | |
| 613 | return 0; |
| 614 | } |
| 615 | |
| 616 | /* operations for primary side of local ntb */ |
| 617 | const struct ntb_dev_ops intel_ntb_ops = { |
nothing calls this directly
no test coverage detected