From 45c97751fb0cceb89588c2474860d62c9d603dc1 Mon Sep 17 00:00:00 2001 From: Jordan Whited Date: Thu, 29 Aug 2024 13:04:46 -0700 Subject: [PATCH] net/tstun: clarify GROFilterFunc *gro.GRO usage (#13318) Updates #cleanup Signed-off-by: Jordan Whited --- net/tstun/wrap.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/tstun/wrap.go b/net/tstun/wrap.go index dacf0ec57c49b..514ebcaaf1f5e 100644 --- a/net/tstun/wrap.go +++ b/net/tstun/wrap.go @@ -80,9 +80,10 @@ type FilterFunc func(*packet.Parsed, *Wrapper) filter.Response // throughput where GRO is supported by a packet.Parsed interceptor, e.g. // netstack/gVisor, and we are handling a vector of packets. Callers must pass a // nil g for the first packet in a given vector, and continue passing the -// returned *gro.GRO for all remaining packets in said vector. If g is non-nil -// after the last packet for a given vector is passed through the GROFilterFunc, -// the caller must also call g.Flush(). +// returned *gro.GRO for all remaining packets in said vector. If the returned +// *gro.GRO is non-nil after the last packet for a given vector is passed +// through the GROFilterFunc, the caller must also call Flush() on it to deliver +// any previously Enqueue()'d packets. type GROFilterFunc func(p *packet.Parsed, w *Wrapper, g *gro.GRO) (filter.Response, *gro.GRO) // Wrapper augments a tun.Device with packet filtering and injection.