Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/virtio/network/if_vtnetvar.h
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | struct vtnet_rxq { | ||||
struct mtx vtnrx_mtx; | struct mtx vtnrx_mtx; | ||||
struct vtnet_softc *vtnrx_sc; | struct vtnet_softc *vtnrx_sc; | ||||
struct virtqueue *vtnrx_vq; | struct virtqueue *vtnrx_vq; | ||||
struct sglist *vtnrx_sg; | struct sglist *vtnrx_sg; | ||||
int vtnrx_id; | int vtnrx_id; | ||||
struct vtnet_rxq_stats vtnrx_stats; | struct vtnet_rxq_stats vtnrx_stats; | ||||
struct taskqueue *vtnrx_tq; | struct taskqueue *vtnrx_tq; | ||||
struct task vtnrx_intrtask; | struct task vtnrx_intrtask; | ||||
struct lro_ctrl vtnrx_lro; | |||||
#ifdef DEV_NETMAP | #ifdef DEV_NETMAP | ||||
uint32_t vtnrx_nm_refill; | uint32_t vtnrx_nm_refill; | ||||
struct virtio_net_hdr_mrg_rxbuf vtnrx_shrhdr; | struct virtio_net_hdr_mrg_rxbuf vtnrx_shrhdr; | ||||
#endif /* DEV_NETMAP */ | #endif /* DEV_NETMAP */ | ||||
char vtnrx_name[16]; | char vtnrx_name[16]; | ||||
} __aligned(CACHE_LINE_SIZE); | } __aligned(CACHE_LINE_SIZE); | ||||
#define VTNET_RXQ_LOCK(_rxq) mtx_lock(&(_rxq)->vtnrx_mtx) | #define VTNET_RXQ_LOCK(_rxq) mtx_lock(&(_rxq)->vtnrx_mtx) | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
#define VTNET_FLAG_TSO_ECN 0x0040 | #define VTNET_FLAG_TSO_ECN 0x0040 | ||||
#define VTNET_FLAG_MRG_RXBUFS 0x0080 | #define VTNET_FLAG_MRG_RXBUFS 0x0080 | ||||
#define VTNET_FLAG_LRO_NOMRG 0x0100 | #define VTNET_FLAG_LRO_NOMRG 0x0100 | ||||
#define VTNET_FLAG_MQ 0x0200 | #define VTNET_FLAG_MQ 0x0200 | ||||
#define VTNET_FLAG_INDIRECT 0x0400 | #define VTNET_FLAG_INDIRECT 0x0400 | ||||
#define VTNET_FLAG_EVENT_IDX 0x0800 | #define VTNET_FLAG_EVENT_IDX 0x0800 | ||||
#define VTNET_FLAG_SUSPENDED 0x1000 | #define VTNET_FLAG_SUSPENDED 0x1000 | ||||
#define VTNET_FLAG_FIXUP_NEEDS_CSUM 0x2000 | #define VTNET_FLAG_FIXUP_NEEDS_CSUM 0x2000 | ||||
#define VTNET_FLAG_SW_LRO 0x4000 | |||||
int vtnet_link_active; | int vtnet_link_active; | ||||
int vtnet_hdr_size; | int vtnet_hdr_size; | ||||
int vtnet_rx_process_limit; | int vtnet_rx_process_limit; | ||||
int vtnet_rx_nsegs; | int vtnet_rx_nsegs; | ||||
int vtnet_rx_nmbufs; | int vtnet_rx_nmbufs; | ||||
int vtnet_rx_clustersz; | int vtnet_rx_clustersz; | ||||
int vtnet_tx_nsegs; | int vtnet_tx_nsegs; | ||||
int vtnet_if_flags; | int vtnet_if_flags; | ||||
int vtnet_max_mtu; | int vtnet_max_mtu; | ||||
int vtnet_act_vq_pairs; | int vtnet_act_vq_pairs; | ||||
int vtnet_max_vq_pairs; | int vtnet_max_vq_pairs; | ||||
int vtnet_requested_vq_pairs; | int vtnet_requested_vq_pairs; | ||||
int vtnet_lro_entry_count; | |||||
int vtnet_lro_mbufq_depth; | |||||
struct virtqueue *vtnet_ctrl_vq; | struct virtqueue *vtnet_ctrl_vq; | ||||
struct vtnet_mac_filter *vtnet_mac_filter; | struct vtnet_mac_filter *vtnet_mac_filter; | ||||
uint32_t *vtnet_vlan_filter; | uint32_t *vtnet_vlan_filter; | ||||
uint64_t vtnet_features; | uint64_t vtnet_features; | ||||
uint64_t vtnet_negotiated_features; | uint64_t vtnet_negotiated_features; | ||||
struct vtnet_statistics vtnet_stats; | struct vtnet_statistics vtnet_stats; | ||||
struct callout vtnet_tick_ch; | struct callout vtnet_tick_ch; | ||||
struct ifmedia vtnet_media; | struct ifmedia vtnet_media; | ||||
eventhandler_tag vtnet_vlan_attach; | eventhandler_tag vtnet_vlan_attach; | ||||
eventhandler_tag vtnet_vlan_detach; | eventhandler_tag vtnet_vlan_detach; | ||||
struct mtx vtnet_mtx; | struct mtx vtnet_mtx; | ||||
char vtnet_mtx_name[16]; | char vtnet_mtx_name[16]; | ||||
char vtnet_hwaddr[ETHER_ADDR_LEN]; | char vtnet_hwaddr[ETHER_ADDR_LEN]; | ||||
}; | }; | ||||
static bool | static bool | ||||
vtnet_modern(struct vtnet_softc *sc) | vtnet_modern(struct vtnet_softc *sc) | ||||
{ | { | ||||
return ((sc->vtnet_flags & VTNET_FLAG_MODERN) != 0); | return ((sc->vtnet_flags & VTNET_FLAG_MODERN) != 0); | ||||
} | } | ||||
static bool | |||||
vtnet_software_lro(struct vtnet_softc *sc) | |||||
{ | |||||
return ((sc->vtnet_flags & VTNET_FLAG_SW_LRO) != 0); | |||||
} | |||||
/* | /* | ||||
* Maximum number of queue pairs we will autoconfigure to. | * Maximum number of queue pairs we will autoconfigure to. | ||||
*/ | */ | ||||
#define VTNET_MAX_QUEUE_PAIRS 32 | #define VTNET_MAX_QUEUE_PAIRS 32 | ||||
/* | /* | ||||
* Additional completed entries can appear in a virtqueue before we can | * Additional completed entries can appear in a virtqueue before we can | ||||
* reenable interrupts. Number of times to retry before scheduling the | * reenable interrupts. Number of times to retry before scheduling the | ||||
▲ Show 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | |||||
* The VIRTIO_NET_F_HOST_TSO[46] features permit us to send the host | * The VIRTIO_NET_F_HOST_TSO[46] features permit us to send the host | ||||
* frames larger than 1514 bytes. | * frames larger than 1514 bytes. | ||||
*/ | */ | ||||
#define VTNET_TSO_FEATURES (VIRTIO_NET_F_GSO | VIRTIO_NET_F_HOST_TSO4 | \ | #define VTNET_TSO_FEATURES (VIRTIO_NET_F_GSO | VIRTIO_NET_F_HOST_TSO4 | \ | ||||
VIRTIO_NET_F_HOST_TSO6 | VIRTIO_NET_F_HOST_ECN) | VIRTIO_NET_F_HOST_TSO6 | VIRTIO_NET_F_HOST_ECN) | ||||
/* | /* | ||||
* The VIRTIO_NET_F_GUEST_TSO[46] features permit the host to send us | * The VIRTIO_NET_F_GUEST_TSO[46] features permit the host to send us | ||||
* frames larger than 1514 bytes. We do not yet support software LRO | * frames larger than 1514 bytes. | ||||
* via tcp_lro_rx(). | |||||
*/ | */ | ||||
#define VTNET_LRO_FEATURES (VIRTIO_NET_F_GUEST_TSO4 | \ | #define VTNET_LRO_FEATURES (VIRTIO_NET_F_GUEST_TSO4 | \ | ||||
VIRTIO_NET_F_GUEST_TSO6 | VIRTIO_NET_F_GUEST_ECN) | VIRTIO_NET_F_GUEST_TSO6 | VIRTIO_NET_F_GUEST_ECN) | ||||
#define VTNET_MAX_MTU 65536 | #define VTNET_MAX_MTU 65536 | ||||
#define VTNET_MAX_RX_SIZE 65550 | #define VTNET_MAX_RX_SIZE 65550 | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |