+static int
+vring_conf_update(int vid, struct rte_eth_dev *eth_dev, uint16_t vring_id)
+{
+ 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;
+
+ /*
+ * The vring kickfd may be changed after the new device notification.
+ * Update it when the vring state is updated.
+ */
+ if (rx_idx >= 0 && rx_idx < eth_dev->data->nb_rx_queues &&
+ 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;
+ }
+
+ rte_vhost_enable_guest_notification(vid, vring_id,
+ vq->intr_en);
+ rte_wmb();
+ }
+ }
+
+ return ret;
+}
+