From cf831ba4af80cc980e41a715f835956c5249b759 Mon Sep 17 00:00:00 2001 From: hselasky Date: Mon, 2 Feb 2015 17:32:50 +0000 Subject: [PATCH] The flowid and hashtype should be copied from the originating packet when fragmenting IP packets to preserve the order of the packets in a stream. Else the resulting fragments can be sent out of order when the hardware supports multiple transmit rings. Reviewed by: glebius @ MFC after: 1 week Sponsored by: Mellanox Technologies --- sys/netinet/ip_output.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index ccd5e898da9e..ec2813de3f45 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -789,6 +789,10 @@ smart_frag_failure: IPSTAT_INC(ips_odropped); goto done; } + /* make sure the flowid is the same for the fragmented mbufs */ + M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0)); + m->m_pkthdr.flowid = m0->m_pkthdr.flowid; + /* copy multicast flag, if any */ m->m_flags |= (m0->m_flags & M_MCAST); /* * In the first mbuf, leave room for the link header, then