Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 May 2019 08:19:43 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r347900 - stable/12/sys/dev/virtio/network
Message-ID:  <201905170819.x4H8Jhhv076449@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Fri May 17 08:19:43 2019
New Revision: 347900
URL: https://svnweb.freebsd.org/changeset/base/347900

Log:
  MFC r347233:
  
  Remove non-functional SCTP checksum offload support for virtio.
  
  Checksum offloading for SCTP is not currently specified for virtio.
  If the hypervisor announces checksum offloading support, it means TCP
  and UDP checksum offload. If an SCTP packet is sent and the host announced
  checksum offload support, the hypervisor inserts the IP checksum (16-bit)
  at the correct offset, but this is not the right checksum, which is a CRC32c.
  This results in all outgoing packets having the wrong checksum and therefore
  breaking SCTP based communications.
  
  This patch removes SCTP checksum offloading support from the virtio
  network interface.
  
  Thanks to Felix Weinrank for making me aware of the issue.

Modified:
  stable/12/sys/dev/virtio/network/if_vtnet.c
  stable/12/sys/dev/virtio/network/if_vtnetvar.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- stable/12/sys/dev/virtio/network/if_vtnet.c	Fri May 17 00:02:35 2019	(r347899)
+++ stable/12/sys/dev/virtio/network/if_vtnet.c	Fri May 17 08:19:43 2019	(r347900)
@@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet6/ip6_var.h>
 #include <netinet/udp.h>
 #include <netinet/tcp.h>
-#include <netinet/sctp.h>
 #include <netinet/netdump/netdump.h>
 
 #include <machine/bus.h>
@@ -1525,9 +1524,6 @@ vtnet_rxq_csum_by_offset(struct vtnet_rxq *rxq, struct
 		m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
 		m->m_pkthdr.csum_data = 0xFFFF;
 		break;
-	case offsetof(struct sctphdr, checksum):
-		m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID;
-		break;
 	default:
 		sc->vtnet_stats.rx_csum_bad_offset++;
 		return (1);
@@ -1584,11 +1580,6 @@ vtnet_rxq_csum_by_parse(struct vtnet_rxq *rxq, struct 
 			return (1);
 		m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR;
 		m->m_pkthdr.csum_data = 0xFFFF;
-		break;
-	case IPPROTO_SCTP:
-		if (__predict_false(m->m_len < offset + sizeof(struct sctphdr)))
-			return (1);
-		m->m_pkthdr.csum_flags |= CSUM_SCTP_VALID;
 		break;
 	default:
 		/*

Modified: stable/12/sys/dev/virtio/network/if_vtnetvar.h
==============================================================================
--- stable/12/sys/dev/virtio/network/if_vtnetvar.h	Fri May 17 00:02:35 2019	(r347899)
+++ stable/12/sys/dev/virtio/network/if_vtnetvar.h	Fri May 17 08:19:43 2019	(r347900)
@@ -268,8 +268,8 @@ struct vtnet_mac_filter {
 CTASSERT(sizeof(struct vtnet_mac_filter) <= PAGE_SIZE);
 
 #define VTNET_TX_TIMEOUT	5
-#define VTNET_CSUM_OFFLOAD	(CSUM_TCP | CSUM_UDP | CSUM_SCTP)
-#define VTNET_CSUM_OFFLOAD_IPV6	(CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_SCTP_IPV6)
+#define VTNET_CSUM_OFFLOAD	(CSUM_TCP | CSUM_UDP)
+#define VTNET_CSUM_OFFLOAD_IPV6	(CSUM_TCP_IPV6 | CSUM_UDP_IPV6)
 
 #define VTNET_CSUM_ALL_OFFLOAD	\
     (VTNET_CSUM_OFFLOAD | VTNET_CSUM_OFFLOAD_IPV6 | CSUM_TSO)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905170819.x4H8Jhhv076449>