diff options
author | Mohsin Kazmi <sykazmi@cisco.com> | 2020-07-16 12:55:42 +0000 |
---|---|---|
committer | BenoƮt Ganne <bganne@cisco.com> | 2020-08-20 09:33:23 +0000 |
commit | a0a68339b783c1663776225c264b309506934722 (patch) | |
tree | 0517cc802ecb63e90f5a2878bcea89edf53ac4c1 /src/vnet/devices/virtio/virtio.h | |
parent | 224735bf090cde43827499405f663f859f82e161 (diff) |
virtio: refactor pci device code
Type: refactor
Change-Id: I7342178f9ab9adb99b91a4f984bc22bef2ce8021
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/virtio.h')
-rw-r--r-- | src/vnet/devices/virtio/virtio.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/vnet/devices/virtio/virtio.h b/src/vnet/devices/virtio/virtio.h index b57c6ebd77d..e1ba71dae2e 100644 --- a/src/vnet/devices/virtio/virtio.h +++ b/src/vnet/devices/virtio/virtio.h @@ -70,9 +70,6 @@ typedef enum #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) @@ -80,6 +77,9 @@ typedef enum #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) \ @@ -93,15 +93,6 @@ typedef enum 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 @@ -139,6 +130,8 @@ typedef union u32 as_u32; } pci_addr_t; +typedef struct _virtio_pci_func virtio_pci_func_t; + typedef struct { CLIB_CACHE_LINE_ALIGN_MARK (cacheline0); @@ -197,6 +190,7 @@ typedef struct u32 tap_flags; int ifindex; virtio_vring_t *cxq_vring; + const virtio_pci_func_t *virtio_pci_func; } virtio_if_t; typedef struct @@ -245,7 +239,6 @@ virtio_kick (vlib_main_t * vm, virtio_vring_t * vring, virtio_if_t * vif) } } - #define virtio_log_debug(vif, f, ...) \ { \ vlib_log(VLIB_LOG_LEVEL_DEBUG, virtio_main.log_default, \ |