svn commit: r268849 - in stable/9/sys: amd64/conf dev/xen/netback dev/xen/netfront

Don Lewis truckman at FreeBSD.org
Fri Jul 18 18:00:02 UTC 2014


Author: truckman
Date: Fri Jul 18 18:00:00 2014
New Revision: 268849
URL: http://svnweb.freebsd.org/changeset/base/268849

Log:
  Merge r256868,257276-257277,257515,257913 from head. These are fixes
  required to make Xen buildable w/o INET.  This is the same as r259541
  in stable/10 by glebius.

Modified:
  stable/9/sys/amd64/conf/NOTES
  stable/9/sys/dev/xen/netback/netback.c
  stable/9/sys/dev/xen/netback/netback_unit_tests.c
  stable/9/sys/dev/xen/netfront/netfront.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/amd64/conf/NOTES
==============================================================================
--- stable/9/sys/amd64/conf/NOTES	Fri Jul 18 17:55:12 2014	(r268848)
+++ stable/9/sys/amd64/conf/NOTES	Fri Jul 18 18:00:00 2014	(r268849)
@@ -472,6 +472,12 @@ device		virtio_blk	# VirtIO Block device
 device		virtio_scsi	# VirtIO SCSI device
 device		virtio_balloon	# VirtIO Memory Balloon device
 
+device 		hyperv		# HyperV drivers
+
+# Xen HVM Guest Optimizations
+options 	XENHVM		# Xen HVM kernel infrastructure 
+device 		xenpci		# Xen HVM Hypervisor services driver
+
 #####################################################################
 
 #

Modified: stable/9/sys/dev/xen/netback/netback.c
==============================================================================
--- stable/9/sys/dev/xen/netback/netback.c	Fri Jul 18 17:55:12 2014	(r268848)
+++ stable/9/sys/dev/xen/netback/netback.c	Fri Jul 18 18:00:00 2014	(r268849)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
  * 	  from this FreeBSD domain to other domains.
  */
 #include "opt_inet.h"
+#include "opt_inet6.h"
 #include "opt_global.h"
 
 #include "opt_sctp.h"
@@ -182,7 +183,6 @@ static int	xnb_rxpkt2gnttab(const struct
 static int	xnb_rxpkt2rsp(const struct xnb_pkt *pkt,
 			      const gnttab_copy_table gnttab, int n_entries,
 			      netif_rx_back_ring_t *ring);
-static void	xnb_add_mbuf_cksum(struct mbuf *mbufc);
 static void	xnb_stop(struct xnb_softc*);
 static int	xnb_ioctl(struct ifnet*, u_long, caddr_t);
 static void	xnb_start_locked(struct ifnet*);
@@ -193,6 +193,9 @@ static void	xnb_ifinit(void*);
 static int	xnb_unit_test_main(SYSCTL_HANDLER_ARGS);
 static int	xnb_dump_rings(SYSCTL_HANDLER_ARGS);
 #endif
+#if defined(INET) || defined(INET6)
+static void	xnb_add_mbuf_cksum(struct mbuf *mbufc);
+#endif
 /*------------------------------ Data Structures -----------------------------*/
 
 
@@ -1780,7 +1783,9 @@ xnb_update_mbufc(struct mbuf *mbufc, con
 	}
 	mbufc->m_pkthdr.len = total_size;
 
+#if defined(INET) || defined(INET6)
 	xnb_add_mbuf_cksum(mbufc);
+#endif
 }
 
 /**
@@ -2123,6 +2128,7 @@ xnb_rxpkt2rsp(const struct xnb_pkt *pkt,
 	return n_responses;
 }
 
+#if defined(INET) || defined(INET6)
 /**
  * Add IP, TCP, and/or UDP checksums to every mbuf in a chain.  The first mbuf
  * in the chain must start with a struct ether_header.
@@ -2177,6 +2183,7 @@ xnb_add_mbuf_cksum(struct mbuf *mbufc)
 		break;
 	}
 }
+#endif /* INET || INET6 */
 
 static void
 xnb_stop(struct xnb_softc *xnb)
