| /spdk/test/unit/lib/util/crc32c.c/ |
| H A D | crc32c_ut.c | 17 char buf[1024], buf1[1024]; in test_crc32c() local 21 snprintf(buf, sizeof(buf), "%s", "Hello world!"); in test_crc32c() 23 crc = spdk_crc32c_update(buf, strlen(buf), crc); in test_crc32c() 28 iov[0].iov_base = buf; in test_crc32c() 29 iov[0].iov_len = strlen(buf); in test_crc32c() 35 snprintf(buf, sizeof(buf), "%s", "Hello"); in test_crc32c() 36 iov[0].iov_base = buf; in test_crc32c() 37 iov[0].iov_len = strlen(buf); in test_crc32c() 54 snprintf(buf, sizeof(buf), "%s", ""); in test_crc32c() 56 crc = spdk_crc32c_update(buf, strlen(buf), crc); in test_crc32c() [all …]
|
| /spdk/test/unit/lib/thread/iobuf.c/ |
| H A D | iobuf_ut.c | 18 void *buf; member 31 ut_iobuf_get_buf_cb(struct spdk_iobuf_entry *entry, void *buf) in ut_iobuf_get_buf_cb() 35 ut_entry->buf = buf; in ut_iobuf_get_buf_cb() 43 ut_entry->buf = cb_arg; in ut_iobuf_foreach_cb() 123 entry->buf = spdk_iobuf_get(entry->ioch, LARGE_BUFSIZE, &entry->iobuf, ut_iobuf_get_buf_cb); in iobuf() 124 CU_ASSERT_PTR_NOT_NULL(entry->buf); in iobuf() 126 entry->buf = spdk_iobuf_get(entry->ioch, LARGE_BUFSIZE, &entry->iobuf, ut_iobuf_get_buf_cb); in iobuf() 127 CU_ASSERT_PTR_NOT_NULL(entry->buf); in iobuf() 128 /* The next two should be put onto the large buf wai in iobuf() 30 ut_iobuf_get_buf_cb(struct spdk_iobuf_entry * entry,void * buf) ut_iobuf_get_buf_cb() argument [all...] |
| /spdk/lib/util/ |
| H A D | crc32c.c | 13 spdk_crc32c_update(const void *buf, size_t len, uint32_t crc) in spdk_crc32c_update() argument 15 return crc32_iscsi((unsigned char *)buf, len, crc); in spdk_crc32c_update() 21 spdk_crc32c_update(const void *buf, size_t len, uint32_t crc) in spdk_crc32c_update() argument 27 /* process the head and tail bytes separately to make the buf address in spdk_crc32c_update() 30 count_pre = ((uint64_t)buf & 7) == 0 ? 0 : 8 - ((uint64_t)buf & 7); in spdk_crc32c_update() 31 count_post = (uint64_t)((uintptr_t)buf + len) & 7; in spdk_crc32c_update() 35 crc = _mm_crc32_u8(crc, *(const uint8_t *)buf); in spdk_crc32c_update() 36 buf = (uint8_t *)buf in spdk_crc32c_update() 61 spdk_crc32c_update(const void * buf,size_t len,uint32_t crc) spdk_crc32c_update() argument 104 spdk_crc32c_update(const void * buf,size_t len,uint32_t crc) spdk_crc32c_update() argument 130 spdk_crc32c_nvme(const void * buf,size_t len,uint32_t crc) spdk_crc32c_nvme() argument [all...] |
| H A D | pipe.c | 21 uint8_t *buf; member 32 spdk_pipe_create(void *buf, uint32_t sz) in spdk_pipe_create() argument 41 pipe->buf = buf; in spdk_pipe_create() 50 void *buf; in spdk_pipe_destroy() local 60 buf = pipe->buf; in spdk_pipe_destroy() 62 return buf; in spdk_pipe_destroy() 68 struct spdk_pipe_buf *buf; in pipe_alloc_buf_from_group() local 76 buf = SLIST_FIRST(&group->bufs); in pipe_alloc_buf_from_group() 77 while (buf != NULL) { in pipe_alloc_buf_from_group() 78 if (buf->sz == pipe->sz) { in pipe_alloc_buf_from_group() [all …]
|
| H A D | crc32.c | 32 crc32_update(const struct spdk_crc32_table *table, const void *buf, size_t len, uint32_t crc) in crc32_update() argument 37 /* process the head and tail bytes separately to make the buf address in crc32_update() 40 count_pre = ((uint64_t)buf & 7) == 0 ? 0 : 8 - ((uint64_t)buf & 7); in crc32_update() 41 count_post = (uint64_t)(buf + len) & 7; in crc32_update() 45 crc = __crc32b(crc, *(const uint8_t *)buf); in crc32_update() 46 buf++; in crc32_update() 49 dword_buf = (const uint64_t *)buf; in crc32_update() 55 buf = dword_buf; in crc32_update() 57 crc = __crc32b(crc, *(const uint8_t *)buf); in crc32_update() 67 crc32_update(const struct spdk_crc32_table * table,const void * buf,size_t len,uint32_t crc) crc32_update() argument [all...] |
| H A D | file.c | 12 uint8_t *newbuf, *buf = NULL; in spdk_posix_file_load() 19 newbuf = realloc(buf, buf_size); in spdk_posix_file_load() 21 free(buf); in spdk_posix_file_load() 24 buf = newbuf; in spdk_posix_file_load() 26 rc = fread(buf + cur_size, 1, buf_size - cur_size, file); in spdk_posix_file_load() 31 return buf; in spdk_posix_file_load() 35 free(buf); in spdk_posix_file_load() 42 free(buf); in spdk_posix_file_load() 11 uint8_t *newbuf, *buf = NULL; spdk_posix_file_load() local
|
| H A D | crc64.c | 13 spdk_crc64_nvme(const void *buf, size_t len, uint64_t crc) in spdk_crc64_nvme() argument 15 return crc64_rocksoft_refl(crc, (const uint8_t *)buf, len); in spdk_crc64_nvme() 152 crc64_rocksoft_refl_base(uint64_t seed, const uint8_t *buf, uint64_t len) in crc64_rocksoft_refl_base() argument 157 uint8_t byte = buf[i]; in crc64_rocksoft_refl_base() 165 spdk_crc64_nvme(const void *buf, size_t len, uint64_t crc) in spdk_crc64_nvme() argument 167 return crc64_rocksoft_refl_base(crc, (const uint8_t *)buf, len); in spdk_crc64_nvme()
|
| H A D | iov.c | 177 iov_xfer(struct spdk_iov_xfer *ix, const void *buf, size_t buf_len, bool to_buf) in iov_xfer() argument 198 memcpy((char *)buf + copied_len, in iov_xfer() 202 (const char *)buf + copied_len, len); in iov_xfer() 216 spdk_iov_xfer_from_buf(struct spdk_iov_xfer *ix, const void *buf, size_t buf_len) in spdk_iov_xfer_from_buf() argument 218 return iov_xfer(ix, buf, buf_len, false); in spdk_iov_xfer_from_buf() 222 spdk_iov_xfer_to_buf(struct spdk_iov_xfer *ix, const void *buf, size_t buf_len) in spdk_iov_xfer_to_buf() argument 224 return iov_xfer(ix, buf, buf_len, true); in spdk_iov_xfer_to_buf() 228 spdk_copy_iovs_to_buf(void *buf, size_t buf_len, struct iovec *iovs, int iovcnt) in spdk_copy_iovs_to_buf() argument 233 spdk_iov_xfer_to_buf(&ix, buf, buf_len); in spdk_copy_iovs_to_buf() 237 spdk_copy_buf_to_iovs(struct iovec *iovs, int iovcnt, void *buf, size_t buf_len) in spdk_copy_buf_to_iovs() argument [all …]
|
| H A D | crc16.c | 17 spdk_crc16_t10dif(uint16_t init_crc, const void *buf, size_t len) in spdk_crc16_t10dif() argument 19 return (crc16_t10dif(init_crc, buf, len)); in spdk_crc16_t10dif() 617 crc16_table_t10dif(uint16_t init_crc, const void *buf, size_t len) in crc16_table_t10dif() argument 620 const uint8_t *data = (const uint8_t *)buf; in crc16_table_t10dif() 628 spdk_crc16_t10dif(uint16_t init_crc, const void *buf, size_t len) in spdk_crc16_t10dif() argument 630 return (crc16_table_t10dif(init_crc, buf, len)); in spdk_crc16_t10dif()
|
| /spdk/lib/env_dpdk/ |
| H A D | pci_event.c | 98 parse_subsystem_event(const char *buf, struct spdk_pci_event *event) in parse_subsystem_event() argument 114 while (*buf) { in parse_subsystem_event() 115 if (!strncmp(buf, "SUBSYSTEM=", 10)) { in parse_subsystem_event() 116 buf += 10; in parse_subsystem_event() 117 snprintf(subsystem, sizeof(subsystem), "%s", buf); in parse_subsystem_event() 118 } else if (!strncmp(buf, "ACTION=", 7)) { in parse_subsystem_event() 119 buf += 7; in parse_subsystem_event() 120 snprintf(action, sizeof(action), "%s", buf); in parse_subsystem_event() 121 } else if (!strncmp(buf, "DEVPATH=", 8)) { in parse_subsystem_event() 122 buf += 8; in parse_subsystem_event() [all …]
|
| /spdk/test/unit/lib/json/json_write.c/ |
| H A D | json_write_ut.c | 345 test_generate_string_uint128(char *buf, int buf_size, uint64_t low, uint64_t high) in test_generate_string_uint128() argument 352 memset(buf, 0, buf_size); in test_generate_string_uint128() 359 snprintf(tmp_buf, buf_size, "%015" PRIu64 "%s", seg, buf); in test_generate_string_uint128() 361 snprintf(tmp_buf, buf_size, "%" PRIu64 "%s", seg, buf); in test_generate_string_uint128() 364 count = snprintf(buf, buf_size, "%s", tmp_buf); in test_generate_string_uint128() 371 test_generate_string_name_uint128(char *name, char *buf, int buf_size, uint64_t low, uint64_t high) in test_generate_string_name_uint128() argument 374 int count = test_generate_string_uint128(buf, buf_size, low, high); in test_generate_string_name_uint128() 376 memcpy(tmp_buf, buf, buf_size); in test_generate_string_name_uint128() 377 count = snprintf(buf, 256, "\"%s\":%s", name, tmp_buf); in test_generate_string_name_uint128() 386 char buf[256] = {0}; in test_write_number_uint128() local [all …]
|
| /spdk/test/unit/lib/util/crc64.c/ |
| H A D | crc64_ut.c | 15 char buf[buf_size]; in test_crc64_nvme() local 23 memset(buf, 0, buf_size); in test_crc64_nvme() 24 crc = spdk_crc64_nvme(buf, buf_size, 0); in test_crc64_nvme() 28 memset(buf, 0xFF, buf_size); in test_crc64_nvme() 29 crc = spdk_crc64_nvme(buf, buf_size, 0); in test_crc64_nvme() 33 memset(buf, 0, buf_size); in test_crc64_nvme() 36 buf[i] = (char)j; in test_crc64_nvme() 43 crc = spdk_crc64_nvme(buf, buf_size, 0); in test_crc64_nvme() 47 memset(buf, 0, buf_size); in test_crc64_nvme() 50 buf[i] = (char)j; in test_crc64_nvme() [all …]
|
| /spdk/test/env/vtophys/ |
| H A D | vtophys.c | 49 void *buf = NULL, *p = NULL; in vtophys_spdk_malloc_test() local 57 buf = spdk_zmalloc(size, buf_align, NULL, SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA); in vtophys_spdk_malloc_test() 58 if (buf == NULL) { in vtophys_spdk_malloc_test() 63 paddr = spdk_vtophys(buf, NULL); in vtophys_spdk_malloc_test() 67 p = buf; in vtophys_spdk_malloc_test() 69 while (p < buf + size) { in vtophys_spdk_malloc_test() 74 tmpsize = buf + size - p; in vtophys_spdk_malloc_test() 79 p = buf; in vtophys_spdk_malloc_test() 86 p = buf; in vtophys_spdk_malloc_test() 88 while (p < buf in vtophys_spdk_malloc_test() [all...] |
| /spdk/lib/log/ |
| H A D | log.c | 118 get_timestamp_prefix(char *buf, int buf_size) in spdk_log_to_syslog_level() 126 buf[0] = '\0'; in spdk_log_to_syslog_level() 134 snprintf(buf, buf_size, "[%s.%06ld] ", "unknown date", usec); 139 snprintf(buf, buf_size, "[%s.%06ld] ", date, usec); in spdk_vlog() local 180 char *buf, _buf[MAX_TMPBUF], *ext_buf = NULL; in spdk_vlog() 199 buf = _buf; in spdk_vflog() 211 buf = ext_buf; 219 fprintf(stderr, "%s%s:%4d:%s: *%s*: %s", timestamp, file, line, func, spdk_level_names[level], buf); in spdk_flog() 221 fprintf(stderr, "%s%s", timestamp, buf); in spdk_flog() 227 syslog(severity, "%s:%4d:%s: *%s*: %s", file, line, func, spdk_level_names[level], buf); in fdump() 77 get_timestamp_prefix(char * buf,int buf_size) get_timestamp_prefix() argument 196 char buf[MAX_TMPBUF]; spdk_vflog() local 224 fdump(FILE * fp,const char * label,const uint8_t * buf,size_t len) fdump() argument 269 spdk_log_dump(FILE * fp,const char * label,const void * buf,size_t len) spdk_log_dump() argument [all...] |
| /spdk/test/unit/lib/accel/accel.c/ |
| H A D | accel_ut.c | 694 char buf[4096], tmp[2][4096], expected[4096]; in test_sequence_fill_copy() 702 memset(buf, 0, sizeof(buf)); in test_sequence_fill_copy() 705 rc = spdk_accel_append_fill(&seq, ioch, buf, sizeof(buf), NULL, NULL, 0xa5, in test_sequence_fill_copy() 717 CU_ASSERT_EQUAL(memcmp(buf, expected, sizeof(buf)), 0); in test_sequence_fill_copy() 720 memset(buf, 0, sizeof(buf)); in test_sequence_fill_copy() 726 dst_iovs[0].iov_base = buf; in test_sequence_fill_copy() 677 char buf[4096], tmp[2][4096], expected[4096]; test_sequence_fill_copy() local 869 char buf[4096], tmp[2][4096], expected[4096]; test_sequence_abort() local 941 char buf[4096]; test_sequence_append_error() local 1078 char buf[4096], tmp[4096]; test_sequence_completion_error() local 1229 char buf[4096], tmp[2][4096], expected[4096]; test_sequence_decompress() local 1355 char buf[4096], tmp[2][4096], expected[4096]; test_sequence_reverse() local 1535 char buf[4096], tmp[4][4096]; test_sequence_copy_elision() local 2012 void *buf[2], *domain_ctx[2], *iobuf_buf; test_sequence_accel_buffers() local 2869 void *buf, *accel_domain_ctx; test_sequence_module_memory_domain() local 3026 unsigned char buf[4096], encrypted[4096] = {}, data[4096], tmp[3][4096]; test_sequence_crypto() local 3294 char buf[4096], tmp[3][4096], expected[4096]; test_sequence_driver() local 3740 char buf[4096], tmp[4096], expected[4096]; test_sequence_same_iovs() local 3878 char buf[4096], tmp[3][4096]; test_sequence_crc32() local [all...] |
| /spdk/test/unit/lib/nvmf/vfio_user.c/ |
| H A D | vfio_user_ut.c | 58 void *buf, *prps; in test_nvme_cmd_map_prps() 62 buf = spdk_zmalloc(132 * 1024, 4096, &phy_addr, 0, 0); in test_nvme_cmd_map_prps() 63 CU_ASSERT(buf != NULL); in test_nvme_cmd_map_prps() 68 cmd.dptr.prp.prp1 = (uint64_t)(uintptr_t)buf; in test_nvme_cmd_map_prps() 76 cmd.dptr.prp.prp1 = (uint64_t)(uintptr_t)buf + 1024 * 3; in test_nvme_cmd_map_prps() 77 cmd.dptr.prp.prp2 = (uint64_t)(uintptr_t)buf + 4096; in test_nvme_cmd_map_prps() 89 cmd.dptr.prp.prp1 = (uint64_t)(uintptr_t)buf + 1024 * 3; in test_nvme_cmd_map_prps() 94 *prp = (uint64_t)(uintptr_t)buf + i * 4096; in test_nvme_cmd_map_prps() 102 CU_ASSERT(iovs[i].iov_base == (void *)((uintptr_t)buf + i * 4096)); in test_nvme_cmd_map_prps() 105 CU_ASSERT(iovs[32].iov_base == (void *)((uintptr_t)buf in test_nvme_cmd_map_prps() 57 void *buf, *prps; test_nvme_cmd_map_prps() local 125 void *buf, *sgls; test_nvme_cmd_map_sgls() local [all...] |
| /spdk/lib/json/ |
| H A D | json_write.c | 19 uint8_t buf[4096]; member 36 rc = w->write_cb(w->cb_ctx, w->buf, w->buf_filled); in flush_buf() 93 size_t buf_remain = sizeof(w->buf) - w->buf_filled; in emit() 101 memcpy(w->buf + w->buf_filled, data, size); in emit() 109 size_t buf_remain = sizeof(w->buf) - w->buf_filled; in emit_buf_full() 115 memcpy(w->buf + w->buf_filled, data, buf_remain); in emit_buf_full() 195 char buf[32]; in spdk_json_write_uint8() local 199 count = snprintf(buf, sizeof(buf), "%" PRIu8, val); in spdk_json_write_uint8() 200 if (count <= 0 || (size_t)count >= sizeof(buf)) { return fail(w); } in spdk_json_write_uint8() 201 return emit(w, buf, count); in spdk_json_write_uint8() [all …]
|
| /spdk/test/app/jsoncat/ |
| H A D | jsoncat.c | 55 void *buf, *end; in process_file() local 61 buf = spdk_posix_file_load(f, &size); in process_file() 62 if (buf == NULL) { in process_file() 67 rc = spdk_json_parse(buf, size, NULL, 0, NULL, parse_flags); in process_file() 70 free(buf); in process_file() 78 free(buf); in process_file() 82 rc = spdk_json_parse(buf, size, values, num_values, &end, in process_file() 87 free(buf); in process_file() 95 free(buf); in process_file() 103 if (end != buf + size) { in process_file() [all …]
|
| /spdk/test/unit/lib/blobfs/blobfs_sync_ut/ |
| H A D | blobfs_sync_ut.c | 204 char *buf; in file_length() local 223 buf = calloc(1, buf_length); in file_length() 224 spdk_file_write(g_file, channel, buf, 0, buf_length); in file_length() 225 free(buf); in file_length() 286 char *buf, append_buf[64]; in append_write_to_extend_blob() local 302 buf = calloc(1, buf_length); in append_write_to_extend_blob() 303 rc = spdk_file_write(g_file, channel, buf, 0, buf_length); in append_write_to_extend_blob() 305 free(buf); in append_write_to_extend_blob() 340 char *buf; in partial_buffer() local 359 buf = calloc(1, buf_length); in partial_buffer() [all …]
|
| /spdk/include/spdk_internal/ |
| H A D | utf.h | 167 utf8_encode_unsafe(uint8_t *buf, uint32_t c) in utf8_encode_unsafe() argument 170 buf[0] = c; in utf8_encode_unsafe() 173 buf[0] = 0xC0 | (c >> 6); in utf8_encode_unsafe() 174 buf[1] = 0x80 | (c & 0x3F); in utf8_encode_unsafe() 180 buf[0] = 0xE0 | (c >> 12); in utf8_encode_unsafe() 181 buf[1] = 0x80 | ((c >> 6) & 0x3F); in utf8_encode_unsafe() 182 buf[2] = 0x80 | (c & 0x3F); in utf8_encode_unsafe() 185 buf[0] = 0xF0 | (c >> 18); in utf8_encode_unsafe() 186 buf[1] = 0x80 | ((c >> 12) & 0x3F); in utf8_encode_unsafe() 187 buf[2] = 0x80 | ((c >> 6) & 0x3F); in utf8_encode_unsafe() [all …]
|
| /spdk/test/common/lib/ |
| H A D | test_iobuf.c | 77 void *buf; in spdk_iobuf_get() 92 buf = calloc(1, len); in spdk_iobuf_get() 93 CU_ASSERT(buf != NULL); in spdk_iobuf_get() 95 return buf; in spdk_iobuf_get() 107 buf = calloc(1, len); in spdk_iobuf_put() argument 108 CU_ASSERT(buf != NULL); in spdk_iobuf_put() 110 return buf; in spdk_iobuf_put() 114 spdk_iobuf_put(struct spdk_iobuf_channel *ch, void *buf, uint64_t len) in spdk_iobuf_put() 134 entry->cb_fn(entry, buf); in spdk_iobuf_put() 144 free(buf); 72 void *buf; spdk_iobuf_get() local [all...] |
| H A D | test_env.c | 160 void *buf = NULL; in spdk_malloc() 173 if (posix_memalign(&buf, align, size)) { in spdk_malloc() 177 *phys_addr = (uint64_t)buf; in spdk_malloc() 180 return buf; 189 void *buf = spdk_malloc(size, align, phys_addr, -1, 1); in spdk_zmalloc() 191 if (buf != NULL) { in spdk_zmalloc() 192 memset(buf, 0, size); in spdk_zmalloc() 194 return buf; 208 spdk_realloc(void *buf, size_t size, size_t align) in spdk_realloc() 212 return realloc(buf, siz 157 void *buf = NULL; spdk_malloc() local 186 void *buf = spdk_malloc(size, align, phys_addr, -1, 1); spdk_zmalloc() local 205 spdk_realloc(void * buf,size_t size,size_t align) spdk_realloc() argument 241 spdk_dma_realloc(void * buf,size_t size,size_t align,uint64_t * phys_addr) spdk_dma_realloc() argument 249 spdk_free(void * buf) spdk_free() argument 257 spdk_dma_free(void * buf) spdk_dma_free() argument 265 spdk_vtophys(const void * buf,uint64_t * size) spdk_vtophys() argument 327 void *buf; spdk_mempool_get() local [all...] |
| /spdk/test/unit/lib/keyring/keyring.c/ |
| H A D | keyring_ut.c | 14 char buf[UT_KEY_SIZE]; member 19 char *buf; member 38 memcpy(utkey->buf, opts->buf, opts->len); in ut_keyring_add_key() 51 memset(utkey->buf, 0, utkey->len); in ut_keyring_remove_key() 56 ut_keyring_get_key(struct spdk_key *key, void *buf, int len) in ut_keyring_get_key() argument 60 memcpy(buf, utkey->buf, utkey->len); in ut_keyring_get_key() 87 struct ut_key_opts uopts = { .buf = keybuf, .len = UT_KEY_SIZE }; in test_keyring_add_remove() 187 struct ut_key_opts uopts = { .buf in test_keyring_get_put() [all...] |
| /spdk/lib/ftl/utils/ |
| H A D | ftl_bitmap.c | 43 bitmap_word *buf; member 47 struct ftl_bitmap *ftl_bitmap_create(void *buf, size_t size) in ftl_bitmap_create() argument 51 if ((uintptr_t)buf % ftl_bitmap_buffer_alignment) { in ftl_bitmap_create() 68 bitmap->buf = buf; in ftl_bitmap_create() 89 *word_out = &bitmap->buf[word_idx]; in locate_bit() 139 word = (bitmap->buf[i] ^ skip) & (~0UL << (start_bit & FTL_BITMAP_WORD_MASK)); in ftl_bitmap_find_first() 146 word = bitmap->buf[i] ^ skip; in ftl_bitmap_find_first() 178 bitmap_word *word = bitmap->buf; in ftl_bitmap_count_set()
|
| /spdk/module/bdev/raid/ |
| H A D | bdev_raid_sb.c | 30 void *buf; member 138 struct raid_bdev_superblock *sb = ctx->buf; in raid_bdev_parse_superblock() 190 spdk_dma_free(ctx->buf); in raid_bdev_read_sb_ctx_free() 200 struct raid_bdev_superblock *sb = ctx->buf; in raid_bdev_read_sb_remainder() 203 void *buf; in raid_bdev_read_sb_remainder() local 209 buf = spdk_dma_realloc(ctx->buf, ctx->buf_size, spdk_bdev_get_buf_align(bdev), NULL); in raid_bdev_read_sb_remainder() 210 if (buf == NULL) { in raid_bdev_read_sb_remainder() 214 ctx->buf = buf; in raid_bdev_read_sb_remainder() 216 rc = spdk_bdev_read(ctx->desc, ctx->ch, ctx->buf + buf_size_prev, buf_size_prev, in raid_bdev_read_sb_remainder() 240 memmove(ctx->buf + (i * data_block_size), in raid_bdev_read_sb_cb() [all …]
|