Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Nov 2015 22:20:13 +0000 (UTC)
From:      "Conrad E. Meyer" <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r291030 - head/sys/dev/ntb/ntb_hw
Message-ID:  <201511182220.tAIMKD7o084202@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Wed Nov 18 22:20:13 2015
New Revision: 291030
URL: https://svnweb.freebsd.org/changeset/base/291030

Log:
  ntb_hw: Add tunable to disable write-combining
  
  The tunable 'hw.ntb.enable_writecombine' may be set to zero to
  administratively disable write combining the mapped NTB region.
  
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/dev/ntb/ntb_hw/ntb_hw.c

Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c
==============================================================================
--- head/sys/dev/ntb/ntb_hw/ntb_hw.c	Wed Nov 18 22:20:04 2015	(r291029)
+++ head/sys/dev/ntb/ntb_hw/ntb_hw.c	Wed Nov 18 22:20:13 2015	(r291030)
@@ -326,6 +326,10 @@ SYSCTL_UINT(_hw_ntb, OID_AUTO, debug_lev
 	}							\
 } while (0)
 
+static unsigned g_ntb_enable_wc = 1;
+SYSCTL_UINT(_hw_ntb, OID_AUTO, enable_writecombine, CTLFLAG_RDTUN,
+    &g_ntb_enable_wc, 0, "Set to 1 to map memory windows write combining");
+
 static struct ntb_hw_info pci_ids[] = {
 	/* XXX: PS/SS IDs left out until they are supported. */
 	{ 0x0C4E8086, "BWD Atom Processor S1200 Non-Transparent Bridge B2B",
@@ -766,10 +770,13 @@ map_memory_window_bar(struct ntb_softc *
 		save_bar_parameters(bar);
 	}
 
+	print_map_success(ntb, bar, "mw");
+	if (g_ntb_enable_wc == 0)
+		return (0);
+
 	/* Mark bar region as write combining to improve performance. */
 	rc = pmap_change_attr((vm_offset_t)bar->vbase, bar->size,
 	    VM_MEMATTR_WRITE_COMBINING);
-	print_map_success(ntb, bar, "mw");
 	if (rc == 0)
 		device_printf(ntb->device,
 		    "Marked BAR%d v:[%p-%p] p:[%p-%p] as "



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