/*-
* 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
* * 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
#include <inttypes.h>
#include <sys/queue.h>
-#include <cmdline_parse.h>
-
#include <rte_random.h>
#include <rte_cycles.h>
#include <rte_memory.h>
/* 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
* 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);
}
}
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;
}
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;
}
" 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;
}
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);
"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,
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");