From d9a66b6ded4fce6e364be420318ef45bf7e84c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Date: Thu, 2 Jun 2016 11:12:11 +0000 Subject: [PATCH] xen-netfront: fix receiving TSO packets Currently FreeBSD is not properly fetching the TSO information from the Xen PV ring, and thus the received packets didn't have all the necessary information, like the segment size or even the TSO flag set. Sponsored by: Citrix Systems R&D --- sys/dev/xen/netfront/netfront.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c index 356445c9ba1..2576668449d 100644 --- a/sys/dev/xen/netfront/netfront.c +++ b/sys/dev/xen/netfront/netfront.c @@ -1253,6 +1253,13 @@ xn_rxeof(struct netfront_rxq *rxq) | CSUM_PSEUDO_HDR); m->m_pkthdr.csum_data = 0xffff; } + if ((rx->flags & NETRXF_extra_info) != 0 && + (extras[XEN_NETIF_EXTRA_TYPE_GSO - 1].type == + XEN_NETIF_EXTRA_TYPE_GSO)) { + m->m_pkthdr.tso_segsz = + extras[XEN_NETIF_EXTRA_TYPE_GSO - 1].u.gso.size; + m->m_pkthdr.csum_flags |= CSUM_TSO; + } rxq->stats.rx_packets++; rxq->stats.rx_bytes += m->m_pkthdr.len;