* Process virtio config changed interrupt. Call the callback * if link state changed, generate gratuitous RARP packet if * the status indicates an ANNOUNCE. */
| 1209 | * the status indicates an ANNOUNCE. |
| 1210 | */ |
| 1211 | void |
| 1212 | virtio_interrupt_handler(void *param) |
| 1213 | { |
| 1214 | struct rte_eth_dev *dev = param; |
| 1215 | struct virtio_hw *hw = dev->data->dev_private; |
| 1216 | uint8_t isr; |
| 1217 | uint16_t status; |
| 1218 | |
| 1219 | /* Read interrupt status which clears interrupt */ |
| 1220 | isr = virtio_get_isr(hw); |
| 1221 | PMD_DRV_LOG(INFO, "interrupt status = %#x", isr); |
| 1222 | |
| 1223 | if (virtio_intr_unmask(dev) < 0) |
| 1224 | PMD_DRV_LOG(ERR, "interrupt enable failed"); |
| 1225 | |
| 1226 | if (isr & VIRTIO_ISR_CONFIG) { |
| 1227 | if (virtio_dev_link_update(dev, 0) == 0) |
| 1228 | rte_eth_dev_callback_process(dev, |
| 1229 | RTE_ETH_EVENT_INTR_LSC, |
| 1230 | NULL); |
| 1231 | |
| 1232 | if (virtio_with_feature(hw, VIRTIO_NET_F_STATUS)) { |
| 1233 | virtio_read_dev_config(hw, |
| 1234 | offsetof(struct virtio_net_config, status), |
| 1235 | &status, sizeof(status)); |
| 1236 | if (status & VIRTIO_NET_S_ANNOUNCE) { |
| 1237 | virtio_notify_peers(dev); |
| 1238 | if (hw->cvq) |
| 1239 | virtio_ack_link_announce(dev); |
| 1240 | } |
| 1241 | } |
| 1242 | } |
| 1243 | } |
| 1244 | |
| 1245 | /* set rx and tx handlers according to what is supported */ |
| 1246 | static void |
nothing calls this directly
no test coverage detected