mirror of
https://github.com/slackhq/nebula.git
synced 2025-12-16 20:08:27 +01:00
vhost
This commit is contained in:
21
overlay/virtqueue/used_element.go
Normal file
21
overlay/virtqueue/used_element.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package virtqueue
|
||||
|
||||
// usedElementSize is the number of bytes needed to store a [UsedElement] in
|
||||
// memory.
|
||||
const usedElementSize = 8
|
||||
|
||||
// UsedElement is an element of the [UsedRing] and describes a descriptor chain
|
||||
// that was used by the device.
|
||||
type UsedElement struct {
|
||||
// DescriptorIndex is the index of the head of the used descriptor chain in
|
||||
// the [DescriptorTable].
|
||||
// The index is 32-bit here for padding reasons.
|
||||
DescriptorIndex uint32
|
||||
// Length is the number of bytes written into the device writable portion of
|
||||
// the buffer described by the descriptor chain.
|
||||
Length uint32
|
||||
}
|
||||
|
||||
func (u *UsedElement) GetHead() uint16 {
|
||||
return uint16(u.DescriptorIndex)
|
||||
}
|
||||
Reference in New Issue
Block a user