| 153 | } |
| 154 | |
| 155 | static int |
| 156 | ionic_pci_configure_intr(struct ionic_adapter *adapter) |
| 157 | { |
| 158 | struct rte_pci_device *pci_dev = |
| 159 | (struct rte_pci_device *)(adapter->bus_dev); |
| 160 | struct rte_intr_handle *intr_handle = pci_dev->intr_handle; |
| 161 | int err; |
| 162 | |
| 163 | IONIC_PRINT(ERR, "Configuring %u intrs", adapter->nintrs); |
| 164 | |
| 165 | if (rte_intr_efd_enable(intr_handle, adapter->nintrs)) { |
| 166 | IONIC_PRINT(ERR, "Fail to create eventfd"); |
| 167 | return -1; |
| 168 | } |
| 169 | |
| 170 | if (rte_intr_dp_is_en(intr_handle)) { |
| 171 | IONIC_PRINT(NOTICE, |
| 172 | "Packet I/O interrupt on datapath is enabled"); |
| 173 | if (rte_intr_vec_list_alloc(intr_handle, "intr_vec", |
| 174 | adapter->nintrs)) { |
| 175 | IONIC_PRINT(ERR, "Failed to allocate %u vectors", |
| 176 | adapter->nintrs); |
| 177 | return -ENOMEM; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | err = rte_intr_callback_register(intr_handle, |
| 182 | ionic_dev_interrupt_handler, |
| 183 | adapter); |
| 184 | if (err) { |
| 185 | IONIC_PRINT(ERR, |
| 186 | "Failure registering interrupts handler (%d)", err); |
| 187 | return err; |
| 188 | } |
| 189 | |
| 190 | /* enable intr mapping */ |
| 191 | err = rte_intr_enable(intr_handle); |
| 192 | if (err) { |
| 193 | IONIC_PRINT(ERR, "Failure enabling interrupts (%d)", err); |
| 194 | return err; |
| 195 | } |
| 196 | |
| 197 | return 0; |
| 198 | } |
| 199 | |
| 200 | static void |
| 201 | ionic_pci_unconfigure_intr(struct ionic_adapter *adapter) |
nothing calls this directly
no test coverage detected