#undef _
} virtio_if_flag_t;
-#define VIRTIO_NUM_RX_DESC 256
-#define VIRTIO_NUM_TX_DESC 256
-
#define VIRTIO_FEATURE(X) (1ULL << X)
#define TX_QUEUE(X) ((X*2) + 1)
#define TX_QUEUE_ACCESS(X) (X/2)
#define RX_QUEUE_ACCESS(X) (X/2)
+#define VIRTIO_NUM_RX_DESC 256
+#define VIRTIO_NUM_TX_DESC 256
+
#define foreach_virtio_if_types \
_ (TAP, 0) \
_ (TUN, 1) \
VIRTIO_IF_N_TYPES = (1 << 3),
} virtio_if_type_t;
-
-typedef struct
-{
- u8 mac[6];
- u16 status;
- u16 max_virtqueue_pairs;
- u16 mtu;
-} virtio_net_config_t;
-
#define VIRTIO_RING_FLAG_MASK_INT 1
typedef struct
u32 as_u32;
} pci_addr_t;
+typedef struct _virtio_pci_func virtio_pci_func_t;
+
typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
u32 tap_flags;
int ifindex;
virtio_vring_t *cxq_vring;
+ const virtio_pci_func_t *virtio_pci_func;
} virtio_if_t;
typedef struct
}
}
-
#define virtio_log_debug(vif, f, ...) \
{ \
vlib_log(VLIB_LOG_LEVEL_DEBUG, virtio_main.log_default, \