svn commit: r347878 - stable/11/sys/dev/virtio/network

Michael Tuexen tuexen at FreeBSD.org
Thu May 16 18:26:44 UTC 2019


Author: tuexen
Date: Thu May 16 18:26:42 2019
New Revision: 347878
URL: https://svnweb.freebsd.org/changeset/base/347878

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/11/sys/dev/virtio/network/if_vtnet.c
  stable/11/sys/dev/virtio/network/if_vtnetvar.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- stable/11/sys/dev/virtio/network/if_vtnet.c	Thu May 16 18:26:14 2019	(r347877)
+++ stable/11/sys/dev/virtio/network/if_vtnet.c	Thu May 16 18:26:42 2019	(r347878)
@@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
 #include <netinet6/ip6_var.h>
 #include <netinet/udp.h>
 #include <netinet/tcp.h>
-#include <netinet/sctp.h>
 
 #include <machine/bus.h>
 #include <machine/resource.h>
@@ -1519,9 +1518,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);
@@ -1578,11 +1574,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/11/sys/dev/virtio/network/if_vtnetvar.h
==============================================================================
--- stable/11/sys/dev/virtio/network/if_vtnetvar.h	Thu May 16 18:26:14 2019	(r347877)
+++ stable/11/sys/dev/virtio/network/if_vtnetvar.h	Thu May 16 18:26:42 2019	(r347878)
@@ -266,8 +266,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)


More information about the svn-src-all mailing list