mirror of
https://github.com/slackhq/nebula.git
synced 2026-05-16 04:47:38 +02:00
holy crap 2x
This commit is contained in:
@@ -30,3 +30,22 @@ type Device interface {
|
||||
SupportsMultiqueue() bool
|
||||
NewMultiQueueReader() (Queue, error)
|
||||
}
|
||||
|
||||
// GSOWriter is implemented by Queues that can write a TCP TSO superpacket as
|
||||
// a single virtio_net_hdr + payload writev, letting the kernel segment on
|
||||
// egress. Callers type-assert on it; backends that don't support GSO return
|
||||
// false from Supported and all coalescing logic is skipped.
|
||||
//
|
||||
// pkt must contain the IPv4/IPv6 + TCP header plus the concatenated
|
||||
// coalesced payload. hdrLen is the total L3+L4 header length (where the
|
||||
// payload starts). csumStart is the byte offset where the TCP header
|
||||
// begins (= IP header length). gsoSize is the MSS — every segment except
|
||||
// possibly the last must be exactly this many payload bytes. isV6 selects
|
||||
// GSO_TCPV4 vs GSO_TCPV6.
|
||||
//
|
||||
// pkt's TCP checksum field must already hold the pseudo-header partial
|
||||
// sum (single-fold, not inverted), per virtio NEEDS_CSUM semantics.
|
||||
type GSOWriter interface {
|
||||
WriteGSO(pkt []byte, gsoSize uint16, isV6 bool, hdrLen, csumStart uint16) error
|
||||
GSOSupported() bool
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user