summaryrefslogtreecommitdiffstats
path: root/vhost_user_loopback.h
diff options
context:
space:
mode:
authorTimos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>2022-09-26 17:03:27 +0300
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-03 15:18:54 +0300
commit2b09c69cc896841c7828408083f6cb443fef8612 (patch)
tree0fc020fb6059654d5e0f74acc4cf6c4336889ceb /vhost_user_loopback.h
parent346f9c0f4a72945795b2bf203d2294ff00f25148 (diff)
Virtio-loopback-adapter Alpha release update:
- Format code style and remove unnecessary comments Signed-off-by: Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>
Diffstat (limited to 'vhost_user_loopback.h')
-rw-r--r--vhost_user_loopback.h54
1 files changed, 35 insertions, 19 deletions
diff --git a/vhost_user_loopback.h b/vhost_user_loopback.h
index c41bca6..4a98516 100644
--- a/vhost_user_loopback.h
+++ b/vhost_user_loopback.h
@@ -1,5 +1,5 @@
/*
- * Based on libvhost-user.h of Qemu project
+ * Based on libvhost-user.h of QEMU project
*
* Copyright (c) 2016 Red Hat, Inc.
*
@@ -314,8 +314,10 @@ typedef struct VuDevIface {
vu_get_features_cb get_features;
/* enable vhost implementation features */
vu_set_features_cb set_features;
- /* get the protocol feature bitmask from the underlying vhost
- * implementation */
+ /*
+ * get the protocol feature bitmask from the underlying vhost
+ * implementation
+ */
vu_get_features_cb get_protocol_features;
/* enable protocol features in the underlying vhost implementation. */
vu_set_features_cb set_protocol_features;
@@ -348,19 +350,25 @@ typedef struct VuRing {
} VuRing;
typedef struct VuDescStateSplit {
- /* Indicate whether this descriptor is inflight or not.
- * Only available for head-descriptor. */
+ /*
+ * Indicate whether this descriptor is inflight or not.
+ * Only available for head-descriptor.
+ */
uint8_t inflight;
/* Padding */
uint8_t padding[5];
- /* Maintain a list for the last batch of used descriptors.
- * Only available when batching is used for submitting */
+ /*
+ * Maintain a list for the last batch of used descriptors.
+ * Only available when batching is used for submitting
+ */
uint16_t next;
- /* Used to preserve the order of fetching available descriptors.
- * Only available for head-descriptor. */
+ /*
+ * Used to preserve the order of fetching available descriptors.
+ * Only available for head-descriptor.
+ */
uint64_t counter;
} VuDescStateSplit;
@@ -368,15 +376,21 @@ typedef struct VuVirtqInflight {
/* The feature flags of this region. Now it's initialized to 0. */
uint64_t features;
- /* The version of this region. It's 1 currently.
- * Zero value indicates a vm reset happened. */
+ /*
+ * The version of this region. It's 1 currently.
+ * Zero value indicates a vm reset happened.
+ */
uint16_t version;
- /* The size of VuDescStateSplit array. It's equal to the virtqueue
- * size. Slave could get it from queue size field of VhostUserInflight. */
+ /*
+ * The size of VuDescStateSplit array. It's equal to the virtqueue
+ * size. Slave could get it from queue size field of VhostUserInflight.
+ */
uint16_t desc_num;
- /* The head of list that track the last batch of used descriptors. */
+ /*
+ * The head of list that track the last batch of used descriptors.
+ */
uint16_t last_batch_head;
/* Storing the idx value of used ring */
@@ -721,7 +735,7 @@ void vu_queue_push(VuDev *dev, VuVirtq *vq,
*
* Mark the last number of elements as done (used.idx is updated by
* num elements).
-*/
+ */
void vu_queue_flush(VuDev *dev, VuVirtq *vq, unsigned int num);
/**
@@ -778,9 +792,11 @@ int vhost_user_set_features(struct vhost_dev *dev,
int vhost_user_set_mem_table(struct vhost_dev *dev);
int vhost_user_get_vq_index(struct vhost_dev *dev, int idx);
void vhost_user_share_fd(void);
-int vhost_user_set_vring_num(struct vhost_dev *dev, struct vhost_vring_state *ring);
-int vhost_user_set_vring_base(struct vhost_dev *dev, struct vhost_vring_state *ring);
-int vhost_user_set_vring_addr(struct vhost_dev *dev, struct vhost_vring_addr *addr);
-
+int vhost_user_set_vring_num(struct vhost_dev *dev,
+ struct vhost_vring_state *ring);
+int vhost_user_set_vring_base(struct vhost_dev *dev,
+ struct vhost_vring_state *ring);
+int vhost_user_set_vring_addr(struct vhost_dev *dev,
+ struct vhost_vring_addr *addr);
#endif /* LIBVHOST_USER_H */