@@ -2193,8 +2200,8 @@ static int
 xnb_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 {
 	struct xnb_softc *xnb = ifp->if_softc;
-#ifdef INET
 	struct ifreq *ifr = (struct ifreq*) data;
+#ifdef INET
 	struct ifaddr *ifa = (struct ifaddr*)data;
 #endif
 	int error = 0;

Modified: stable/9/sys/dev/xen/netback/netback_unit_tests.c
==============================================================================
--- stable/9/sys/dev/xen/netback/netback_unit_tests.c	Fri Jul 18 17:55:12 2014	(r268848)
+++ stable/9/sys/dev/xen/netback/netback_unit_tests.c	Fri Jul 18 18:00:00 2014	(r268849)
@@ -104,10 +104,6 @@ struct test_fixture {
 
 typedef struct test_fixture test_fixture_t;
 
-static void	xnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len,
-				   uint16_t ip_id, uint16_t ip_p,
-				   uint16_t ip_off, uint16_t ip_sum);
-static void	xnb_fill_tcp(struct mbuf *m);
 static int	xnb_get1pkt(struct xnb_pkt *pkt, size_t size, uint16_t flags);
 static int	xnb_unit_test_runner(test_fixture_t const tests[], int ntests,
 				     char *buffer, size_t buflen);
@@ -163,17 +159,24 @@ static testcase_t xnb_rxpkt2rsp_extra;
 static testcase_t xnb_rxpkt2rsp_2short;
 static testcase_t xnb_rxpkt2rsp_2slots;
 static testcase_t xnb_rxpkt2rsp_copyerror;
+static testcase_t xnb_sscanf_llu;
+static testcase_t xnb_sscanf_lld;
+static testcase_t xnb_sscanf_hhu;
+static testcase_t xnb_sscanf_hhd;
+static testcase_t xnb_sscanf_hhn;
+
+#if defined(INET) || defined(INET6)
 /* TODO: add test cases for xnb_add_mbuf_cksum for IPV6 tcp and udp */
 static testcase_t xnb_add_mbuf_cksum_arp;
 static testcase_t xnb_add_mbuf_cksum_tcp;
 static testcase_t xnb_add_mbuf_cksum_udp;
 static testcase_t xnb_add_mbuf_cksum_icmp;
 static testcase_t xnb_add_mbuf_cksum_tcp_swcksum;
-static testcase_t xnb_sscanf_llu;
-static testcase_t xnb_sscanf_lld;
-static testcase_t xnb_sscanf_hhu;
-static testcase_t xnb_sscanf_hhd;
-static testcase_t xnb_sscanf_hhn;
+static void	xnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len,
+				   uint16_t ip_id, uint16_t ip_p,
+				   uint16_t ip_off, uint16_t ip_sum);
+static void	xnb_fill_tcp(struct mbuf *m);
+#endif /* INET || INET6 */
 
 /** Private data used by unit tests */
 static struct {
@@ -307,11 +310,13 @@ xnb_unit_test_main(SYSCTL_HANDLER_ARGS) 
 		{setup_pvt_data, xnb_rxpkt2rsp_2short, teardown_pvt_data},
 		{setup_pvt_data, xnb_rxpkt2rsp_2slots, teardown_pvt_data},
 		{setup_pvt_data, xnb_rxpkt2rsp_copyerror, teardown_pvt_data},
+#if defined(INET) || defined(INET6)
 		{null_setup, xnb_add_mbuf_cksum_arp, null_teardown},
 		{null_setup, xnb_add_mbuf_cksum_icmp, null_teardown},
 		{null_setup, xnb_add_mbuf_cksum_tcp, null_teardown},
 		{null_setup, xnb_add_mbuf_cksum_tcp_swcksum, null_teardown},
 		{null_setup, xnb_add_mbuf_cksum_udp, null_teardown},
+#endif
 		{null_setup, xnb_sscanf_hhd, null_teardown},
 		{null_setup, xnb_sscanf_hhu, null_teardown},
 		{null_setup, xnb_sscanf_lld, null_teardown},
@@ -2066,6 +2071,7 @@ xnb_rxpkt2rsp_copyerror(char *buffer, si
 	safe_m_freem(&mbuf);
 }
 
+#if defined(INET) || defined(INET6)
 /**
  * xnb_add_mbuf_cksum on an ARP request packet
  */
@@ -2430,6 +2436,7 @@ xnb_add_mbuf_cksum_tcp_swcksum(char *buf
 
 	m_freem(mbufc);
 }
+#endif /* INET || INET6 */
 
 /**
  * sscanf on unsigned chars

Modified: stable/9/sys/dev/xen/netfront/netfront.c
==============================================================================
--- stable/9/sys/dev/xen/netfront/netfront.c	Fri Jul 18 17:55:12 2014	(r268848)
+++ stable/9/sys/dev/xen/netfront/netfront.c	Fri Jul 18 18:00:00 2014	(r268849)
@@ -28,6 +28,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_inet.h"
+#include "opt_inet6.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -166,7 +167,6 @@ static int  xn_configure_features(struct
 static void xn_watchdog(struct ifnet *);
 #endif
 
-static void show_device(struct netfront_info *sc);
 #ifdef notyet
 static void netfront_closing(device_t dev);
 #endif
@@ -645,8 +645,6 @@ setup_device(device_t dev, struct netfro
 		goto fail;
 	}
 
-	show_device(info);
-	
 	return (0);
 	
  fail:
@@ -968,7 +966,7 @@ static void
 xn_rxeof(struct netfront_info *np)
 {
 	struct ifnet *ifp;
-#if __FreeBSD_version >= 700000
+#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6))
 	struct lro_ctrl *lro = &np->xn_lro;
 	struct lro_entry *queued;
 #endif
@@ -1065,7 +1063,7 @@ xn_rxeof(struct netfront_info *np)
 			 * Do we really need to drop the rx lock?
 			 */
 			XN_RX_UNLOCK(np);
-#if __FreeBSD_version >= 700000
+#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6))
 			/* Use LRO if possible */
 			if ((ifp->if_capenable & IFCAP_LRO) == 0 ||
 			    lro->lro_cnt == 0 || tcp_lro_rx(lro, m, 0)) {
@@ -1083,7 +1081,7 @@ xn_rxeof(struct netfront_info *np)
 	
 		np->rx.rsp_cons = i;
 
-#if __FreeBSD_version >= 700000
+#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6))
 		/*
 		 * Flush any outstanding LRO work
 		 */
@@ -1970,25 +1968,6 @@ network_connect(struct netfront_info *np
 	return (0);
 }
 
-static void 
-show_device(struct netfront_info *sc)
-{
-#ifdef DEBUG
-	if (sc) {
-		IPRINTK("<vif handle=%u %s(%s) evtchn=%u irq=%u tx=%p rx=%p>\n",
-			sc->xn_ifno,
-			be_state_name[sc->xn_backend_state],
-			sc->xn_user_state ? "open" : "closed",
-			sc->xn_evtchn,
-			sc->xn_irq,
-			sc->xn_tx_if,
-			sc->xn_rx_if);
-	} else {
-		IPRINTK("<vif NULL>\n");
-	}
-#endif
-}
-
 static void
 xn_query_features(struct netfront_info *np)
 {
@@ -2025,14 +2004,14 @@ xn_configure_features(struct netfront_in
 	int err;
 
 	err = 0;
-#if __FreeBSD_version >= 700000
+#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6))
 	if ((np->xn_ifp->if_capenable & IFCAP_LRO) != 0)
 		tcp_lro_free(&np->xn_lro);
 #endif
     	np->xn_ifp->if_capenable =
 	    np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4);
 	np->xn_ifp->if_hwassist &= ~CSUM_TSO;
-#if __FreeBSD_version >= 700000
+#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6))
 	if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) {
 		err = tcp_lro_init(&np->xn_lro);
 		if (err) {


More information about the svn-src-all mailing list