Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Aug 2016 03:47:39 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r303983 - in user/alc/PQ_LAUNDRY: sys/boot/fdt/dts/arm sys/dev/virtio/network sys/modules/dtb/allwinner sys/netinet sys/vm tools/tools/ath/ath_ee_9300_print
Message-ID:  <201608120347.u7C3ldfo033369@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Fri Aug 12 03:47:38 2016
New Revision: 303983
URL: https://svnweb.freebsd.org/changeset/base/303983

Log:
  MFH r303982

Added:
  user/alc/PQ_LAUNDRY/sys/boot/fdt/dts/arm/pcduino3.dts
     - copied unchanged from r303982, head/sys/boot/fdt/dts/arm/pcduino3.dts
Deleted:
  user/alc/PQ_LAUNDRY/sys/boot/fdt/dts/arm/pcduino3b.dts
Modified:
  user/alc/PQ_LAUNDRY/sys/dev/virtio/network/if_vtnet.c
  user/alc/PQ_LAUNDRY/sys/dev/virtio/network/if_vtnetvar.h
  user/alc/PQ_LAUNDRY/sys/modules/dtb/allwinner/Makefile
  user/alc/PQ_LAUNDRY/sys/netinet/tcp_fastopen.c
  user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c
  user/alc/PQ_LAUNDRY/tools/tools/ath/ath_ee_9300_print/main.c
Directory Properties:
  user/alc/PQ_LAUNDRY/   (props changed)

Copied: user/alc/PQ_LAUNDRY/sys/boot/fdt/dts/arm/pcduino3.dts (from r303982, head/sys/boot/fdt/dts/arm/pcduino3.dts)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/alc/PQ_LAUNDRY/sys/boot/fdt/dts/arm/pcduino3.dts	Fri Aug 12 03:47:38 2016	(r303983, copy of r303982, head/sys/boot/fdt/dts/arm/pcduino3.dts)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2016 Emmanuel Vadot <manu@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include "sun7i-a20-pcduino3.dts"
+#include "sun7i-a20-hdmi.dtsi"
+#include "xpowers-axp209.dtsi"
+
+/ {
+	soc@01c00000 {
+		hdmi@01c16000 {
+			status = "okay";
+		};
+
+		hdmiaudio {
+			status = "okay";
+		};
+	};
+};
+
+&gmac {
+      pinctrl-0 = <&gmac_pins_rgmii_a>;
+      phy-mode = "rgmii";
+};

Modified: user/alc/PQ_LAUNDRY/sys/dev/virtio/network/if_vtnet.c
==============================================================================
--- user/alc/PQ_LAUNDRY/sys/dev/virtio/network/if_vtnet.c	Fri Aug 12 03:22:58 2016	(r303982)
+++ user/alc/PQ_LAUNDRY/sys/dev/virtio/network/if_vtnet.c	Fri Aug 12 03:47:38 2016	(r303983)
@@ -230,18 +230,32 @@ static void	vtnet_disable_interrupts(str
 static int	vtnet_tunable_int(struct vtnet_softc *, const char *, int);
 
 /* Tunables. */
+static SYSCTL_NODE(_hw, OID_AUTO, vtnet, CTLFLAG_RD, 0, "VNET driver parameters");
 static int vtnet_csum_disable = 0;
 TUNABLE_INT("hw.vtnet.csum_disable", &vtnet_csum_disable);
+SYSCTL_INT(_hw_vtnet, OID_AUTO, csum_disable, CTLFLAG_RDTUN,
+    &vtnet_csum_disable, 0, "Disables receive and send checksum offload");
 static int vtnet_tso_disable = 0;
 TUNABLE_INT("hw.vtnet.tso_disable", &vtnet_tso_disable);
+SYSCTL_INT(_hw_vtnet, OID_AUTO, tso_disable, CTLFLAG_RDTUN, &vtnet_tso_disable,
+    0, "Disables TCP Segmentation Offload");
 static int vtnet_lro_disable = 0;
 TUNABLE_INT("hw.vtnet.lro_disable", &vtnet_lro_disable);
+SYSCTL_INT(_hw_vtnet, OID_AUTO, lro_disable, CTLFLAG_RDTUN, &vtnet_lro_disable,
+    0, "Disables TCP Large Receive Offload");
 static int vtnet_mq_disable = 0;
 TUNABLE_INT("hw.vtnet.mq_disable", &vtnet_mq_disable);
-static int vtnet_mq_max_pairs = 0;
+SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_disable, CTLFLAG_RDTUN, &vtnet_mq_disable,
+    0, "Disables Multi Queue support");
+static int vtnet_mq_max_pairs = VTNET_MAX_QUEUE_PAIRS;
 TUNABLE_INT("hw.vtnet.mq_max_pairs", &vtnet_mq_max_pairs);
+SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_max_pairs, CTLFLAG_RDTUN,
+    &vtnet_mq_max_pairs, 0, "Sets the maximum number of Multi Queue pairs");
 static int vtnet_rx_process_limit = 512;
 TUNABLE_INT("hw.vtnet.rx_process_limit", &vtnet_rx_process_limit);
