code: func (e *endpoint) HandlePacket(r *stack.Route, id stack.TransportEndpointID, vv buffer.VectorisedView) {
  	s := newSegment(r, id, vv)
  	if !s.parse() {
  		e.stack.Stats().MalformedRcvdPackets.Increment()
  		e.stack.Stats().TCP.InvalidSegmentsReceived.Increment()
  		s.decRef()
  		return
  	}
  
  	if !s.csumValid {
  		e.stack.Stats().MalformedRcvdPackets.Increment()
  		e.stack.Stats().TCP.ChecksumErrors.Increment()
  		s.decRef()
  		return
  	}
  
  	e.stack.Stats().TCP.ValidSegmentsReceived.Increment()
  	if (s.flags & header.TCPFlagRst) != 0 {
  		e.stack.Stats().TCP.ResetsReceived.Increment()
  	}
  
  	// Send packet to worker goroutine.
  	if e.segmentQueue.enqueue(s) {
  		e.newSegmentWaker.Assert()
  	} else {
  		// The queue is full, so we drop the segment.
  		e.stack.Stats().DroppedPackets.Increment()
  		s.decRef()
  	}
  }
docs: // HandlePacket is called by the stack when new packets arrive to this transport
  // endpoint.