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

Function eth_vhost_update_intr

dpdk/drivers/net/vhost/rte_eth_vhost.c:549–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547}
548
549static void
550eth_vhost_update_intr(struct rte_eth_dev *eth_dev, uint16_t rxq_idx)
551{
552 struct rte_vhost_vring vring;
553 struct vhost_queue *vq;
554
555 vq = eth_dev->data->rx_queues[rxq_idx];
556 if (vq == NULL || vq->vid < 0)
557 return;
558
559 if (rte_vhost_get_vhost_vring(vq->vid, (rxq_idx << 1) + 1, &vring) < 0) {
560 VHOST_LOG(DEBUG, "Failed to get rxq-%d's vring, skip!\n", rxq_idx);
561 return;
562 }
563
564 rte_spinlock_lock(&vq->intr_lock);
565
566 /* Remove previous kickfd from proxy epoll */
567 if (vq->kickfd >= 0 && vq->kickfd != vring.kickfd) {
568 if (epoll_ctl(vq->ev.data.fd, EPOLL_CTL_DEL, vq->kickfd, &vq->ev) < 0) {
569 VHOST_LOG(DEBUG, "Failed to unregister %d from rxq-%d epoll: %s\n",
570 vq->kickfd, rxq_idx, strerror(errno));
571 } else {
572 VHOST_LOG(DEBUG, "Unregistered %d from rxq-%d epoll\n",
573 vq->kickfd, rxq_idx);
574 }
575 vq->kickfd = -1;
576 }
577
578 /* Add new one, if valid */
579 if (vq->kickfd != vring.kickfd && vring.kickfd >= 0) {
580 if (epoll_ctl(vq->ev.data.fd, EPOLL_CTL_ADD, vring.kickfd, &vq->ev) < 0) {
581 VHOST_LOG(ERR, "Failed to register %d in rxq-%d epoll: %s\n",
582 vring.kickfd, rxq_idx, strerror(errno));
583 } else {
584 vq->kickfd = vring.kickfd;
585 VHOST_LOG(DEBUG, "Registered %d in rxq-%d epoll\n",
586 vq->kickfd, rxq_idx);
587 }
588 }
589
590 rte_spinlock_unlock(&vq->intr_lock);
591}
592
593static int
594eth_rxq_intr_enable(struct rte_eth_dev *dev, uint16_t qid)

Callers 2

eth_vhost_configure_intrFunction · 0.85
vring_state_changedFunction · 0.85

Calls 4

epoll_ctlFunction · 0.85
rte_spinlock_lockFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected