X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_memzone.c;h=42c7601fb93820e5bb0f8ba6179270d4cd1581d4;hb=3031749c2df04a63cdcef186dcce3781e61436e8;hp=cebe375d17746fc768412152a99a83a33fc57d9e;hpb=013615a784c18582d32e2a702049783c68801f6c;p=dpdk.git diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c index cebe375d17..42c7601fb9 100644 --- a/app/test/test_memzone.c +++ b/app/test/test_memzone.c @@ -1,13 +1,13 @@ /*- * BSD LICENSE - * + * * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright @@ -17,7 +17,7 @@ * * Neither the name of Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR @@ -36,8 +36,6 @@ #include #include -#include - #include #include #include @@ -296,9 +294,9 @@ test_memzone_reserve_max(void) /* check if the memzone is in our memseg and subtract length */ if ((config->mem_config->memzone[memzone_idx].addr >= - ms[memseg_idx].addr) && - (config->mem_config->memzone[memzone_idx].addr < - (RTE_PTR_ADD(ms[memseg_idx].addr, ms[memseg_idx].len)))) { + ms[memseg_idx].addr) && + (config->mem_config->memzone[memzone_idx].addr < + (RTE_PTR_ADD(ms[memseg_idx].addr, ms[memseg_idx].len)))) { /* since the zones can now be aligned and occasionally skip * some space, we should calculate the length based on * reported length and start addresses difference. Addresses @@ -306,11 +304,11 @@ test_memzone_reserve_max(void) * them being in the right order. */ len -= RTE_PTR_DIFF( - config->mem_config->memzone[memzone_idx].addr, - last_addr); + config->mem_config->memzone[memzone_idx].addr, + last_addr); len -= config->mem_config->memzone[memzone_idx].len; last_addr = RTE_PTR_ADD(config->mem_config->memzone[memzone_idx].addr, - (size_t) config->mem_config->memzone[memzone_idx].len); + (size_t) config->mem_config->memzone[memzone_idx].len); } } @@ -328,17 +326,17 @@ test_memzone_reserve_max(void) mz = rte_memzone_reserve("max_zone", 0, SOCKET_ID_ANY, 0); if (mz == NULL){ printf("Failed to reserve a big chunk of memory\n"); - rte_dump_physmem_layout(); - rte_memzone_dump(); + rte_dump_physmem_layout(stdout); + rte_memzone_dump(stdout); return -1; } if (mz->len != maxlen) { printf("Memzone reserve with 0 size did not return bigest block\n"); printf("Expected size = %zu, actual size = %zu\n", - maxlen, mz->len); - rte_dump_physmem_layout(); - rte_memzone_dump(); + maxlen, mz->len); + rte_dump_physmem_layout(stdout); + rte_memzone_dump(stdout); return -1; } @@ -424,8 +422,8 @@ test_memzone_reserve_max_aligned(void) SOCKET_ID_ANY, 0, align); if (mz == NULL){ printf("Failed to reserve a big chunk of memory\n"); - rte_dump_physmem_layout(); - rte_memzone_dump(); + rte_dump_physmem_layout(stdout); + rte_memzone_dump(stdout); return -1; } @@ -434,8 +432,8 @@ test_memzone_reserve_max_aligned(void) " bigest block\n", align); printf("Expected size = %zu, actual size = %zu\n", maxlen, mz->len); - rte_dump_physmem_layout(); - rte_memzone_dump(); + rte_dump_physmem_layout(stdout); + rte_memzone_dump(stdout); return -1; } @@ -571,7 +569,7 @@ check_memzone_bounded(const char *name, uint32_t len, uint32_t align, bmask = ~((phys_addr_t)bound - 1); - if ((mz = rte_memzone_reserve_bounded(name, len, SOCKET_ID_ANY, 0, + if ((mz = rte_memzone_reserve_bounded(name, len, SOCKET_ID_ANY, 0, align, bound)) == NULL) { printf("%s(%s): memzone creation failed\n", __func__, name); @@ -622,7 +620,7 @@ test_memzone_bounded(void) "conditions\n", __func__, memzone_err->name); return (-1); } - + /* should fail as len is greater then boundary */ name = "bounded_error_32"; if ((memzone_err = rte_memzone_reserve_bounded(name, @@ -949,7 +947,7 @@ test_memzone(void) if (memzone1 == NULL || memzone2 == NULL || memzone4 == NULL) return -1; - rte_memzone_dump(); + rte_memzone_dump(stdout); /* check cache-line alignments */ printf("check alignments and lengths\n");