Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jul 2016 21:52:26 +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: r302677 - head/sys/dev/ioat
Message-ID:  <201607122152.u6CLqQMM028482@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Tue Jul 12 21:52:26 2016
New Revision: 302677
URL: https://svnweb.freebsd.org/changeset/base/302677

Log:
  ioat(4): Print some more useful information about the ring from ddb "show ioat"

Modified:
  head/sys/dev/ioat/ioat.c

Modified: head/sys/dev/ioat/ioat.c
==============================================================================
--- head/sys/dev/ioat/ioat.c	Tue Jul 12 21:49:08 2016	(r302676)
+++ head/sys/dev/ioat/ioat.c	Tue Jul 12 21:52:26 2016	(r302677)
@@ -2203,7 +2203,7 @@ DB_SHOW_COMMAND(ioat, db_show_ioat)
 	if (!have_addr)
 		goto usage;
 	idx = (unsigned)addr;
-	if (addr >= ioat_channel_index)
+	if (idx >= ioat_channel_index)
 		goto usage;
 
 	sc = ioat_channel[idx];
@@ -2251,6 +2251,35 @@ DB_SHOW_COMMAND(ioat, db_show_ioat)
 	db_printf(" last_seen: 0x%lx\n", sc->last_seen);
 	db_printf(" ring: %p\n", sc->ring);
 
+	db_printf("  ring[%u] (tail):\n", sc->tail %
+	    (1 << sc->ring_size_order));
+	db_printf("   id: %u\n", ioat_get_ring_entry(sc, sc->tail)->id);
+	db_printf("   addr: 0x%lx\n",
+	    ioat_get_ring_entry(sc, sc->tail)->hw_desc_bus_addr);
+	db_printf("   next: 0x%lx\n",
+	    ioat_get_ring_entry(sc, sc->tail)->u.generic->next);
+
+	db_printf("  ring[%u] (head - 1):\n", (sc->head - 1) %
+	    (1 << sc->ring_size_order));
+	db_printf("   id: %u\n", ioat_get_ring_entry(sc, sc->head - 1)->id);
+	db_printf("   addr: 0x%lx\n",
+	    ioat_get_ring_entry(sc, sc->head - 1)->hw_desc_bus_addr);
+	db_printf("   next: 0x%lx\n",
+	    ioat_get_ring_entry(sc, sc->head - 1)->u.generic->next);
+
+	db_printf("  ring[%u] (head):\n", (sc->head) %
+	    (1 << sc->ring_size_order));
+	db_printf("   id: %u\n", ioat_get_ring_entry(sc, sc->head)->id);
+	db_printf("   addr: 0x%lx\n",
+	    ioat_get_ring_entry(sc, sc->head)->hw_desc_bus_addr);
+	db_printf("   next: 0x%lx\n",
+	    ioat_get_ring_entry(sc, sc->head)->u.generic->next);
+
+	for (idx = 0; idx < (1 << sc->ring_size_order); idx++)
+		if ((*sc->comp_update & IOAT_CHANSTS_COMPLETED_DESCRIPTOR_MASK)
+		    == ioat_get_ring_entry(sc, idx)->hw_desc_bus_addr)
+			db_printf("  ring[%u] == hardware tail\n", idx);
+
 	db_printf(" cleanup_lock: ");
 	db_show_lock(&sc->cleanup_lock);
 



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