Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Feb 2019 00:30:13 +0000 (UTC)
From:      Alexander Motin <mav@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: r344651 - stable/12/sys/dev/ntb/ntb_hw
Message-ID:  <201902280030.x1S0UDuh034807@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Feb 28 00:30:13 2019
New Revision: 344651
URL: https://svnweb.freebsd.org/changeset/base/344651

Log:
  MFC r344437: Allow I/OAT of present Xeon E5/E7 to work thorugh PLX NTB.
  
  Its a hack, we can't know/list all DMA engines, but this covers all
  I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw.

Modified:
  stable/12/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/ntb/ntb_hw/ntb_hw_plx.c
==============================================================================
--- stable/12/sys/dev/ntb/ntb_hw/ntb_hw_plx.c	Thu Feb 28 00:29:15 2019	(r344650)
+++ stable/12/sys/dev/ntb/ntb_hw/ntb_hw_plx.c	Thu Feb 28 00:30:13 2019	(r344651)
@@ -202,16 +202,24 @@ ntb_plx_init(device_t dev)
 		if (sc->alut)
 			PNTX_WRITE(sc, 0xc94, 0);
 
-		/* Enable Link Interface LUT entries 0/1 for peer 0/1. */
-		PNTX_WRITE(sc, 0xdb4, 0x00090001);
+		/* Enable all Link Interface LUT entries for peer. */
+		for (i = 0; i < 32; i += 2) {
+			PNTX_WRITE(sc, 0xdb4 + i * 2,
+			    0x00010001 | ((i + 1) << 19) | (i << 3));
+		}
 	}
 
 	/*
-	 * Enable Virtual Interface LUT entry 0 for 0:0.0 and
-	 * entry 1 for our Requester ID reported by chip.
+	 * Enable Virtual Interface LUT entry 0 for 0:0.*.
+	 * entry 1 for our Requester ID reported by the chip,
+	 * entries 2-5 for 0/64/128/192:4.* of I/OAT DMA engines.
+	 * XXX: Its a hack, we can't know all DMA engines, but this covers all
+	 * I/OAT of Xeon E5/E7 at least from Sandy Bridge till Skylake I saw.
 	 */
 	val = (NTX_READ(sc, 0xc90) << 16) | 0x00010001;
 	NTX_WRITE(sc, sc->link ? 0xdb4 : 0xd94, val);
+	NTX_WRITE(sc, sc->link ? 0xdb8 : 0xd98, 0x40210021);
+	NTX_WRITE(sc, sc->link ? 0xdbc : 0xd9c, 0xc0218021);
 
 	/* Set Link to Virtual address translation. */
 	for (i = 0; i < sc->mw_count; i++) {



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