From 414dec5f0fa117eeef4db6f97c46b8f30ea0c839 Mon Sep 17 00:00:00 2001 From: Andrew Rybchenko Date: Wed, 8 Jun 2016 13:14:52 +0000 Subject: [PATCH] sfxge(4): host byte order is required for IP ID in TSO descriptors Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. MFC after: 1 week --- sys/dev/sfxge/sfxge_tx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c index 08fc8853ec43..198b1e558992 100644 --- a/sys/dev/sfxge/sfxge_tx.c +++ b/sys/dev/sfxge/sfxge_tx.c @@ -992,7 +992,7 @@ static void tso_start(struct sfxge_txq *txq, struct sfxge_tso_state *tso, tso->protocol = TSO_MBUF_PROTO(mbuf); tso->nh_off = mbuf->m_pkthdr.l2hlen; tso->tcph_off = mbuf->m_pkthdr.l3hlen; - tso->packet_id = TSO_MBUF_PACKETID(mbuf); + tso->packet_id = ntohs(TSO_MBUF_PACKETID(mbuf)); #endif #if !SFXGE_TX_PARSE_EARLY @@ -1001,7 +1001,7 @@ static void tso_start(struct sfxge_txq *txq, struct sfxge_tso_state *tso, KASSERT(tso_iph(tso)->ip_p == IPPROTO_TCP, ("TSO required on non-TCP packet")); tso->tcph_off = tso->nh_off + 4 * tso_iph(tso)->ip_hl; - tso->packet_id = tso_iph(tso)->ip_id; + tso->packet_id = ntohs(tso_iph(tso)->ip_id); } else { KASSERT(tso->protocol == htons(ETHERTYPE_IPV6), ("TSO required on non-IP packet"));