GSO/GRO offloads, with TCP+ECN and UDP support

This commit is contained in:
JackDoan
2026-04-17 10:25:05 -05:00
parent 4b4331ba42
commit 6a46a2913a
60 changed files with 6915 additions and 283 deletions

View File

@@ -39,10 +39,10 @@ type UserDevice struct {
inboundWriter *io.PipeWriter
readBuf []byte
batchRet [1][]byte
batchRet [1]tio.Packet
}
func (d *UserDevice) Read() ([][]byte, error) {
func (d *UserDevice) Read() ([]tio.Packet, error) {
if d.readBuf == nil {
d.readBuf = make([]byte, defaultBatchBufSize)
}
@@ -50,7 +50,7 @@ func (d *UserDevice) Read() ([][]byte, error) {
if err != nil {
return nil, err
}
d.batchRet[0] = d.readBuf[:n]
d.batchRet[0] = tio.Packet{Bytes: d.readBuf[:n]}
return d.batchRet[:], nil
}