diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-04-22 01:14:06 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-22 01:14:06 +0000 |
commit | 483350ae7073f8272780725ca812671a5824433f (patch) | |
tree | 9fc49ed4f1b346bfccd77c582f10955770f3acb8 /pkg/tcpip/link/qdisc | |
parent | 7f4a20ac7f137ed07e91fef5cae3aded15b05275 (diff) | |
parent | 47bc115158397024841aa3747be7558b2c317cbb (diff) |
Merge release-20210419.0-18-g47bc11515 (automated)
Diffstat (limited to 'pkg/tcpip/link/qdisc')
-rw-r--r-- | pkg/tcpip/link/qdisc/fifo/endpoint.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/pkg/tcpip/link/qdisc/fifo/endpoint.go b/pkg/tcpip/link/qdisc/fifo/endpoint.go index 128ef6e87..bba6a6973 100644 --- a/pkg/tcpip/link/qdisc/fifo/endpoint.go +++ b/pkg/tcpip/link/qdisc/fifo/endpoint.go @@ -91,7 +91,7 @@ func (q *queueDispatcher) dispatchLoop() { } // We pass a protocol of zero here because each packet carries its // NetworkProtocol. - q.lower.WritePackets(stack.RouteInfo{}, nil /* gso */, batch, 0 /* protocol */) + q.lower.WritePackets(stack.RouteInfo{}, batch, 0 /* protocol */) for pkt := batch.Front(); pkt != nil; pkt = pkt.Next() { batch.Remove(pkt) } @@ -150,12 +150,12 @@ func (e *endpoint) GSOMaxSize() uint32 { } // WritePacket implements stack.LinkEndpoint.WritePacket. -func (e *endpoint) WritePacket(r stack.RouteInfo, gso *stack.GSO, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer) tcpip.Error { - // WritePacket caller's do not set the following fields in PacketBuffer - // so we populate them here. - pkt.EgressRoute = r - pkt.GSOOptions = gso - pkt.NetworkProtocolNumber = protocol +// +// The packet must have the following fields populated: +// - pkt.EgressRoute +// - pkt.GSOOptions +// - pkt.NetworkProtocolNumber +func (e *endpoint) WritePacket(r stack.RouteInfo, protocol tcpip.NetworkProtocolNumber, pkt *stack.PacketBuffer) tcpip.Error { d := e.dispatchers[int(pkt.Hash)%len(e.dispatchers)] if !d.q.enqueue(pkt) { return &tcpip.ErrNoBufferSpace{} @@ -166,12 +166,12 @@ func (e *endpoint) WritePacket(r stack.RouteInfo, gso *stack.GSO, protocol tcpip // WritePackets implements stack.LinkEndpoint.WritePackets. // -// Being a batch API, each packet in pkts should have the following -// fields populated: +// Each packet in the packet buffer list must have the following fields +// populated: // - pkt.EgressRoute // - pkt.GSOOptions // - pkt.NetworkProtocolNumber -func (e *endpoint) WritePackets(r stack.RouteInfo, gso *stack.GSO, pkts stack.PacketBufferList, protocol tcpip.NetworkProtocolNumber) (int, tcpip.Error) { +func (e *endpoint) WritePackets(r stack.RouteInfo, pkts stack.PacketBufferList, protocol tcpip.NetworkProtocolNumber) (int, tcpip.Error) { enqueued := 0 for pkt := pkts.Front(); pkt != nil; { d := e.dispatchers[int(pkt.Hash)%len(e.dispatchers)] |