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

Function virtio_interrupt_handler

dpdk/drivers/net/virtio/virtio_ethdev.c:1211–1243  ·  view source on GitHub ↗

* Process virtio config changed interrupt. Call the callback * if link state changed, generate gratuitous RARP packet if * the status indicates an ANNOUNCE. */

Source from the content-addressed store, hash-verified

1209 * the status indicates an ANNOUNCE.
1210 */
1211void
1212virtio_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 */
1246static void

Callers

nothing calls this directly

Calls 8

virtio_get_isrFunction · 0.85
virtio_intr_unmaskFunction · 0.85
virtio_dev_link_updateFunction · 0.85
virtio_with_featureFunction · 0.85
virtio_read_dev_configFunction · 0.85
virtio_notify_peersFunction · 0.85
virtio_ack_link_announceFunction · 0.85

Tested by

no test coverage detected