X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fvirtio%2Fvirtio.h;h=e78b2e429e09b5971f7552a459789dcf9a7b58fe;hb=1dfb92a529722c87b251eaaf673c48b13d1a54cc;hp=0ac5328c57d40b16ae621b92d597c8060832ca8c;hpb=9328e1055c6998d46e72fb3c5ba5d13f43b36ae8;p=dpdk.git diff --git a/drivers/net/virtio/virtio.h b/drivers/net/virtio/virtio.h index 0ac5328c57..e78b2e429e 100644 --- a/drivers/net/virtio/virtio.h +++ b/drivers/net/virtio/virtio.h @@ -98,7 +98,7 @@ * * Note the sizeof(struct vring_desc) is 16 bytes. */ -#define VIRTIO_MAX_INDIRECT ((int)(PAGE_SIZE / 16)) +#define VIRTIO_MAX_INDIRECT ((int)(rte_mem_page_size() / 16)) /* * Maximum number of virtqueues per device. @@ -124,6 +124,16 @@ #define VIRTIO_CONFIG_STATUS_DEV_NEED_RESET 0x40 #define VIRTIO_CONFIG_STATUS_FAILED 0x80 +/* The bit of the ISR which indicates a device has an interrupt. */ +#define VIRTIO_ISR_INTR 0x1 +/* The bit of the ISR which indicates a device configuration change. */ +#define VIRTIO_ISR_CONFIG 0x2 +/* Vector value used to disable MSI for queue. */ +#define VIRTIO_MSI_NO_VECTOR 0xFFFF + +/* The alignment to use between consumer and producer parts of vring. */ +#define VIRTIO_VRING_ALIGN 4096 + /* * This structure is just a reference to read net device specific * config space; it is just a shadow structure. @@ -157,6 +167,7 @@ struct virtio_hw { uint8_t started; uint8_t weak_barriers; uint8_t vlan_strip; + bool rx_ol_scatter; uint8_t has_tx_offload; uint8_t has_rx_offload; uint8_t use_vec_rx; @@ -168,8 +179,9 @@ struct virtio_hw { uint8_t mac_addr[RTE_ETHER_ADDR_LEN]; uint32_t speed; /* link speed in MB */ uint8_t duplex; - uint8_t use_msix; + uint8_t intr_lsc; uint16_t max_mtu; + size_t max_rx_pkt_len; /* * App management thread and virtio interrupt handler thread * both can change device state, this lock is meant to avoid @@ -180,6 +192,7 @@ struct virtio_hw { uint16_t max_queue_pairs; uint64_t req_guest_features; struct virtnet_ctl *cvq; + bool use_va; }; struct virtio_ops { @@ -232,5 +245,5 @@ void virtio_write_dev_config(struct virtio_hw *hw, size_t offset, const void *sr void virtio_read_dev_config(struct virtio_hw *hw, size_t offset, void *dst, int length); void virtio_reset(struct virtio_hw *hw); void virtio_reinit_complete(struct virtio_hw *hw); - +uint8_t virtio_get_isr(struct virtio_hw *hw); #endif /* _VIRTIO_H_ */