struct rte_mempool *mb_pool;
uint16_t port;
uint16_t virtqueue_id;
- bool intr_en;
struct vhost_stats stats;
};
rte_vhost_enable_guest_notification(vq->vid, (qid << 1) + 1, 1);
rte_wmb();
- vq->intr_en = true;
-
return ret;
}
rte_vhost_enable_guest_notification(vq->vid, (qid << 1) + 1, 0);
rte_wmb();
- vq->intr_en = false;
-
return 0;
}
struct rte_eth_conf *dev_conf = ð_dev->data->dev_conf;
struct pmd_internal *internal = eth_dev->data->dev_private;
struct rte_vhost_vring vring;
- struct vhost_queue *vq;
int rx_idx = vring_id % 2 ? (vring_id - 1) >> 1 : -1;
int ret = 0;
rte_atomic32_read(&internal->dev_attached) &&
rte_atomic32_read(&internal->started) &&
dev_conf->intr_conf.rxq) {
- vq = eth_dev->data->rx_queues[rx_idx];
ret = rte_vhost_get_vhost_vring(vid, vring_id, &vring);
- if (!ret) {
- if (vring.kickfd !=
- eth_dev->intr_handle->efds[rx_idx]) {
- VHOST_LOG(INFO,
- "kickfd for rxq-%d was changed.\n",
- rx_idx);
- eth_dev->intr_handle->efds[rx_idx] =
- vring.kickfd;
- }
+ if (ret) {
+ VHOST_LOG(ERR, "Failed to get vring %d information.\n",
+ vring_id);
+ return ret;
+ }
- rte_vhost_enable_guest_notification(vid, vring_id,
- vq->intr_en);
- rte_wmb();
+ if (vring.kickfd != eth_dev->intr_handle->efds[rx_idx]) {
+ VHOST_LOG(INFO, "kickfd for rxq-%d was changed.\n",
+ rx_idx);
+ eth_dev->intr_handle->efds[rx_idx] = vring.kickfd;
}
}