github.com/vishvananda/netlink@v1.3.0/virtio.go (about)

     1  package netlink
     2  
     3  // features for virtio net
     4  const (
     5  	VIRTIO_NET_F_CSUM                = 0  // Host handles pkts w/ partial csum
     6  	VIRTIO_NET_F_GUEST_CSUM          = 1  // Guest handles pkts w/ partial csum
     7  	VIRTIO_NET_F_CTRL_GUEST_OFFLOADS = 2  // Dynamic offload configuration.
     8  	VIRTIO_NET_F_MTU                 = 3  // Initial MTU advice
     9  	VIRTIO_NET_F_MAC                 = 5  // Host has given MAC address.
    10  	VIRTIO_NET_F_GUEST_TSO4          = 7  // Guest can handle TSOv4 in.
    11  	VIRTIO_NET_F_GUEST_TSO6          = 8  // Guest can handle TSOv6 in.
    12  	VIRTIO_NET_F_GUEST_ECN           = 9  // Guest can handle TSO[6] w/ ECN in.
    13  	VIRTIO_NET_F_GUEST_UFO           = 10 // Guest can handle UFO in.
    14  	VIRTIO_NET_F_HOST_TSO4           = 11 // Host can handle TSOv4 in.
    15  	VIRTIO_NET_F_HOST_TSO6           = 12 // Host can handle TSOv6 in.
    16  	VIRTIO_NET_F_HOST_ECN            = 13 // Host can handle TSO[6] w/ ECN in.
    17  	VIRTIO_NET_F_HOST_UFO            = 14 // Host can handle UFO in.
    18  	VIRTIO_NET_F_MRG_RXBUF           = 15 // Host can merge receive buffers.
    19  	VIRTIO_NET_F_STATUS              = 16 // virtio_net_config.status available
    20  	VIRTIO_NET_F_CTRL_VQ             = 17 // Control channel available
    21  	VIRTIO_NET_F_CTRL_RX             = 18 // Control channel RX mode support
    22  	VIRTIO_NET_F_CTRL_VLAN           = 19 // Control channel VLAN filtering
    23  	VIRTIO_NET_F_CTRL_RX_EXTRA       = 20 // Extra RX mode control support
    24  	VIRTIO_NET_F_GUEST_ANNOUNCE      = 21 // Guest can announce device on the* network
    25  	VIRTIO_NET_F_MQ                  = 22 // Device supports Receive Flow Steering
    26  	VIRTIO_NET_F_CTRL_MAC_ADDR       = 23 // Set MAC address
    27  	VIRTIO_NET_F_VQ_NOTF_COAL        = 52 // Device supports virtqueue notification coalescing
    28  	VIRTIO_NET_F_NOTF_COAL           = 53 // Device supports notifications coalescing
    29  	VIRTIO_NET_F_GUEST_USO4          = 54 // Guest can handle USOv4 in.
    30  	VIRTIO_NET_F_GUEST_USO6          = 55 // Guest can handle USOv6 in.
    31  	VIRTIO_NET_F_HOST_USO            = 56 // Host can handle USO in.
    32  	VIRTIO_NET_F_HASH_REPORT         = 57 // Supports hash report
    33  	VIRTIO_NET_F_GUEST_HDRLEN        = 59 // Guest provides the exact hdr_len value.
    34  	VIRTIO_NET_F_RSS                 = 60 // Supports RSS RX steering
    35  	VIRTIO_NET_F_RSC_EXT             = 61 // extended coalescing info
    36  	VIRTIO_NET_F_STANDBY             = 62 // Act as standby for another device with the same MAC.
    37  	VIRTIO_NET_F_SPEED_DUPLEX        = 63 // Device set linkspeed and duplex
    38  	VIRTIO_NET_F_GSO                 = 6  // Host handles pkts any GSO type
    39  )
    40  
    41  // virtio net status
    42  const (
    43  	VIRTIO_NET_S_LINK_UP  = 1 // Link is up
    44  	VIRTIO_NET_S_ANNOUNCE = 2 // Announcement is needed
    45  )
    46  
    47  // virtio config
    48  const (
    49  	// Do we get callbacks when the ring is completely used, even if we've
    50  	// suppressed them?
    51  	VIRTIO_F_NOTIFY_ON_EMPTY = 24
    52  	// Can the device handle any descriptor layout?
    53  	VIRTIO_F_ANY_LAYOUT = 27
    54  	// v1.0 compliant
    55  	VIRTIO_F_VERSION_1 = 32
    56  	// If clear - device has the platform DMA (e.g. IOMMU) bypass quirk feature.
    57  	// If set - use platform DMA tools to access the memory.
    58  	// Note the reverse polarity (compared to most other features),
    59  	// this is for compatibility with legacy systems.
    60  	VIRTIO_F_ACCESS_PLATFORM = 33
    61  	// Legacy name for VIRTIO_F_ACCESS_PLATFORM (for compatibility with old userspace)
    62  	VIRTIO_F_IOMMU_PLATFORM = VIRTIO_F_ACCESS_PLATFORM
    63  	// This feature indicates support for the packed virtqueue layout.
    64  	VIRTIO_F_RING_PACKED = 34
    65  	// Inorder feature indicates that all buffers are used by the device
    66  	// in the same order in which they have been made available.
    67  	VIRTIO_F_IN_ORDER = 35
    68  	// This feature indicates that memory accesses by the driver and the
    69  	// device are ordered in a way described by the platform.
    70  	VIRTIO_F_ORDER_PLATFORM = 36
    71  	// Does the device support Single Root I/O Virtualization?
    72  	VIRTIO_F_SR_IOV = 37
    73  	// This feature indicates that the driver passes extra data (besides
    74  	// identifying the virtqueue) in its device notifications.
    75  	VIRTIO_F_NOTIFICATION_DATA = 38
    76  	// This feature indicates that the driver uses the data provided by the device
    77  	// as a virtqueue identifier in available buffer notifications.
    78  	VIRTIO_F_NOTIF_CONFIG_DATA = 39
    79  	// This feature indicates that the driver can reset a queue individually.
    80  	VIRTIO_F_RING_RESET = 40
    81  )
    82  
    83  // virtio device ids
    84  const (
    85  	VIRTIO_ID_NET            = 1  // virtio net
    86  	VIRTIO_ID_BLOCK          = 2  // virtio block
    87  	VIRTIO_ID_CONSOLE        = 3  // virtio console
    88  	VIRTIO_ID_RNG            = 4  // virtio rng
    89  	VIRTIO_ID_BALLOON        = 5  // virtio balloon
    90  	VIRTIO_ID_IOMEM          = 6  // virtio ioMemory
    91  	VIRTIO_ID_RPMSG          = 7  // virtio remote processor messaging
    92  	VIRTIO_ID_SCSI           = 8  // virtio scsi
    93  	VIRTIO_ID_9P             = 9  // 9p virtio console
    94  	VIRTIO_ID_MAC80211_WLAN  = 10 // virtio WLAN MAC
    95  	VIRTIO_ID_RPROC_SERIAL   = 11 // virtio remoteproc serial link
    96  	VIRTIO_ID_CAIF           = 12 // Virtio caif
    97  	VIRTIO_ID_MEMORY_BALLOON = 13 // virtio memory balloon
    98  	VIRTIO_ID_GPU            = 16 // virtio GPU
    99  	VIRTIO_ID_CLOCK          = 17 // virtio clock/timer
   100  	VIRTIO_ID_INPUT          = 18 // virtio input
   101  	VIRTIO_ID_VSOCK          = 19 // virtio vsock transport
   102  	VIRTIO_ID_CRYPTO         = 20 // virtio crypto
   103  	VIRTIO_ID_SIGNAL_DIST    = 21 // virtio signal distribution device
   104  	VIRTIO_ID_PSTORE         = 22 // virtio pstore device
   105  	VIRTIO_ID_IOMMU          = 23 // virtio IOMMU
   106  	VIRTIO_ID_MEM            = 24 // virtio mem
   107  	VIRTIO_ID_SOUND          = 25 // virtio sound
   108  	VIRTIO_ID_FS             = 26 // virtio filesystem
   109  	VIRTIO_ID_PMEM           = 27 // virtio pmem
   110  	VIRTIO_ID_RPMB           = 28 // virtio rpmb
   111  	VIRTIO_ID_MAC80211_HWSIM = 29 // virtio mac80211-hwsim
   112  	VIRTIO_ID_VIDEO_ENCODER  = 30 // virtio video encoder
   113  	VIRTIO_ID_VIDEO_DECODER  = 31 // virtio video decoder
   114  	VIRTIO_ID_SCMI           = 32 // virtio SCMI
   115  	VIRTIO_ID_NITRO_SEC_MOD  = 33 // virtio nitro secure module
   116  	VIRTIO_ID_I2C_ADAPTER    = 34 // virtio i2c adapter
   117  	VIRTIO_ID_WATCHDOG       = 35 // virtio watchdog
   118  	VIRTIO_ID_CAN            = 36 // virtio can
   119  	VIRTIO_ID_DMABUF         = 37 // virtio dmabuf
   120  	VIRTIO_ID_PARAM_SERV     = 38 // virtio parameter server
   121  	VIRTIO_ID_AUDIO_POLICY   = 39 // virtio audio policy
   122  	VIRTIO_ID_BT             = 40 // virtio bluetooth
   123  	VIRTIO_ID_GPIO           = 41 // virtio gpio
   124  	// Virtio Transitional IDs
   125  	VIRTIO_TRANS_ID_NET     = 0x1000 // transitional virtio net
   126  	VIRTIO_TRANS_ID_BLOCK   = 0x1001 // transitional virtio block
   127  	VIRTIO_TRANS_ID_BALLOON = 0x1002 // transitional virtio balloon
   128  	VIRTIO_TRANS_ID_CONSOLE = 0x1003 // transitional virtio console
   129  	VIRTIO_TRANS_ID_SCSI    = 0x1004 // transitional virtio SCSI
   130  	VIRTIO_TRANS_ID_RNG     = 0x1005 // transitional virtio rng
   131  	VIRTIO_TRANS_ID_9P      = 0x1009 // transitional virtio 9p console
   132  )