#define VHOST_VRING_F_LOG 0
#define VHOST_USER_F_PROTOCOL_FEATURES 30
-#if DPDK == 0
-#define RTE_VERSION_NUM(a,b,c,d) 1
-#define RTE_VERSION 0
-#endif
#define VHOST_USER_PROTOCOL_FEATURES ((1ULL << VHOST_USER_PROTOCOL_F_MQ) | \
(1ULL << VHOST_USER_PROTOCOL_F_LOG_SHMFD))
u8 log_used;
//Put non-runtime in a different cache line
CLIB_CACHE_LINE_ALIGN_MARK (cacheline1);
- int callfd;
- int kickfd;
int errfd;
u32 callfd_idx;
u32 kickfd_idx;
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
u32 is_up;
u32 admin_up;
- u32 unix_fd;
+ u32 unix_server_index;
u32 unix_file_index;
- u32 client_fd;
char sock_filename[256];
int sock_errno;
- u8 sock_is_server;
u32 hw_if_index, sw_if_index;
- u8 active;
//Feature negotiation
u64 features;
u16 qid;
} vhost_iface_and_queue_t;
+typedef struct
+{
+ uword dst;
+ uword src;
+ u32 len;
+} vhost_copy_t;
+
+typedef struct
+{
+ u16 qid; /** The interface queue index (Not the virtio vring idx) */
+ u16 device_index; /** The device index */
+ u32 virtio_ring_flags; /** Runtime queue flags **/
+ u16 first_desc_len; /** Length of the first data descriptor **/
+ virtio_net_hdr_mrg_rxbuf_t hdr; /** Virtio header **/
+} vhost_trace_t;
+
+
+#define VHOST_USER_RX_BUFFERS_N (2 * VLIB_FRAME_SIZE + 2)
+#define VHOST_USER_COPY_ARRAY_N (4 * VLIB_FRAME_SIZE)
+
typedef struct
{
vhost_iface_and_queue_t *rx_queues;
+ u32 rx_buffers_len;
+ u32 rx_buffers[VHOST_USER_RX_BUFFERS_N];
+
+ virtio_net_hdr_mrg_rxbuf_t tx_headers[VLIB_FRAME_SIZE];
+ vhost_copy_t copy[VHOST_USER_COPY_ARRAY_N];
+
+ /* This is here so it doesn't end-up
+ * using stack or registers. */
+ vhost_trace_t *current_trace;
} vhost_cpu_t;
typedef struct
{
- u32 **rx_buffers;
u32 mtu_bytes;
vhost_user_intf_t *vhost_user_interfaces;
- u32 *vhost_user_inactive_interfaces_index;
- uword *vhost_user_interface_index_by_listener_fd;
- uword *vhost_user_interface_index_by_sock_fd;
- uword *vhost_user_interface_index_by_sw_if_index;
u32 *show_dev_instance_by_real_dev_instance;
u32 coalesce_frames;
f64 coalesce_time;
int dont_dump_vhost_user_memory;
- /* first cpu index */
+ /** first cpu index */
u32 input_cpu_first_index;
- /* total cpu count */
+ /** total cpu count */
u32 input_cpu_count;
/** Per-CPU data for vhost-user */
vhost_cpu_t *cpus;
+
+ /** Pseudo random iterator */
+ u32 random;
} vhost_user_main_t;
typedef struct