From 609752f04f73e7643d83b0d6d64674224ffecee9 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky 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 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu, 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