Date: Tue, 8 Jan 2019 09:40:09 +0000 (UTC) From: Vincenzo Maffione <vmaffione@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: r342858 - in stable/12: etc/mtree tests/sys tests/sys/netmap Message-ID: <201901080940.x089e9TU057486@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vmaffione Date: Tue Jan 8 09:40:09 2019 New Revision: 342858 URL: https://svnweb.freebsd.org/changeset/base/342858 Log: MFC r342649, r342650 netmap: add suite of unit tests Import the unit tests from upstream (https://github.com/luigirizzo/netmap ba02539859d46d33), and make them ready for use with Kyua. There are currently 38 regression tests, which test the kernel control ABI exposed by netmap to userspace applications: 1: test for port info get 2-5: tests for basic port registration 6-9: tests for VALE 10-11: tests for getting netmap allocator info 12-15: tests for netmap pipes 16: test on polling mode 17-18: tests on options 19-27: tests for sync-kloop subsystem 28-39: tests for null ports 31-38: tests for the legacy NIOCREGIF registers Reviewed by: ngie Sponsored by: Sunny Valley Networks Differential Revision: https://reviews.freebsd.org/D18490 Added: stable/12/tests/sys/netmap/ - copied from r342649, head/tests/sys/netmap/ Modified: stable/12/etc/mtree/BSD.tests.dist stable/12/tests/sys/Makefile stable/12/tests/sys/netmap/ctrl-api-test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/etc/mtree/BSD.tests.dist ============================================================================== --- stable/12/etc/mtree/BSD.tests.dist Tue Jan 8 09:04:27 2019 (r342857) +++ stable/12/etc/mtree/BSD.tests.dist Tue Jan 8 09:40:09 2019 (r342858) @@ -752,6 +752,8 @@ tunnel .. .. + netmap + .. netpfil pf ioctl Modified: stable/12/tests/sys/Makefile ============================================================================== --- stable/12/tests/sys/Makefile Tue Jan 8 09:04:27 2019 (r342857) +++ stable/12/tests/sys/Makefile Tue Jan 8 09:40:09 2019 (r342858) @@ -20,6 +20,7 @@ TESTS_SUBDIRS+= mac TESTS_SUBDIRS+= mqueue TESTS_SUBDIRS+= netinet TESTS_SUBDIRS+= netipsec +TESTS_SUBDIRS+= netmap TESTS_SUBDIRS+= netpfil TESTS_SUBDIRS+= opencrypto TESTS_SUBDIRS+= posixshm Modified: stable/12/tests/sys/netmap/ctrl-api-test.c ============================================================================== --- head/tests/sys/netmap/ctrl-api-test.c Mon Dec 31 11:17:58 2018 (r342649) +++ stable/12/tests/sys/netmap/ctrl-api-test.c Tue Jan 8 09:40:09 2019 (r342858) @@ -183,7 +183,7 @@ port_info_get(struct TestContext *ctx) perror("ioctl(/dev/netmap, NIOCCTRL, PORT_INFO_GET)"); return ret; } - printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize); printf("nr_tx_slots %u\n", req.nr_tx_slots); printf("nr_rx_slots %u\n", req.nr_rx_slots); printf("nr_tx_rings %u\n", req.nr_tx_rings); @@ -216,8 +216,9 @@ port_register(struct TestContext *ctx) int ret; printf("Testing NETMAP_REQ_REGISTER(mode=%d,ringid=%d," - "flags=0x%lx) on '%s'\n", - ctx->nr_mode, ctx->nr_ringid, ctx->nr_flags, ctx->ifname); + "flags=0x%llx) on '%s'\n", + ctx->nr_mode, ctx->nr_ringid, (unsigned long long)ctx->nr_flags, + ctx->ifname); nmreq_hdr_init(&hdr, ctx->ifname); hdr.nr_reqtype = NETMAP_REQ_REGISTER; @@ -238,8 +239,8 @@ port_register(struct TestContext *ctx) perror("ioctl(/dev/netmap, NIOCCTRL, REGISTER)"); return ret; } - printf("nr_offset 0x%lx\n", req.nr_offset); - printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_offset 0x%llx\n", (unsigned long long)req.nr_offset); + printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize); printf("nr_tx_slots %u\n", req.nr_tx_slots); printf("nr_rx_slots %u\n", req.nr_rx_slots); printf("nr_tx_rings %u\n", req.nr_tx_rings); @@ -687,15 +688,18 @@ pools_info_get(struct TestContext *ctx) perror("ioctl(/dev/netmap, NIOCCTRL, POOLS_INFO_GET)"); return ret; } - printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize); printf("nr_mem_id %u\n", req.nr_mem_id); - printf("nr_if_pool_offset 0x%lx\n", req.nr_if_pool_offset); + printf("nr_if_pool_offset 0x%llx\n", + (unsigned long long)req.nr_if_pool_offset); printf("nr_if_pool_objtotal %u\n", req.nr_if_pool_objtotal); printf("nr_if_pool_objsize %u\n", req.nr_if_pool_objsize); - printf("nr_ring_pool_offset 0x%lx\n", req.nr_if_pool_offset); + printf("nr_ring_pool_offset 0x%llx\n", + (unsigned long long)req.nr_if_pool_offset); printf("nr_ring_pool_objtotal %u\n", req.nr_ring_pool_objtotal); printf("nr_ring_pool_objsize %u\n", req.nr_ring_pool_objsize); - printf("nr_buf_pool_offset 0x%lx\n", req.nr_buf_pool_offset); + printf("nr_buf_pool_offset 0x%llx\n", + (unsigned long long)req.nr_buf_pool_offset); printf("nr_buf_pool_objtotal %u\n", req.nr_buf_pool_objtotal); printf("nr_buf_pool_objsize %u\n", req.nr_buf_pool_objsize);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901080940.x089e9TU057486>