Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
docs: devices-- add FEATURES.yaml
[vpp.git]
/
src
/
vnet
/
devices
/
virtio
/
virtio.h
diff --git
a/src/vnet/devices/virtio/virtio.h
b/src/vnet/devices/virtio/virtio.h
index
f4a8103
..
dcbf865
100644
(file)
--- a/
src/vnet/devices/virtio/virtio.h
+++ b/
src/vnet/devices/virtio/virtio.h
@@
-49,7
+49,7
@@
_ (VIRTIO_NET_F_CTRL_MAC_ADDR, 23) /* Set MAC address */ \
_ (VIRTIO_F_NOTIFY_ON_EMPTY, 24) \
_ (VHOST_F_LOG_ALL, 26) /* Log all write descriptors */ \
_ (VIRTIO_NET_F_CTRL_MAC_ADDR, 23) /* Set MAC address */ \
_ (VIRTIO_F_NOTIFY_ON_EMPTY, 24) \
_ (VHOST_F_LOG_ALL, 26) /* Log all write descriptors */ \
- _ (VIRTIO_F_ANY_LAYOUT, 27) /* Can the device handle any descripor layout */ \
+ _ (VIRTIO_F_ANY_LAYOUT, 27) /* Can the device handle any descrip
t
or layout */ \
_ (VIRTIO_RING_F_INDIRECT_DESC, 28) /* Support indirect buffer descriptors */ \
_ (VIRTIO_RING_F_EVENT_IDX, 29) /* The Guest publishes the used index for which it expects an interrupt \
* at the end of the avail ring. Host should ignore the avail->flags field. */ \
_ (VIRTIO_RING_F_INDIRECT_DESC, 28) /* Support indirect buffer descriptors */ \
_ (VIRTIO_RING_F_EVENT_IDX, 29) /* The Guest publishes the used index for which it expects an interrupt \
* at the end of the avail ring. Host should ignore the avail->flags field. */ \
@@
-75,6
+75,11
@@
typedef enum
#define VIRTIO_FEATURE(X) (1ULL << X)
#define VIRTIO_FEATURE(X) (1ULL << X)
+#define TX_QUEUE(X) ((X*2) + 1)
+#define RX_QUEUE(X) (X*2)
+#define TX_QUEUE_ACCESS(X) (X/2)
+#define RX_QUEUE_ACCESS(X) (X/2)
+
typedef enum
{
VIRTIO_IF_TYPE_TAP,
typedef enum
{
VIRTIO_IF_TYPE_TAP,
@@
-99,16
+104,17
@@
typedef struct
struct vring_desc *desc;
struct vring_used *used;
struct vring_avail *avail;
struct vring_desc *desc;
struct vring_used *used;
struct vring_avail *avail;
+ clib_spinlock_t lockp;
u16 desc_in_use;
u16 desc_next;
int kick_fd;
int call_fd;
u16 desc_in_use;
u16 desc_next;
int kick_fd;
int call_fd;
+ u8 buffer_pool_index;
u16 size;
u16 queue_id;
u16 flags;
u32 call_file_index;
u32 *buffers;
u16 size;
u16 queue_id;
u16 flags;
u32 call_file_index;
u32 *buffers;
- u32 *indirect_buffers;
u16 last_used_idx;
u16 last_kick_avail_idx;
} virtio_vring_t;
u16 last_used_idx;
u16 last_kick_avail_idx;
} virtio_vring_t;
@@
-129,11
+135,11
@@
typedef struct
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
u32 flags;
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
u32 flags;
- clib_spinlock_t lockp;
u32 dev_instance;
u32 hw_if_index;
u32 sw_if_index;
u32 dev_instance;
u32 hw_if_index;
u32 sw_if_index;
+ u32 numa_node;
u16 virtio_net_hdr_sz;
virtio_if_type_t type;
union
u16 virtio_net_hdr_sz;
virtio_if_type_t type;
union
@@
-142,24
+148,28
@@
typedef struct
pci_addr_t pci_addr;
};
u32 per_interface_next_index;
pci_addr_t pci_addr;
};
u32 per_interface_next_index;
- int fd;
+ union
+ {
+ int fd;
+ u32 msix_enabled;
+ };
union
{
int tap_fd;
u32 pci_dev_handle;
};
union
{
int tap_fd;
u32 pci_dev_handle;
};
- virtio_vring_t *vrings;
-
+ virtio_vring_t *
rxq_
vrings;
+ virtio_vring_t *txq_vrings;
u64 features, remote_features;
/* error */
clib_error_t *error;
u64 features, remote_features;
/* error */
clib_error_t *error;
+ u8 support_int_mode; /* support interrupt mode */
u16 max_queue_pairs;
u16 max_queue_pairs;
- u16
tx_ring_sz
;
- u16
rx_ring_sz
;
+ u16
num_rxqs
;
+ u16
num_txqs
;
u8 status;
u8 mac_addr[6];
u8 status;
u8 mac_addr[6];
- u64 bar[2];
u8 *host_if_name;
u8 *net_ns;
u8 *host_bridge;
u8 *host_if_name;
u8 *net_ns;
u8 *host_bridge;
@@
-168,12
+178,17
@@
typedef struct
u8 host_ip4_prefix_len;
ip6_address_t host_ip6_addr;
u8 host_ip6_prefix_len;
u8 host_ip4_prefix_len;
ip6_address_t host_ip6_addr;
u8 host_ip6_prefix_len;
-
+ u32 host_mtu_size;
+ int gso_enabled;
int ifindex;
int ifindex;
+ virtio_vring_t *cxq_vring;
} virtio_if_t;
typedef struct
{
} virtio_if_t;
typedef struct
{
+ /* logging */
+ vlib_log_class_t log_default;
+
virtio_if_t *interfaces;
} virtio_main_t;
virtio_if_t *interfaces;
} virtio_main_t;
@@
-183,7
+198,11
@@
extern vlib_node_registration_t virtio_input_node;
clib_error_t *virtio_vring_init (vlib_main_t * vm, virtio_if_t * vif, u16 idx,
u16 sz);
clib_error_t *virtio_vring_init (vlib_main_t * vm, virtio_if_t * vif, u16 idx,
u16 sz);
-clib_error_t *virtio_vring_free (vlib_main_t * vm, virtio_if_t * vif,
+clib_error_t *virtio_vring_free_rx (vlib_main_t * vm, virtio_if_t * vif,
+ u32 idx);
+clib_error_t *virtio_vring_free_tx (vlib_main_t * vm, virtio_if_t * vif,
+ u32 idx);
+void virtio_vring_set_numa_node (vlib_main_t * vm, virtio_if_t * vif,
u32 idx);
extern void virtio_free_used_desc (vlib_main_t * vm, virtio_vring_t * vring);
extern void virtio_free_rx_buffers (vlib_main_t * vm, virtio_vring_t * vring);
u32 idx);
extern void virtio_free_used_desc (vlib_main_t * vm, virtio_vring_t * vring);
extern void virtio_free_rx_buffers (vlib_main_t * vm, virtio_vring_t * vring);