+SYSCTL_INT(_hw_vtnet, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN,
+    &vtnet_rx_process_limit, 0,
+    "Limits the number RX segments processed in a single pass");
 
 static uma_zone_t vtnet_tx_header_zone;
 
@@ -597,7 +611,6 @@ static void
 vtnet_setup_features(struct vtnet_softc *sc)
 {
 	device_t dev;
-	int max_pairs, max;
 
 	dev = sc->vtnet_dev;
 
@@ -646,32 +659,31 @@ vtnet_setup_features(struct vtnet_softc 
 
 	if (virtio_with_feature(dev, VIRTIO_NET_F_MQ) &&
 	    sc->vtnet_flags & VTNET_FLAG_CTRL_VQ) {
-		max_pairs = virtio_read_dev_config_2(dev,
+		sc->vtnet_max_vq_pairs = virtio_read_dev_config_2(dev,
 		    offsetof(struct virtio_net_config, max_virtqueue_pairs));
-		if (max_pairs < VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN ||
-		    max_pairs > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX)
-			max_pairs = 1;
 	} else
-		max_pairs = 1;
+		sc->vtnet_max_vq_pairs = 1;
 
-	if (max_pairs > 1) {
+	if (sc->vtnet_max_vq_pairs > 1) {
 		/*
-		 * Limit the maximum number of queue pairs to the number of
-		 * CPUs or the configured maximum. The actual number of
-		 * queues that get used may be less.
+		 * Limit the maximum number of queue pairs to the lower of
+		 * the number of CPUs and the configured maximum.
+		 * The actual number of queues that get used may be less.
 		 */
+		int max;
+
 		max = vtnet_tunable_int(sc, "mq_max_pairs", vtnet_mq_max_pairs);
-		if (max > 0 && max_pairs > max)
-			max_pairs = max;
-		if (max_pairs > mp_ncpus)
-			max_pairs = mp_ncpus;
-		if (max_pairs > VTNET_MAX_QUEUE_PAIRS)
-			max_pairs = VTNET_MAX_QUEUE_PAIRS;
-		if (max_pairs > 1)
-			sc->vtnet_flags |= VTNET_FLAG_MULTIQ;
+		if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN) {
+			if (max > mp_ncpus)
+				max = mp_ncpus;
+			if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX)
+				max = VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX;
+			if (max > 1) {
+				sc->vtnet_requested_vq_pairs = max;
+				sc->vtnet_flags |= VTNET_FLAG_MULTIQ;
+			}
+		}
 	}
-
-	sc->vtnet_max_vq_pairs = max_pairs;
 }
 
 static int
@@ -2982,13 +2994,11 @@ vtnet_set_active_vq_pairs(struct vtnet_s
 	dev = sc->vtnet_dev;
 
 	if ((sc->vtnet_flags & VTNET_FLAG_MULTIQ) == 0) {
-		MPASS(sc->vtnet_max_vq_pairs == 1);
 		sc->vtnet_act_vq_pairs = 1;
 		return;
 	}
 
-	/* BMV: Just use the maximum configured for now. */
-	npairs = sc->vtnet_max_vq_pairs;
+	npairs = sc->vtnet_requested_vq_pairs;
 
 	if (vtnet_ctrl_mq_cmd(sc, npairs) != 0) {
 		device_printf(dev,
@@ -3852,6 +3862,9 @@ vtnet_setup_sysctl(struct vtnet_softc *s
 	SYSCTL_ADD_INT(ctx, child, OID_AUTO, "max_vq_pairs",
 	    CTLFLAG_RD, &sc->vtnet_max_vq_pairs, 0,
 	    "Maximum number of supported virtqueue pairs");
+	SYSCTL_ADD_INT(ctx, child, OID_AUTO, "requested_vq_pairs",
+	    CTLFLAG_RD, &sc->vtnet_requested_vq_pairs, 0,
+	    "Requested number of virtqueue pairs");
 	SYSCTL_ADD_INT(ctx, child, OID_AUTO, "act_vq_pairs",
 	    CTLFLAG_RD, &sc->vtnet_act_vq_pairs, 0,
 	    "Number of active virtqueue pairs");

Modified: user/alc/PQ_LAUNDRY/sys/dev/virtio/network/if_vtnetvar.h
==============================================================================
--- user/alc/PQ_LAUNDRY/sys/dev/virtio/network/if_vtnetvar.h	Fri Aug 12 03:22:58 2016	(r303982)
+++ user/alc/PQ_LAUNDRY/sys/dev/virtio/network/if_vtnetvar.h	Fri Aug 12 03:47:38 2016	(r303983)
@@ -155,6 +155,7 @@ struct vtnet_softc {
 	int			 vtnet_if_flags;
 	int			 vtnet_act_vq_pairs;
 	int			 vtnet_max_vq_pairs;
+	int			 vtnet_requested_vq_pairs;
 
 	struct virtqueue	*vtnet_ctrl_vq;
 	struct vtnet_mac_filter	*vtnet_mac_filter;

Modified: user/alc/PQ_LAUNDRY/sys/modules/dtb/allwinner/Makefile
==============================================================================
--- user/alc/PQ_LAUNDRY/sys/modules/dtb/allwinner/Makefile	Fri Aug 12 03:22:58 2016	(r303982)
+++ user/alc/PQ_LAUNDRY/sys/modules/dtb/allwinner/Makefile	Fri Aug 12 03:47:38 2016	(r303983)
@@ -7,7 +7,7 @@ DTS=	\
 	cubieboard2.dts \
 	olimex-a20-som-evb.dts \
 	olinuxino-lime.dts \
-	pcduino3b.dts \
+	pcduino3.dts \
 	sinovoip-bpi-m3.dts
 
 .include <bsd.dtb.mk>

Modified: user/alc/PQ_LAUNDRY/sys/netinet/tcp_fastopen.c
==============================================================================
--- user/alc/PQ_LAUNDRY/sys/netinet/tcp_fastopen.c	Fri Aug 12 03:22:58 2016	(r303982)
+++ user/alc/PQ_LAUNDRY/sys/netinet/tcp_fastopen.c	Fri Aug 12 03:47:38 2016	(r303983)
@@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/limits.h>
 #include <sys/lock.h>
 #include <sys/rmlock.h>
+#include <sys/socket.h>
 #include <sys/socketvar.h>
 #include <sys/sysctl.h>
 #include <sys/systm.h>

Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c
==============================================================================
--- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c	Fri Aug 12 03:22:58 2016	(r303982)
+++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c	Fri Aug 12 03:47:38 2016	(r303983)
@@ -1473,15 +1473,13 @@ drop_page:
 	/*
 	 * Scan the active queue for pages that can be deactivated.  Update
 	 * the per-page activity counter and use it to identify deactivation
-	 * candidates.
+	 * candidates.  Held pages may be deactivated.
 	 */
 	for (m = TAILQ_FIRST(&pq->pq_pl), scanned = 0; m != NULL && (scanned <
 	    min_scan || (page_shortage > 0 && scanned < maxscan)); m = next,
 	    scanned++) {
-
 		KASSERT(m->queue == PQ_ACTIVE,
 		    ("vm_pageout_scan: page %p isn't active", m));
-
 		next = TAILQ_NEXT(m, plinks.q);
 		if ((m->flags & PG_MARKER) != 0)
 			continue;
@@ -1495,8 +1493,8 @@ drop_page:
 		}
 
 		/*
-		 * The count for pagedaemon pages is done after checking the
-		 * page for eligibility...
+		 * The count for page daemon pages is updated after checking
+		 * the page for eligibility.
 		 */
 		PCPU_INC(cnt.v_pdpages);
 
@@ -1510,12 +1508,17 @@ drop_page:
 			act_delta = 0;
 
 		/*
-		 * Unlocked object ref count check.  Two races are possible.
-		 * 1) The ref was transitioning to zero and we saw non-zero,
-		 *    the pmap bits will be checked unnecessarily.
-		 * 2) The ref was transitioning to one and we saw zero. 
-		 *    The page lock prevents a new reference to this page so
-		 *    we need not check the reference bits.
+		 * Perform an unsynchronized object ref count check.  While
+		 * the page lock ensures that the page is not reallocated to
+		 * another object, in particular, one with unmanaged mappings
+		 * that cannot support pmap_ts_referenced(), two races are,
+		 * nonetheless, possible:
+		 * 1) The count was transitioning to zero, but we saw a non-
+		 *    zero value.  pmap_ts_referenced() will return zero
+		 *    because the page is not mapped.
+		 * 2) The count was transitioning to one, but we saw zero. 
+		 *    This race delays the detection of a new reference.  At
+		 *    worst, we will deactivate and reactivate the page.
 		 */
 		if (m->object->ref_count != 0)
 			act_delta += pmap_ts_referenced(m);

Modified: user/alc/PQ_LAUNDRY/tools/tools/ath/ath_ee_9300_print/main.c
==============================================================================
--- user/alc/PQ_LAUNDRY/tools/tools/ath/ath_ee_9300_print/main.c	Fri Aug 12 03:22:58 2016	(r303982)
+++ user/alc/PQ_LAUNDRY/tools/tools/ath/ath_ee_9300_print/main.c	Fri Aug 12 03:47:38 2016	(r303983)
@@ -72,8 +72,10 @@ eeprom_9300_base_print(const uint16_t *b
 	    ee_base->device_cap,
 	    ee_base->device_type);
 
-	printf("| pwrTableOffset: %d dB, feature_enable: 0x%02x MiscConfig: 0x%02x |\n",
+	printf("| pwrTableOffset: %d dB, TuningCaps=0x%02x 0x%02x feature_enable: 0x%02x MiscConfig: 0x%02x |\n",
 	    ee_base->pwrTableOffset,
+	    ee_base->params_for_tuning_caps[0],
+	    ee_base->params_for_tuning_caps[1],
 	    ee_base->feature_enable,
 	    ee_base->misc_configuration);
 



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