replace zero-length arrays with flexible ones
[dpdk.git] / lib / vhost / vhost.h
index 01b9701..14235aa 100644 (file)
@@ -133,6 +133,11 @@ struct virtqueue_stats {
        uint64_t broadcast;
        /* Size bins in array as RFC 2819, undersized [0], 64 [1], etc */
        uint64_t size_bins[8];
+       uint64_t guest_notifications;
+       uint64_t iotlb_hits;
+       uint64_t iotlb_misses;
+       uint64_t inflight_submitted;
+       uint64_t inflight_completed;
 };
 
 /**
@@ -194,6 +199,7 @@ struct async_inflight_info {
        struct rte_mbuf *mbuf;
        uint16_t descs; /* num of descs inflight */
        uint16_t nr_buffers; /* num of buffers inflight for packed ring */
+       struct virtio_net_hdr nethdr;
 };
 
 struct vhost_async {
@@ -871,6 +877,8 @@ vhost_vring_call_split(struct virtio_net *dev, struct vhost_virtqueue *vq)
                                        (vq->callfd >= 0)) ||
                                unlikely(!signalled_used_valid)) {
                        eventfd_write(vq->callfd, (eventfd_t) 1);
+                       if (dev->flags & VIRTIO_DEV_STATS_ENABLED)
+                               vq->stats.guest_notifications++;
                        if (dev->notify_ops->guest_notified)
                                dev->notify_ops->guest_notified(dev->vid);
                }
@@ -879,6 +887,8 @@ vhost_vring_call_split(struct virtio_net *dev, struct vhost_virtqueue *vq)
                if (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)
                                && (vq->callfd >= 0)) {
                        eventfd_write(vq->callfd, (eventfd_t)1);
+                       if (dev->flags & VIRTIO_DEV_STATS_ENABLED)
+                               vq->stats.guest_notifications++;
                        if (dev->notify_ops->guest_notified)
                                dev->notify_ops->guest_notified(dev->vid);
                }