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

@@ -104,7 +104,7 @@ type tun struct {
closed atomic.Bool
readBuf []byte
batchRet [1][]byte
batchRet [1]tio.Packet
}
// blockOnRead waits until the tun fd is readable or shutdown has been signaled.
@@ -159,12 +159,12 @@ func (t *tun) blockOnWrite() error {
return nil
}
func (t *tun) Read() ([][]byte, error) {
func (t *tun) Read() ([]tio.Packet, error) {
n, err := t.readOne(t.readBuf)
if err != nil {
return nil, err
}
t.batchRet[0] = t.readBuf[:n]
t.batchRet[0] = tio.Packet{Bytes: t.readBuf[:n]}
return t.batchRet[:], nil
}