| 820 | } |
| 821 | |
| 822 | static int |
| 823 | test_memzone_bounded(void) |
| 824 | { |
| 825 | const struct rte_memzone *memzone_err; |
| 826 | int rc; |
| 827 | |
| 828 | /* should fail as boundary is not power of two */ |
| 829 | memzone_err = rte_memzone_reserve_bounded( |
| 830 | TEST_MEMZONE_NAME("bounded_error_31"), 100, |
| 831 | SOCKET_ID_ANY, 0, 32, UINT32_MAX); |
| 832 | if (memzone_err != NULL) { |
| 833 | printf("%s(%s)created a memzone with invalid boundary " |
| 834 | "conditions\n", __func__, memzone_err->name); |
| 835 | return -1; |
| 836 | } |
| 837 | |
| 838 | /* should fail as len is greater then boundary */ |
| 839 | memzone_err = rte_memzone_reserve_bounded( |
| 840 | TEST_MEMZONE_NAME("bounded_error_32"), 100, |
| 841 | SOCKET_ID_ANY, 0, 32, 32); |
| 842 | if (memzone_err != NULL) { |
| 843 | printf("%s(%s)created a memzone with invalid boundary " |
| 844 | "conditions\n", __func__, memzone_err->name); |
| 845 | return -1; |
| 846 | } |
| 847 | |
| 848 | rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_128"), 100, 128, |
| 849 | 128); |
| 850 | if (rc != 0) |
| 851 | return rc; |
| 852 | |
| 853 | rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_256"), 100, 256, |
| 854 | 128); |
| 855 | if (rc != 0) |
| 856 | return rc; |
| 857 | |
| 858 | rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_1K"), 100, 64, |
| 859 | 1024); |
| 860 | if (rc != 0) |
| 861 | return rc; |
| 862 | |
| 863 | rc = check_memzone_bounded(TEST_MEMZONE_NAME("bounded_1K_MAX"), 0, 64, |
| 864 | 1024); |
| 865 | if (rc != 0) |
| 866 | return rc; |
| 867 | |
| 868 | return 0; |
| 869 | } |
| 870 | |
| 871 | static int |
| 872 | test_memzone_free(void) |
no test coverage detected