From owner-svn-src-stable-12@freebsd.org Fri Nov 29 00:38:17 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A8831BD725; Fri, 29 Nov 2019 00:38:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47PFwn1hNDz4HG1; Fri, 29 Nov 2019 00:38:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18DD96185; Fri, 29 Nov 2019 00:38:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAT0cGFS011146; Fri, 29 Nov 2019 00:38:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAT0cGwm011143; Fri, 29 Nov 2019 00:38:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201911290038.xAT0cGwm011143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 29 Nov 2019 00:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r355197 - in stable/12: sys/dev/ioat tools/tools/ioat X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12: sys/dev/ioat tools/tools/ioat X-SVN-Commit-Revision: 355197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Nov 2019 00:38:17 -0000 Author: mav Date: Fri Nov 29 00:38:16 2019 New Revision: 355197 URL: https://svnweb.freebsd.org/changeset/base/355197 Log: MFC r345812 (by tychon): ioatcontrol(8) could exercise 8k-aligned copy with page-break, crc and crc-copy modes. Modified: stable/12/sys/dev/ioat/ioat_test.c stable/12/sys/dev/ioat/ioat_test.h stable/12/tools/tools/ioat/ioatcontrol.8 stable/12/tools/tools/ioat/ioatcontrol.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ioat/ioat_test.c ============================================================================== --- stable/12/sys/dev/ioat/ioat_test.c Fri Nov 29 00:26:05 2019 (r355196) +++ stable/12/sys/dev/ioat/ioat_test.c Fri Nov 29 00:38:16 2019 (r355197) @@ -65,6 +65,7 @@ struct test_transaction { void *buf[IOAT_MAX_BUFS]; uint32_t length; uint32_t depth; + uint32_t crc[IOAT_MAX_BUFS]; struct ioat_test *test; TAILQ_ENTRY(test_transaction) entry; }; @@ -312,6 +313,28 @@ ioat_test_submit_1_tx(struct ioat_test *test, bus_dmae desc = ioat_copy_8k_aligned(dma, dest, dst2, src, src2, cb, tx, flags); + } else if (test->testkind == IOAT_TEST_DMA_8K_PB) { + bus_addr_t src2, dst2; + + src2 = vtophys((vm_offset_t)tx->buf[2*i+1] + PAGE_SIZE); + dst2 = vtophys((vm_offset_t)tx->buf[2*i] + PAGE_SIZE); + + desc = ioat_copy_8k_aligned(dma, dest, dst2, src, src2, + cb, tx, flags); + } else if (test->testkind == IOAT_TEST_DMA_CRC) { + bus_addr_t crc; + + tx->crc[i] = 0; + crc = vtophys((vm_offset_t)&tx->crc[i]); + desc = ioat_crc(dma, src, tx->length, + NULL, crc, cb, tx, flags | DMA_CRC_STORE); + } else if (test->testkind == IOAT_TEST_DMA_CRC_COPY) { + bus_addr_t crc; + + tx->crc[i] = 0; + crc = vtophys((vm_offset_t)&tx->crc[i]); + desc = ioat_copy_crc(dma, dest, src, tx->length, + NULL, crc, cb, tx, flags | DMA_CRC_STORE); } if (desc == NULL) break; @@ -346,7 +369,8 @@ ioat_dma_test(void *arg) test = arg; memset(__DEVOLATILE(void *, test->status), 0, sizeof(test->status)); - if (test->testkind == IOAT_TEST_DMA_8K && + if ((test->testkind == IOAT_TEST_DMA_8K || + test->testkind == IOAT_TEST_DMA_8K_PB) && test->buffer_size != 2 * PAGE_SIZE) { ioat_test_log(0, "Asked for 8k test and buffer size isn't 8k\n"); test->status[IOAT_TEST_INVALID_INPUT]++; Modified: stable/12/sys/dev/ioat/ioat_test.h ============================================================================== --- stable/12/sys/dev/ioat/ioat_test.h Fri Nov 29 00:26:05 2019 (r355196) +++ stable/12/sys/dev/ioat/ioat_test.h Fri Nov 29 00:38:16 2019 (r355197) @@ -44,6 +44,9 @@ enum ioat_test_kind { IOAT_TEST_RAW_DMA, IOAT_TEST_DMA_8K, IOAT_TEST_MEMCPY, + IOAT_TEST_DMA_8K_PB, + IOAT_TEST_DMA_CRC, + IOAT_TEST_DMA_CRC_COPY, IOAT_NUM_TESTKINDS }; Modified: stable/12/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- stable/12/tools/tools/ioat/ioatcontrol.8 Fri Nov 29 00:26:05 2019 (r355196) +++ stable/12/tools/tools/ioat/ioatcontrol.8 Fri Nov 29 00:38:16 2019 (r355197) @@ -35,9 +35,12 @@ .Nm .Op Fl c Ar period .Op Fl E +.Op Fl e .Op Fl f .Op Fl m .Op Fl V +.Op Fl x +.Op Fl X .Op Fl z .Ar channel_number .Ar num_txns @@ -65,6 +68,8 @@ The arguments are as follows: Configure the channel's interrupt coalescing period, in microseconds (defaults to 0). .It Fl E +Test contiguous 8k copy. +.It Fl e Test non-contiguous 8k copy. .It Fl f Test block fill (by default, @@ -74,6 +79,10 @@ tests copy) Test memcpy instead of DMA. .It Fl V Verify copies/fills for accuracy +.It Fl x +Test DMA CRC. +.It Fl X +Test DMA copy with CRC. .It Fl z Zero device statistics before running test. .El Modified: stable/12/tools/tools/ioat/ioatcontrol.c ============================================================================== --- stable/12/tools/tools/ioat/ioatcontrol.c Fri Nov 29 00:26:05 2019 (r355196) +++ stable/12/tools/tools/ioat/ioatcontrol.c Fri Nov 29 00:38:16 2019 (r355197) @@ -54,13 +54,16 @@ usage(void) printf(" %s -r [-c period] [-vVwz] channel-number address []\n\n", getprogname()); printf(" -c period - Enable interrupt coalescing (us) (default: 0)\n"); - printf(" -E - Test non-contiguous 8k copy.\n"); - printf(" -f - Test block fill (default: DMA copy).\n"); + printf(" -E - Test contiguous 8k copy.\n"); + printf(" -e - Test non-contiguous 8k copy.\n"); + printf(" -f - Test block fill.\n"); printf(" -m - Test memcpy instead of DMA.\n"); printf(" -r - Issue DMA to or from a specific address.\n"); printf(" -V - Enable verification\n"); printf(" -v -
is a kernel virtual address\n"); printf(" -w - Write to the specified address\n"); + printf(" -x - Test DMA CRC.\n"); + printf(" -X - Test DMA CRC copy.\n"); printf(" -z - Zero device stats before test\n"); exit(EX_USAGE); } @@ -107,15 +110,15 @@ main(int argc, char **argv) { struct ioat_test t; int fd, ch; - bool fflag, rflag, Eflag, mflag; + bool fflag, rflag, Eflag, eflag, mflag, xflag, Xflag; unsigned modeflags; memset(&t, 0, sizeof(t)); - fflag = rflag = Eflag = mflag = false; + fflag = rflag = Eflag = eflag = mflag = xflag = Xflag = false; modeflags = 0; - while ((ch = getopt(argc, argv, "c:EfmrvVwz")) != -1) { + while ((ch = getopt(argc, argv, "c:EefmrvVwxXz")) != -1) { switch (ch) { case 'c': t.coalesce_period = atoi(optarg); @@ -124,6 +127,10 @@ main(int argc, char **argv) Eflag = true; modeflags++; break; + case 'e': + eflag = true; + modeflags++; + break; case 'f': fflag = true; modeflags++; @@ -145,6 +152,12 @@ main(int argc, char **argv) case 'w': t.raw_write = true; break; + case 'x': + xflag = true; + break; + case 'X': + Xflag = true; + break; case 'z': t.zero_stats = true; break; @@ -171,11 +184,15 @@ main(int argc, char **argv) if (fflag) t.testkind = IOAT_TEST_FILL; - else if (Eflag) { + else if (Eflag || eflag) { t.testkind = IOAT_TEST_DMA_8K; t.buffer_size = 8 * 1024; } else if (mflag) t.testkind = IOAT_TEST_MEMCPY; + else if (xflag) + t.testkind = IOAT_TEST_DMA_CRC; + else if (xflag) + t.testkind = IOAT_TEST_DMA_CRC_COPY; t.channel_index = atoi(argv[0]); if (t.channel_index > 8) {