Since f707cc00ed12, tcp_lro_queue_mbuf() passes a packet whose checksum
the hardware has not verified to the stack at once, and queues the
others until the end of the receive pass. IP fragments have no
verified checksum, so a UDP flow that mixes fragmented and whole
datagrams has its fragmented ones delivered ahead of whole ones that
arrived before them in the same pass, although all of them were
received in order on one queue. iflib(4) queues every packet once LRO
is enabled, so this happens with its drivers on any host that forwards
neither IPv4 nor IPv6.
Pass such a packet on at once only when nothing is queued. Otherwise
queue it when it has a hash, so that it keeps its place among the
packets of its flow, and have tcp_lro_flush_all() pass it on from
there. A packet without a hash has no place there, so flush the queue
first. Packets the card did not hash, LACP PDUs on most cards, still
reach the stack without waiting for the end of the pass.
Fixes: f707cc00ed12 ("lro: move pkt rejection checks to leafs...")
MFC with: f707cc00ed12
Sponsored by: Rubicon Communications, LLC ("Netgate")