for (i = 0; i < app.n_ports; i++) {
char name[32];
- rte_snprintf(name, sizeof(name), "app_ring_rx_%u", i);
+ snprintf(name, sizeof(name), "app_ring_rx_%u", i);
app.rings_rx[i] = rte_ring_create(
name,
for (i = 0; i < app.n_ports; i++) {
char name[32];
- rte_snprintf(name, sizeof(name), "app_ring_tx_%u", i);
+ snprintf(name, sizeof(name), "app_ring_tx_%u", i);
app.rings_tx[i] = rte_ring_create(
name,
if(size >= sizeof(s))
return -1;
- rte_snprintf(s, sizeof(s), "%.*s", size, p);
+ snprintf(s, sizeof(s), "%.*s", size, p);
if (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') != _NUM_FLD)
return -1;
for (i = 0; i < _NUM_FLD; i++) {
cmdline_parse_token_string_t *token_struct;
modes = list_pkt_forwarding_modes();
- rte_snprintf(help, sizeof help, "set fwd %s - "
+ snprintf(help, sizeof help, "set fwd %s - "
"set packet forwarding mode", modes);
cmd_set_fwd_mode.help_str = help;
char mz_name[RTE_MEMZONE_NAMESIZE];
const struct rte_memzone *mz;
- rte_snprintf(mz_name, sizeof(mz_name), "%s_%s_%d_%d",
+ snprintf(mz_name, sizeof(mz_name), "%s_%s_%d_%d",
ports[port_id].dev_info.driver_name, ring_name, port_id, q_id);
mz = rte_memzone_lookup(mz_name);
if (mz == NULL)
if(size >= sizeof(s))
return -1;
- rte_snprintf(s, sizeof(s), "%.*s", size, p);
+ snprintf(s, sizeof(s), "%.*s", size, p);
if (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') != _NUM_FLD)
return -1;
for (i = 0; i < _NUM_FLD; i++){
if(size >= sizeof(s))
return -1;
- rte_snprintf(s, sizeof(s), "%.*s", size, p);
+ snprintf(s, sizeof(s), "%.*s", size, p);
if (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') != _NUM_FLD)
return -1;
for (i = 0; i < _NUM_FLD; i++) {
if(size >= sizeof(s))
return -1;
- rte_snprintf(s, sizeof(s), "%.*s", size, p);
+ snprintf(s, sizeof(s), "%.*s", size, p);
if (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') != _NUM_FLD)
return -1;
for (i = 0; i < _NUM_FLD; i++) {
static inline void
mbuf_poolname_build(unsigned int sock_id, char* mp_name, int name_size)
{
- rte_snprintf(mp_name, name_size, "mbuf_pool_socket_%u", sock_id);
+ snprintf(mp_name, name_size, "mbuf_pool_socket_%u", sock_id);
}
static inline struct rte_mempool *
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+# Allow use of deprecated rte_snprintf in test_string_fns.c
+ifeq ($(CC), icc)
+CFLAGS_test_string_fns.o += -Wd1478
+else
+CFLAGS_test_string_fns.o += -Wno-deprecated-declarations
+endif
+
# Disable warnings of deprecated-declarations in test_kni.c
ifeq ($(CC), icc)
CFLAGS_test_kni.o += -wd1478
/* close all open file descriptors, check /proc/self/fd to only
* call close on open fds. Exclude fds 0, 1 and 2*/
for (fd = getdtablesize(); fd > 2; fd-- ) {
- rte_snprintf(path, sizeof(path), "/proc/" exe "/fd/%d", fd);
+ snprintf(path, sizeof(path), "/proc/" exe "/fd/%d", fd);
if (access(path, F_OK) == 0)
close(fd);
}
memset(tmp, 0, sizeof(tmp));
memset(tmp2, 0, sizeof(tmp));
- rte_snprintf(tmp2, sizeof(tmp2), "%s", CIRBUF_STR_HEAD);
+ snprintf(tmp2, sizeof(tmp2), "%s", CIRBUF_STR_HEAD);
/*
* initialize circular buffer
/* try null result */
/* copy string to buffer */
- rte_snprintf(buf, sizeof(buf), "%s",
+ snprintf(buf, sizeof(buf), "%s",
ether_addr_valid_strs[0].str);
ret = cmdline_parse_etheraddr(NULL, buf, NULL);
char buf[CMDLINE_TEST_BUFSIZE];
cmdline_ipaddr_t result;
- rte_snprintf(buf, sizeof(buf), "1.2.3.4");
+ snprintf(buf, sizeof(buf), "1.2.3.4");
token.ipaddr_data.flags = CMDLINE_IPADDR_V4;
/* null token */
token.num_data.type = UINT32;
/* copy string to buffer */
- rte_snprintf(buf, sizeof(buf), "%s",
+ snprintf(buf, sizeof(buf), "%s",
num_valid_positive_strs[0].str);
/* try all null */
memset(&token, 0, sizeof(token));
- rte_snprintf(buf, sizeof(buf), "buffer");
+ snprintf(buf, sizeof(buf), "buffer");
/* test null token */
if (cmdline_get_help_string(
return 0;
if (strncmp(tokens[2], "hugetlbfs", sizeof("hugetlbfs")) == 0) {
- rte_snprintf(dst, dst_len, "%s", tokens[1]);
+ snprintf(dst, dst_len, "%s", tokens[1]);
return 1;
}
return 0;
int fd, lck_result, result = 0;
- const int prefix_len = rte_snprintf(hugefile_prefix,
+ const int prefix_len = snprintf(hugefile_prefix,
sizeof(hugefile_prefix), "%smap_", prefix);
if (prefix_len <= 0 || prefix_len >= (int)sizeof(hugefile_prefix)
|| prefix_len >= (int)sizeof(dirent->d_name)) {
{
char file_path[PATH_MAX] = {0};
- rte_snprintf(file_path, sizeof(file_path),
+ snprintf(file_path, sizeof(file_path),
"%s/%s", hugedir, dirent->d_name);
/* remove file */
char buf[PATH_MAX] = {0};
/* get file for config (fd is always 3) */
- rte_snprintf(path, sizeof(path), "/proc/self/fd/%d", 3);
+ snprintf(path, sizeof(path), "/proc/self/fd/%d", 3);
/* return NULL on error */
if (readlink(path, buf, sizeof(buf)) == -1)
return NULL;
/* get the basename */
- rte_snprintf(buf, sizeof(buf), "%s", basename(buf));
+ snprintf(buf, sizeof(buf), "%s", basename(buf));
/* copy string all the way from second char up to start of _config */
- rte_snprintf(prefix, size, "%.*s",
+ snprintf(prefix, size, "%.*s",
(int)(strnlen(buf, sizeof(buf)) - sizeof("_config")),
&buf[1]);
printf("Error - unable to get current prefix!\n");
return -1;
}
- rte_snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+ snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
#endif
const char *wlinval[][11] = {
printf("Error - unable to get current prefix!\n");
return -1;
}
- rte_snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+ snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
#endif
const char *blinval[][9] = {
printf("Error - unable to get current prefix!\n");
return -1;
}
- rte_snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+ snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
#endif
const char *rinval[][9] = {
printf("Error - unable to get current prefix!\n");
return -1;
}
- rte_snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+ snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
#endif
/* -c flag but no coremask value */
printf("Error - unable to get current prefix!\n");
return -1;
}
- rte_snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+ snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
#endif
/* -n flag but no value */
printf("Error - unable to get current prefix!\n");
return -1;
}
- rte_snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+ snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
/* With --no-hpet */
const char *argv1[] = {prgname, prefix, mp_flag, no_hpet, "-c", "1", "-n", "2"};
printf("Error - unable to get current prefix!\n");
return -1;
}
- rte_snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+ snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
/* check that some general flags don't prevent things from working.
* All cases, apart from the first, app should run.
printf("Error - unable to get current prefix!\n");
return -1;
}
- rte_snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+ snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
/*
* get first valid hugepage path
printf("Error - unable to get current prefix!\n");
return -1;
}
- rte_snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+ snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
#endif
#ifdef RTE_LIBRTE_XEN_DOM0
mem_size = "30";
return -1;
}
- rte_snprintf(invalid_socket_mem, sizeof(invalid_socket_mem), "--socket-mem=");
+ snprintf(invalid_socket_mem, sizeof(invalid_socket_mem), "--socket-mem=");
/* add one extra socket */
for (i = 0; i < num_sockets + 1; i++) {
- rte_snprintf(buf, sizeof(buf), "%s2", invalid_socket_mem);
- rte_snprintf(invalid_socket_mem, sizeof(invalid_socket_mem), "%s", buf);
+ snprintf(buf, sizeof(buf), "%s2", invalid_socket_mem);
+ snprintf(invalid_socket_mem, sizeof(invalid_socket_mem), "%s", buf);
if (num_sockets + 1 - i > 1) {
- rte_snprintf(buf, sizeof(buf), "%s,", invalid_socket_mem);
- rte_snprintf(invalid_socket_mem, sizeof(invalid_socket_mem), "%s", buf);
+ snprintf(buf, sizeof(buf), "%s,", invalid_socket_mem);
+ snprintf(invalid_socket_mem, sizeof(invalid_socket_mem), "%s", buf);
}
}
/* construct a valid socket mask with 2 megs on each existing socket */
char valid_socket_mem[SOCKET_MEM_STRLEN];
- rte_snprintf(valid_socket_mem, sizeof(valid_socket_mem), "--socket-mem=");
+ snprintf(valid_socket_mem, sizeof(valid_socket_mem), "--socket-mem=");
/* add one extra socket */
for (i = 0; i < num_sockets; i++) {
- rte_snprintf(buf, sizeof(buf), "%s2", valid_socket_mem);
- rte_snprintf(valid_socket_mem, sizeof(valid_socket_mem), "%s", buf);
+ snprintf(buf, sizeof(buf), "%s2", valid_socket_mem);
+ snprintf(valid_socket_mem, sizeof(valid_socket_mem), "%s", buf);
if (num_sockets - i > 1) {
- rte_snprintf(buf, sizeof(buf), "%s,", valid_socket_mem);
- rte_snprintf(valid_socket_mem, sizeof(valid_socket_mem), "%s", buf);
+ snprintf(buf, sizeof(buf), "%s,", valid_socket_mem);
+ snprintf(valid_socket_mem, sizeof(valid_socket_mem), "%s", buf);
}
}
perror("mkstemp() failure");
goto error;
}
- rte_snprintf(proc_path, sizeof(proc_path), "/proc/self/fd/%d", tmp_file_handle);
+ snprintf(proc_path, sizeof(proc_path), "/proc/self/fd/%d", tmp_file_handle);
if (readlink(proc_path, filename, sizeof(filename)) < 0) {
perror("readlink() failure");
goto error;
/* generate appropriate error string for unknown error number
* and then check that this is what we got back. If not, we have
* a duplicate error number that conflicts with errno.h */
- rte_snprintf(expected_libc_retval, sizeof(expected_libc_retval),
+ snprintf(expected_libc_retval, sizeof(expected_libc_retval),
unknown_code_result, rte_errs[i]);
if ((strcmp(expected_libc_retval, libc_retval) != 0) &&
(strcmp("", libc_retval) != 0)){
/* ensure that beyond RTE_MAX_ERRNO, we always get an unknown code */
rte_retval = rte_strerror(RTE_MAX_ERRNO + 1);
libc_retval = strerror(RTE_MAX_ERRNO + 1);
- rte_snprintf(expected_libc_retval, sizeof(expected_libc_retval),
+ snprintf(expected_libc_retval, sizeof(expected_libc_retval),
unknown_code_result, RTE_MAX_ERRNO + 1);
printf("rte_strerror: '%s', strerror: '%s'\n",
rte_retval, libc_retval);
/* create/lookup new ring several times */
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(ring_name, sizeof(ring_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(ring_name, sizeof(ring_name), "fr_test_%d_%d", lcore_self, i);
rp = rte_ring_create(ring_name, 4096, SOCKET_ID_ANY, 0);
if (NULL == rp)
return -1;
/* verify all ring created sucessful */
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(ring_name, sizeof(ring_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(ring_name, sizeof(ring_name), "fr_test_%d_%d", lcore_self, i);
if (rte_ring_lookup(ring_name) == NULL)
return -1;
}
/* create/lookup new ring several times */
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(mempool_name, sizeof(mempool_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(mempool_name, sizeof(mempool_name), "fr_test_%d_%d", lcore_self, i);
mp = rte_mempool_create(mempool_name, MEMPOOL_SIZE,
MEMPOOL_ELT_SIZE, 0, 0,
NULL, NULL,
/* verify all ring created sucessful */
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(mempool_name, sizeof(mempool_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(mempool_name, sizeof(mempool_name), "fr_test_%d_%d", lcore_self, i);
if (rte_mempool_lookup(mempool_name) == NULL)
return -1;
}
int i;
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_id, i);
+ snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_id, i);
if ((handle = rte_hash_find_existing(hash_name)) != NULL)
rte_hash_free(handle);
/* create mutiple times simultaneously */
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_self, i);
hash_params.name = hash_name;
handle = rte_hash_create(&hash_params);
/* verify free correct */
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(hash_name, sizeof(hash_name), "fr_test_%d_%d", lcore_self, i);
if (NULL != rte_hash_find_existing(hash_name))
return -1;
int i;
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_id, i);
+ snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_id, i);
if ((handle = rte_fbk_hash_find_existing(fbk_name)) != NULL)
rte_fbk_hash_free(handle);
/* create mutiple fbk tables simultaneously */
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_self, i);
fbk_params.name = fbk_name;
handle = rte_fbk_hash_create(&fbk_params);
/* verify free correct */
for (i = 0; i < MAX_ITER_TIMES; i++) {
- rte_snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(fbk_name, sizeof(fbk_name), "fr_test_%d_%d", lcore_self, i);
if (NULL != rte_fbk_hash_find_existing(fbk_name))
return -1;
int i;
for (i = 0; i < MAX_LPM_ITER_TIMES; i++) {
- rte_snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_id, i);
+ snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_id, i);
if ((lpm = rte_lpm_find_existing(lpm_name)) != NULL)
rte_lpm_free(lpm);
/* create mutiple fbk tables simultaneously */
for (i = 0; i < MAX_LPM_ITER_TIMES; i++) {
- rte_snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_self, i);
lpm = rte_lpm_create(lpm_name, SOCKET_ID_ANY, 4, RTE_LPM_HEAP);
if (NULL == lpm)
return -1;
/* verify free correct */
for (i = 0; i < MAX_LPM_ITER_TIMES; i++) {
- rte_snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_self, i);
+ snprintf(lpm_name, sizeof(lpm_name), "fr_test_%d_%d", lcore_self, i);
if (NULL != rte_lpm_find_existing(lpm_name))
return -1;
}
char name[RTE_HASH_NAMESIZE];
char hashname[RTE_HASH_NAMESIZE];
- rte_snprintf(name, 32, "test%u", calledCount++);
+ snprintf(name, 32, "test%u", calledCount++);
hash_params.name = name;
handle = rte_hash_create(&hash_params);
default: return -1;
}
- rte_snprintf(hashname, RTE_HASH_NAMESIZE, "%s", get_hash_name(params->hash_func));
+ snprintf(hashname, RTE_HASH_NAMESIZE, "%s", get_hash_name(params->hash_func));
printf("%-12s, %-15s, %-16u, %-7u, %-18u, %-8u, %-19.2f, %.2f\n",
hashname,
char buf[PATH_MAX] = {0};
/* get file for config (fd is always 3) */
- rte_snprintf(path, sizeof(path), "/proc/self/fd/%d", 3);
+ snprintf(path, sizeof(path), "/proc/self/fd/%d", 3);
/* return NULL on error */
if (readlink(path, buf, sizeof(buf)) == -1)
return NULL;
/* get the basename */
- rte_snprintf(buf, sizeof(buf), "%s", basename(buf));
+ snprintf(buf, sizeof(buf), "%s", basename(buf));
/* copy string all the way from second char up to start of _config */
- rte_snprintf(prefix, size, "%.*s",
+ snprintf(prefix, size, "%.*s",
(int)(strnlen(buf, sizeof(buf)) - sizeof("_config")),
&buf[1]);
char pathname[PATH_MAX];
struct rte_ivshmem_metadata *metadata;
- rte_snprintf(pathname, sizeof(pathname),
+ snprintf(pathname, sizeof(pathname),
"/var/run/.dpdk_ivshmem_metadata_%s", name);
fd = open(pathname, O_RDWR, 0660);
"Failed to create metadata");
for (i = 0; i < RTE_LIBRTE_IVSHMEM_MAX_ENTRIES; i++) {
- rte_snprintf(name, sizeof(name), "mz_%i", i);
+ snprintf(name, sizeof(name), "mz_%i", i);
mz = rte_memzone_reserve(name, CACHE_LINE_SIZE, SOCKET_ID_ANY, 0);
ASSERT(mz != NULL, "Failed to reserve memzone");
struct rte_ivshmem_metadata *metadata;
for (i = 0; i < RTE_LIBRTE_IVSHMEM_MAX_METADATA_FILES / 2; i++) {
- rte_snprintf(name, sizeof(name), "test_%d", i);
+ snprintf(name, sizeof(name), "test_%d", i);
rte_ivshmem_metadata_create(name);
metadata = mmap_metadata(name);
char name[IVSHMEM_NAME_LEN];
for (i = 0; i < RTE_LIBRTE_IVSHMEM_MAX_METADATA_FILES; i++) {
- rte_snprintf(name, sizeof(name), "test_%d", i);
+ snprintf(name, sizeof(name), "test_%d", i);
ASSERT(rte_ivshmem_metadata_create(name) == 0,
"Create config file failed");
}
get_current_prefix(tmp, sizeof(tmp));
- rte_snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+ snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
const char *argv[] = { prgname, "-c", "1", "-n", "3",
"--proc-type=secondary", prefix };
rte_eth_dev_info_get(port_id, &info);
conf.addr = info.pci_dev->addr;
conf.id = info.pci_dev->id;
- rte_snprintf(conf.name, sizeof(conf.name), TEST_KNI_PORT);
+ snprintf(conf.name, sizeof(conf.name), TEST_KNI_PORT);
/* core id 1 configured for kernel thread */
conf.core_id = 1;
/* test of getting KNI device with an invalid string name */
memset(&conf, 0, sizeof(conf));
- rte_snprintf(conf.name, sizeof(conf.name), "testing");
+ snprintf(conf.name, sizeof(conf.name), "testing");
kni = rte_kni_get(conf.name);
if (kni) {
ret = -1;
printf("NULL pointer returned from rte_zmalloc\n");
return -1;
}
- rte_snprintf(ptr1, size1, "%s" ,hello_str);
+ snprintf(ptr1, size1, "%s" ,hello_str);
char *ptr2 = rte_realloc(ptr1, size2, CACHE_LINE_SIZE);
if (!ptr2){
rte_free(ptr1);
char buf[PATH_MAX] = {0};
/* get file for config (fd is always 3) */
- rte_snprintf(path, sizeof(path), "/proc/self/fd/%d", 3);
+ snprintf(path, sizeof(path), "/proc/self/fd/%d", 3);
/* return NULL on error */
if (readlink(path, buf, sizeof(buf)) == -1)
return NULL;
/* get the basename */
- rte_snprintf(buf, sizeof(buf), "%s", basename(buf));
+ snprintf(buf, sizeof(buf), "%s", basename(buf));
/* copy string all the way from second char up to start of _config */
- rte_snprintf(prefix, size, "%.*s",
+ snprintf(prefix, size, "%.*s",
(int)(strnlen(buf, sizeof(buf)) - sizeof("_config")),
&buf[1]);
get_current_prefix(tmp, sizeof(tmp));
- rte_snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
+ snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
/* good case, using secondary */
const char *argv1[] = {
"--file-prefix=ERROR"
};
- rte_snprintf(coremask, sizeof(coremask), "%x", \
+ snprintf(coremask, sizeof(coremask), "%x", \
(1 << rte_get_master_lcore()));
ret |= launch_proc(argv1);
uint32_t cur_freq;
int ret = -1;
- if (rte_snprintf(fullpath, sizeof(fullpath),
+ if (snprintf(fullpath, sizeof(fullpath),
TEST_POWER_SYSFILE_CUR_FREQ, lcore_id) < 0) {
return 0;
}
for (i = 0; i < N_PORTS; i++) {
char name[32];
- rte_snprintf(name, sizeof(name), "app_ring_rx_%u", i);
+ snprintf(name, sizeof(name), "app_ring_rx_%u", i);
rings_rx[i] = rte_ring_lookup(name);
if (rings_rx[i] == NULL) {
rings_rx[i] = rte_ring_create(
for (i = 0; i < N_PORTS; i++) {
char name[32];
- rte_snprintf(name, sizeof(name), "app_ring_tx_%u", i);
+ snprintf(name, sizeof(name), "app_ring_tx_%u", i);
rings_tx[i] = rte_ring_lookup(name);
if (rings_tx[i] == NULL) {
rings_tx[i] = rte_ring_create(
acl_params.n_rules = 1 << 5;
acl_params.n_rule_fields = DIM(ipv4_defs);
- rte_snprintf(acl_name, sizeof(acl_name), "ACL%d", i);
+ snprintf(acl_name, sizeof(acl_name), "ACL%d", i);
acl_params.name = acl_name;
memcpy(acl_params.field_format, ipv4_defs, sizeof(ipv4_defs));
parser = parse_cb_ipv4_rule;
for (n = 1; n <= 5; n++) {
- rte_snprintf(line, sizeof(line), "%s", lines[n-1]);
+ snprintf(line, sizeof(line), "%s", lines[n-1]);
printf("PARSING [%s]\n", line);
ret = parser(line, &rule_params);
/* delete a few rules */
for (n = 2; n <= 3; n++) {
- rte_snprintf(line, sizeof(line), "%s", lines[n-1]);
+ snprintf(line, sizeof(line), "%s", lines[n-1]);
printf("PARSING [%s]\n", line);
ret = parser(line, &rule_params);
/* Try to add duplicates */
for (n = 1; n <= 5; n++) {
- rte_snprintf(line, sizeof(line), "%s", lines[n-1]);
+ snprintf(line, sizeof(line), "%s", lines[n-1]);
printf("PARSING [%s]\n", line);
ret = parser(line, &rule_params);
char ip_str[INET6_ADDRSTRLEN];
if (res->obj->ip.family == AF_INET)
- rte_snprintf(ip_str, sizeof(ip_str), NIPQUAD_FMT,
+ snprintf(ip_str, sizeof(ip_str), NIPQUAD_FMT,
NIPQUAD(res->obj->ip.addr.ipv4));
else
- rte_snprintf(ip_str, sizeof(ip_str), NIP6_FMT,
+ snprintf(ip_str, sizeof(ip_str), NIP6_FMT,
NIP6(res->obj->ip.addr.ipv6));
if (strcmp(res->action, "del") == 0) {
cmdline_printf(cl, "mem error\n");
return;
}
- rte_snprintf(o->name, sizeof(o->name), "%s", res->name);
+ snprintf(o->name, sizeof(o->name), "%s", res->name);
o->ip = res->ip;
SLIST_INSERT_HEAD(&global_obj_list, o, next);
if (o->ip.family == AF_INET)
- rte_snprintf(ip_str, sizeof(ip_str), NIPQUAD_FMT,
+ snprintf(ip_str, sizeof(ip_str), NIPQUAD_FMT,
NIPQUAD(o->ip.addr.ipv4));
else
- rte_snprintf(ip_str, sizeof(ip_str), NIP6_FMT,
+ snprintf(ip_str, sizeof(ip_str), NIP6_FMT,
NIP6(o->ip.addr.ipv6));
cmdline_printf(cl, "Object %s added, ip=%s\n",
return -1;
if (dstbuf)
- rte_snprintf(dstbuf, size, "%s", o->name);
+ snprintf(dstbuf, size, "%s", o->name);
return 0;
}
int get_help_obj_list(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
char *dstbuf, unsigned int size)
{
- rte_snprintf(dstbuf, size, "Obj-List");
+ snprintf(dstbuf, size, "Obj-List");
return 0;
}
qaCoreConf[lcore_id].numResponseAttempts = 0;
/* Initialise and reserve lcore memzone for virt2phys translation */
- rte_snprintf(memzone_name,
+ snprintf(memzone_name,
RTE_MEMZONE_NAMESIZE,
"lcore_%u",
lcore_id);
if(size >= sizeof(s))
return -1;
- rte_snprintf(s, sizeof(s), "%.*s", size, p);
+ snprintf(s, sizeof(s), "%.*s", size, p);
if (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') != _NUM_FLD)
return -1;
for (i = 0; i < _NUM_FLD; i++) {
return -1;
}
if (pktmbuf_pool[socketid] == NULL) {
- rte_snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
+ snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
rte_mempool_create(s, NB_MBUF, MBUF_SIZE, 32,
sizeof(struct rte_pktmbuf_pool_private),
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
if (name && *name)
- rte_snprintf(ifr.ifr_name, IFNAMSIZ, "%s", name);
+ snprintf(ifr.ifr_name, IFNAMSIZ, "%s", name);
ret = ioctl(fd, TUNSETIFF, (void *) &ifr);
if (ret < 0) {
}
if (name)
- rte_snprintf(name, IFNAMSIZ, "%s", ifr.ifr_name);
+ snprintf(name, IFNAMSIZ, "%s", ifr.ifr_name);
return fd;
}
if ((1ULL << lcore_id) & input_cores_mask) {
/* Create new tap interface */
- rte_snprintf(tap_name, IFNAMSIZ, "tap_dpdk_%.2u", lcore_id);
+ snprintf(tap_name, IFNAMSIZ, "tap_dpdk_%.2u", lcore_id);
tap_fd = tap_create(tap_name);
if (tap_fd < 0)
FATAL_ERROR("Could not create tap interface \"%s\" (%d)",
}
else if ((1ULL << lcore_id) & output_cores_mask) {
/* Create new tap interface */
- rte_snprintf(tap_name, IFNAMSIZ, "tap_dpdk_%.2u", lcore_id);
+ snprintf(tap_name, IFNAMSIZ, "tap_dpdk_%.2u", lcore_id);
tap_fd = tap_create(tap_name);
if (tap_fd < 0)
FATAL_ERROR("Could not create tap interface \"%s\" (%d)",
if (socket_direct_pool[socket] == NULL) {
RTE_LOG(INFO, IP_FRAG, "Creating direct mempool on socket %i\n",
socket);
- rte_snprintf(buf, sizeof(buf), "pool_direct_%i", socket);
+ snprintf(buf, sizeof(buf), "pool_direct_%i", socket);
mp = rte_mempool_create(buf, NB_MBUF,
MBUF_SIZE, 32,
if (socket_indirect_pool[socket] == NULL) {
RTE_LOG(INFO, IP_FRAG, "Creating indirect mempool on socket %i\n",
socket);
- rte_snprintf(buf, sizeof(buf), "pool_indirect_%i", socket);
+ snprintf(buf, sizeof(buf), "pool_indirect_%i", socket);
mp = rte_mempool_create(buf, NB_MBUF,
sizeof(struct rte_mbuf), 32,
if (socket_lpm[socket] == NULL) {
RTE_LOG(INFO, IP_FRAG, "Creating LPM table on socket %i\n", socket);
- rte_snprintf(buf, sizeof(buf), "IP_FRAG_LPM_%i", socket);
+ snprintf(buf, sizeof(buf), "IP_FRAG_LPM_%i", socket);
lpm = rte_lpm_create(buf, socket, LPM_MAX_RULES, 0);
if (lpm == NULL) {
if (socket_lpm6[socket] == NULL) {
RTE_LOG(INFO, IP_FRAG, "Creating LPM6 table on socket %i\n", socket);
- rte_snprintf(buf, sizeof(buf), "IP_FRAG_LPM_%i", socket);
+ snprintf(buf, sizeof(buf), "IP_FRAG_LPM_%i", socket);
lpm6 = rte_lpm6_create("IP_FRAG_LPM6", socket, &lpm6_config);
if (lpm6 == NULL) {
uint32_t j;
/* [core X] */
- rte_snprintf(section_name, sizeof(section_name), "core %u", i);
+ snprintf(section_name, sizeof(section_name), "core %u", i);
if (!rte_cfgfile_has_section(file, section_name)) {
rte_panic("Config file parse error: core IDs are not "
"sequential (core %u missing)\n", i);
struct rte_ring *ring;
char name[32];
- rte_snprintf(name, sizeof(name), "app_ring_%u", i);
+ snprintf(name, sizeof(name), "app_ring_%u", i);
ring = rte_ring_create(
name,
nb_mbuf = RTE_MAX(nb_mbuf, (uint32_t)NB_MBUF);
- rte_snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue);
+ snprintf(buf, sizeof(buf), "mbuf_pool_%u_%u", lcore, queue);
if ((rxq->pool = rte_mempool_create(buf, nb_mbuf, MBUF_SIZE, 0,
sizeof(struct rte_pktmbuf_pool_private),
if (socket_lpm[socket] == NULL) {
RTE_LOG(INFO, IP_RSMBL, "Creating LPM table on socket %i\n", socket);
- rte_snprintf(buf, sizeof(buf), "IP_RSMBL_LPM_%i", socket);
+ snprintf(buf, sizeof(buf), "IP_RSMBL_LPM_%i", socket);
lpm = rte_lpm_create(buf, socket, LPM_MAX_RULES, 0);
if (lpm == NULL) {
if (socket_lpm6[socket] == NULL) {
RTE_LOG(INFO, IP_RSMBL, "Creating LPM6 table on socket %i\n", socket);
- rte_snprintf(buf, sizeof(buf), "IP_RSMBL_LPM_%i", socket);
+ snprintf(buf, sizeof(buf), "IP_RSMBL_LPM_%i", socket);
lpm6 = rte_lpm6_create("IP_RSMBL_LPM6", socket, &lpm6_config);
if (lpm6 == NULL) {
printf("Invalid config parameters\n");
goto fail;
}
- rte_snprintf(s, sizeof(s), "%.*s", size, p);
+ snprintf(s, sizeof(s), "%.*s", size, p);
nb_token = rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',');
if (nb_token <= FLD_LCORE_TX) {
printf("Invalid config parameters\n");
/* Clear conf at first */
memset(&conf, 0, sizeof(conf));
if (params[port_id]->nb_lcore_k) {
- rte_snprintf(conf.name, RTE_KNI_NAMESIZE,
+ snprintf(conf.name, RTE_KNI_NAMESIZE,
"vEth%u_%u", port_id, i);
conf.core_id = params[port_id]->lcore_k[i];
conf.force_bind = 1;
} else
- rte_snprintf(conf.name, RTE_KNI_NAMESIZE,
+ snprintf(conf.name, RTE_KNI_NAMESIZE,
"vEth%u", port_id);
conf.group_id = (uint16_t)port_id;
conf.mbuf_size = MAX_PACKET_SZ;
FILE *file;
char path[PATH_MAX];
- rte_snprintf(path, sizeof(path), QEMU_CMD_FMT, config_name);
+ snprintf(path, sizeof(path), QEMU_CMD_FMT, config_name);
file = fopen(path, "w");
if (file == NULL) {
RTE_LOG(ERR, L2FWD_IVSHMEM, "Could not open '%s' \n", path);
for (portid = 0; portid < nb_ports_available; portid++) {
/* RX ring. SP/SC because it's only used by host and a single VM */
- rte_snprintf(name, sizeof(name), "%s%i", RX_RING_PREFIX, portid);
+ snprintf(name, sizeof(name), "%s%i", RX_RING_PREFIX, portid);
r = rte_ring_create(name, NB_MBUF,
SOCKET_ID_ANY, RING_F_SP_ENQ | RING_F_SC_DEQ);
if (r == NULL)
ctrl->vm_ports[portid].rx_ring = r;
/* TX ring. SP/SC because it's only used by host and a single VM */
- rte_snprintf(name, sizeof(name), "%s%i", TX_RING_PREFIX, portid);
+ snprintf(name, sizeof(name), "%s%i", TX_RING_PREFIX, portid);
r = rte_ring_create(name, NB_MBUF,
SOCKET_ID_ANY, RING_F_SP_ENQ | RING_F_SC_DEQ);
if (r == NULL)
int dim = ipv6 ? RTE_DIM(ipv6_defs) : RTE_DIM(ipv4_defs);
/* Create ACL contexts */
- rte_snprintf(name, sizeof(name), "%s%d",
+ snprintf(name, sizeof(name), "%s%d",
ipv6 ? L3FWD_ACL_IPV6_NAME : L3FWD_ACL_IPV4_NAME,
socketid);
if (size >= sizeof(s))
return -1;
- rte_snprintf(s, sizeof(s), "%.*s", size, p);
+ snprintf(s, sizeof(s), "%.*s", size, p);
if (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') !=
_NUM_FLD)
return -1;
socketid, lcore_id, NB_SOCKETS);
}
if (pktmbuf_pool[socketid] == NULL) {
- rte_snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
+ snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
rte_mempool_create(s, nb_mbuf, MBUF_SIZE,
MEMPOOL_CACHE_SIZE,
if(size >= sizeof(s))
return -1;
- rte_snprintf(s, sizeof(s), "%.*s", size, p);
+ snprintf(s, sizeof(s), "%.*s", size, p);
if (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') !=
_NUM_FLD)
return -1;
char s[64];
/* create ipv4 hash */
- rte_snprintf(s, sizeof(s), "ipv4_l3fwd_hash_%d", socketid);
+ snprintf(s, sizeof(s), "ipv4_l3fwd_hash_%d", socketid);
ipv4_l3fwd_hash_params.name = s;
ipv4_l3fwd_hash_params.socket_id = socketid;
ipv4_l3fwd_lookup_struct[socketid] =
"socket %d\n", socketid);
/* create ipv6 hash */
- rte_snprintf(s, sizeof(s), "ipv6_l3fwd_hash_%d", socketid);
+ snprintf(s, sizeof(s), "ipv6_l3fwd_hash_%d", socketid);
ipv6_l3fwd_hash_params.name = s;
ipv6_l3fwd_hash_params.socket_id = socketid;
ipv6_l3fwd_lookup_struct[socketid] =
char s[64];
/* create the LPM table */
- rte_snprintf(s, sizeof(s), "IPV4_L3FWD_LPM_%d", socketid);
+ snprintf(s, sizeof(s), "IPV4_L3FWD_LPM_%d", socketid);
ipv4_l3fwd_lookup_struct[socketid] = rte_lpm_create(s, socketid,
IPV4_L3FWD_LPM_MAX_RULES, 0);
if (ipv4_l3fwd_lookup_struct[socketid] == NULL)
lcore_id, NB_SOCKETS);
}
if (pktmbuf_pool[socketid] == NULL) {
- rte_snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
+ snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
rte_mempool_create(s, nb_mbuf,
MBUF_SIZE, MEMPOOL_CACHE_SIZE,
if(size >= sizeof(s))
return -1;
- rte_snprintf(s, sizeof(s), "%.*s", size, p);
+ snprintf(s, sizeof(s), "%.*s", size, p);
if (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') != _NUM_FLD)
return -1;
for (i = 0; i < _NUM_FLD; i++){
char s[64];
/* create hashes */
- rte_snprintf(s, sizeof(s), "l3fwd_hash_%d", socketid);
+ snprintf(s, sizeof(s), "l3fwd_hash_%d", socketid);
l3fwd_hash_params.name = s;
l3fwd_hash_params.socket_id = socketid;
l3fwd_lookup_struct[socketid] = rte_hash_create(&l3fwd_hash_params);
char s[64];
/* create the LPM table */
- rte_snprintf(s, sizeof(s), "L3FWD_LPM_%d", socketid);
+ snprintf(s, sizeof(s), "L3FWD_LPM_%d", socketid);
l3fwd_lookup_struct[socketid] = rte_lpm_create(s, socketid,
L3FWD_LPM_MAX_RULES, 0);
if (l3fwd_lookup_struct[socketid] == NULL)
socketid, lcore_id, NB_SOCKETS);
}
if (pktmbuf_pool[socketid] == NULL) {
- rte_snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
+ snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
rte_mempool_create(s, nb_mbuf, MBUF_SIZE,
MEMPOOL_CACHE_SIZE,
if(size >= sizeof(s))
return -1;
- rte_snprintf(s, sizeof(s), "%.*s", size, p);
+ snprintf(s, sizeof(s), "%.*s", size, p);
if (rte_strsplit(s, sizeof(s), str_fld, _NUM_FLD, ',') != _NUM_FLD)
return -1;
for (i = 0; i < _NUM_FLD; i++){
char s[64];
/* create ipv4 hash */
- rte_snprintf(s, sizeof(s), "ipv4_l3fwd_hash_%d", socketid);
+ snprintf(s, sizeof(s), "ipv4_l3fwd_hash_%d", socketid);
ipv4_l3fwd_hash_params.name = s;
ipv4_l3fwd_hash_params.socket_id = socketid;
ipv4_l3fwd_lookup_struct[socketid] = rte_hash_create(&ipv4_l3fwd_hash_params);
"socket %d\n", socketid);
/* create ipv6 hash */
- rte_snprintf(s, sizeof(s), "ipv6_l3fwd_hash_%d", socketid);
+ snprintf(s, sizeof(s), "ipv6_l3fwd_hash_%d", socketid);
ipv6_l3fwd_hash_params.name = s;
ipv6_l3fwd_hash_params.socket_id = socketid;
ipv6_l3fwd_lookup_struct[socketid] = rte_hash_create(&ipv6_l3fwd_hash_params);
char s[64];
/* create the LPM table */
- rte_snprintf(s, sizeof(s), "IPV4_L3FWD_LPM_%d", socketid);
+ snprintf(s, sizeof(s), "IPV4_L3FWD_LPM_%d", socketid);
ipv4_l3fwd_lookup_struct[socketid] = rte_lpm_create(s, socketid,
IPV4_L3FWD_LPM_MAX_RULES, 0);
if (ipv4_l3fwd_lookup_struct[socketid] == NULL)
}
/* create the LPM6 table */
- rte_snprintf(s, sizeof(s), "IPV6_L3FWD_LPM_%d", socketid);
+ snprintf(s, sizeof(s), "IPV6_L3FWD_LPM_%d", socketid);
config.max_rules = IPV6_L3FWD_LPM_MAX_RULES;
config.number_tbl8s = IPV6_L3FWD_LPM_NUMBER_TBL8S;
socketid, lcore_id, NB_SOCKETS);
}
if (pktmbuf_pool[socketid] == NULL) {
- rte_snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
+ snprintf(s, sizeof(s), "mbuf_pool_%d", socketid);
pktmbuf_pool[socketid] =
rte_mempool_create(s, nb_mbuf, MBUF_SIZE, MEMPOOL_CACHE_SIZE,
sizeof(struct rte_pktmbuf_pool_private),
int i, num_splits = 0;
/* copy s so we don't modify original string */
- rte_snprintf(str, sizeof(str), "%s", s);
+ snprintf(str, sizeof(str), "%s", s);
num_splits = rte_strsplit(str, sizeof(str), splits, num_vals, separator);
errno = 0;
continue;
}
- rte_snprintf(name, sizeof(name), "mbuf_pool_%u", socket);
+ snprintf(name, sizeof(name), "mbuf_pool_%u", socket);
printf("Creating the mbuf pool for socket %u ...\n", socket);
app.pools[socket] = rte_mempool_create(
name,
continue;
}
- rte_snprintf(name, sizeof(name), "lpm_table_%u", socket);
+ snprintf(name, sizeof(name), "lpm_table_%u", socket);
printf("Creating the LPM table for socket %u ...\n", socket);
app.lpm_tables[socket] = rte_lpm_create(
name,
lcore,
socket_io,
lcore_worker);
- rte_snprintf(name, sizeof(name), "app_ring_rx_s%u_io%u_w%u",
+ snprintf(name, sizeof(name), "app_ring_rx_s%u_io%u_w%u",
socket_io,
lcore,
lcore_worker);
printf("Creating ring to connect worker lcore %u with TX port %u (through I/O lcore %u) (socket %u) ...\n",
lcore, port, (unsigned)lcore_io, (unsigned)socket_io);
- rte_snprintf(name, sizeof(name), "app_ring_tx_s%u_w%u_p%u", socket_io, lcore, port);
+ snprintf(name, sizeof(name), "app_ring_tx_s%u_w%u_p%u", socket_io, lcore, port);
ring = rte_ring_create(
name,
app.ring_tx_size,
if (unlikely(addresses[port][0]=='\0')){
struct ether_addr mac;
rte_eth_macaddr_get(port, &mac);
- rte_snprintf(addresses[port], sizeof(addresses[port]),
+ snprintf(addresses[port], sizeof(addresses[port]),
"%02x:%02x:%02x:%02x:%02x:%02x\n",
mac.addr_bytes[0], mac.addr_bytes[1], mac.addr_bytes[2],
mac.addr_bytes[3], mac.addr_bytes[4], mac.addr_bytes[5]);
* by maximum 3 digits (plus an extra byte for safety) */
static char buffer[sizeof(MP_CLIENT_RXQ_NAME) + 2];
- rte_snprintf(buffer, sizeof(buffer) - 1, MP_CLIENT_RXQ_NAME, id);
+ snprintf(buffer, sizeof(buffer) - 1, MP_CLIENT_RXQ_NAME, id);
return buffer;
}
if (rte_mempool_get(message_pool, &msg) < 0)
rte_panic("Failed to get message buffer\n");
- rte_snprintf((char *)msg, string_size, "%s", res->message);
+ snprintf((char *)msg, string_size, "%s", res->message);
if (rte_ring_enqueue(send_ring, msg) < 0) {
printf("Failed to send message - message discarded\n");
rte_mempool_put(message_pool, msg);
/* build up message in msgbuf before printing to decrease likelihood
* of multi-core message interleaving.
*/
- msgbufpos += rte_snprintf(msgbuf, sizeof(msgbuf) - msgbufpos,
+ msgbufpos += snprintf(msgbuf, sizeof(msgbuf) - msgbufpos,
"Lcore %u using ports ", id);
for (p = start_port; p < end_port; p++){
- msgbufpos += rte_snprintf(msgbuf + msgbufpos, sizeof(msgbuf) - msgbufpos,
+ msgbufpos += snprintf(msgbuf + msgbufpos, sizeof(msgbuf) - msgbufpos,
"%u ", (unsigned)ports[p]);
}
printf("%s\n", msgbuf);
port->fd = rte_netmap_open("/dev/netmap", O_RDWR);
- rte_snprintf(req.nr_name, sizeof(req.nr_name), "%s", port->str);
+ snprintf(req.nr_name, sizeof(req.nr_name), "%s", port->str);
req.nr_version = NETMAP_API;
req.nr_ringid = 0;
return (err);
}
- rte_snprintf(req.nr_name, sizeof(req.nr_name), "%s", port->str);
+ snprintf(req.nr_name, sizeof(req.nr_name), "%s", port->str);
req.nr_version = NETMAP_API;
req.nr_ringid = 0;
if (req->nr_ringid != 0)
return (-EINVAL);
- rte_snprintf(nmif->ni_name, sizeof(nmif->ni_name), "%s", req->nr_name);
+ snprintf(nmif->ni_name, sizeof(nmif->ni_name), "%s", req->nr_name);
nmif->ni_version = req->nr_version;
/* Netmap uses ni_(r|t)x_rings + 1 */
uint32_t ncores = 0;
for(i = 0; i < RTE_MAX_LCORE; i++) {
- len = rte_snprintf(path, sizeof(path), SYS_CPU_DIR, i);
+ len = snprintf(path, sizeof(path), SYS_CPU_DIR, i);
if (len <= 0 || (unsigned)len >= sizeof(path))
continue;
goto error1;
}
- rte_snprintf(cfg->sections[curr_section]->name,
+ snprintf(cfg->sections[curr_section]->name,
sizeof(cfg->sections[0]->name),
"%s", &buffer[1]);
}
}
struct cfg_entry *entry = sect->entries[curr_entry];
- rte_snprintf(entry->name, sizeof(entry->name), "%s", split[0]);
- rte_snprintf(entry->value, sizeof(entry->value), "%s", split[1]);
+ snprintf(entry->name, sizeof(entry->name), "%s", split[0]);
+ snprintf(entry->value, sizeof(entry->value), "%s", split[1]);
_strip(entry->name, strnlen(entry->name, sizeof(entry->name)));
_strip(entry->value, strnlen(entry->value, sizeof(entry->value)));
}
{
int i;
for (i = 0; i < cfg->num_sections && i < max_sections; i++) {
- rte_snprintf(sections[i], CFG_NAME_LEN, "%s", cfg->sections[i]->name);
+ snprintf(sections[i], CFG_NAME_LEN, "%s", cfg->sections[i]->name);
}
return i;
}
char str[32];
/* Parse WRED min thresholds */
- rte_snprintf(str, sizeof(str), "tc %d wred min", j);
+ snprintf(str, sizeof(str), "tc %d wred min", j);
entry = cfg_get_entry(cfg, "red", str);
if (entry) {
char *next;
}
/* Parse WRED max thresholds */
- rte_snprintf(str, sizeof(str), "tc %d wred max", j);
+ snprintf(str, sizeof(str), "tc %d wred max", j);
entry = cfg_get_entry(cfg, "red", str);
if (entry) {
char *next;
}
/* Parse WRED inverse mark probabilities */
- rte_snprintf(str, sizeof(str), "tc %d wred inv prob", j);
+ snprintf(str, sizeof(str), "tc %d wred inv prob", j);
entry = cfg_get_entry(cfg, "red", str);
if (entry) {
char *next;
}
/* Parse WRED EWMA filter weights */
- rte_snprintf(str, sizeof(str), "tc %d wred weight", j);
+ snprintf(str, sizeof(str), "tc %d wred weight", j);
entry = cfg_get_entry(cfg, "red", str);
if (entry) {
char *next;
for (j = 0; j < profiles; j++) {
char pipe_name[32];
- rte_snprintf(pipe_name, sizeof(pipe_name), "pipe profile %d", j);
+ snprintf(pipe_name, sizeof(pipe_name), "pipe profile %d", j);
entry = cfg_get_entry(cfg, pipe_name, "tb rate");
if (entry)
for (i = 0; i < MAX_SCHED_SUBPORTS; i++) {
char sec_name[CFG_NAME_LEN];
- rte_snprintf(sec_name, sizeof(sec_name), "subport %d", i);
+ snprintf(sec_name, sizeof(sec_name), "subport %d", i);
if (cfg_has_section(cfg, sec_name)) {
entry = cfg_get_entry(cfg, sec_name, "tb rate");
for (k = begin; k <= end; k++) {
char profile_name[CFG_NAME_LEN];
- rte_snprintf(profile_name, sizeof(profile_name),
+ snprintf(profile_name, sizeof(profile_name),
"pipe profile %d", profile);
if (cfg_has_section(cfg, profile_name))
app_pipe_to_profile[i][k] = profile;
port_params.socket = socketid;
port_params.rate = (uint64_t) link.link_speed * 1000 * 1000 / 8;
- rte_snprintf(port_name, sizeof(port_name), "port_%d", portid);
+ snprintf(port_name, sizeof(port_name), "port_%d", portid);
port_params.name = port_name;
port = rte_sched_port_config(&port_params);
uint32_t socket = rte_lcore_to_socket_id(qos_conf[i].rx_core);
struct rte_ring *ring;
- rte_snprintf(ring_name, MAX_NAME_LEN, "ring-%u-%u", i, qos_conf[i].rx_core);
+ snprintf(ring_name, MAX_NAME_LEN, "ring-%u-%u", i, qos_conf[i].rx_core);
ring = rte_ring_lookup(ring_name);
if (ring == NULL)
qos_conf[i].rx_ring = rte_ring_create(ring_name, ring_conf.ring_size,
else
qos_conf[i].rx_ring = ring;
- rte_snprintf(ring_name, MAX_NAME_LEN, "ring-%u-%u", i, qos_conf[i].tx_core);
+ snprintf(ring_name, MAX_NAME_LEN, "ring-%u-%u", i, qos_conf[i].tx_core);
ring = rte_ring_lookup(ring_name);
if (ring == NULL)
qos_conf[i].tx_ring = rte_ring_create(ring_name, ring_conf.ring_size,
/* create the mbuf pools for each RX Port */
- rte_snprintf(pool_name, MAX_NAME_LEN, "mbuf_pool%u", i);
+ snprintf(pool_name, MAX_NAME_LEN, "mbuf_pool%u", i);
qos_conf[i].mbuf_pool = rte_mempool_create(pool_name, mp_size, MBUF_SIZE,
burst_conf.rx_burst * 4,
sizeof(struct rte_pktmbuf_pool_private),
struct rte_ring *ring;
char ring_name[RTE_RING_NAMESIZE];
- rte_snprintf(ring_name, RTE_RING_NAMESIZE,
+ snprintf(ring_name, RTE_RING_NAMESIZE,
"core%d_port%d", lcore_id, port_id);
ring = rte_ring_create(ring_name, RING_SIZE, rte_socket_id(),
RING_F_SP_ENQ | RING_F_SC_DEQ);
/* Max number of devices. Limited by vmdq. */
#define MAX_DEVICES 64
-/* Size of buffers used for rte_snprintfs. */
+/* Size of buffers used for snprintfs. */
#define MAX_PRINT_BUFF 6072
/* Maximum character device basename size. */
if (strnlen(q_arg, MAX_BASENAME_SZ) > MAX_BASENAME_SZ)
return -1;
else
- rte_snprintf((char*)&dev_basename, MAX_BASENAME_SZ, "%s", q_arg);
+ snprintf((char*)&dev_basename, MAX_BASENAME_SZ, "%s", q_arg);
return 0;
}
char packet[MAX_PRINT_BUFF]; \
\
if ((header)) \
- rte_snprintf(packet, MAX_PRINT_BUFF, "(%"PRIu64") Header size %d: ", (device->device_fh), (size)); \
+ snprintf(packet, MAX_PRINT_BUFF, "(%"PRIu64") Header size %d: ", (device->device_fh), (size)); \
else \
- rte_snprintf(packet, MAX_PRINT_BUFF, "(%"PRIu64") Packet size %d: ", (device->device_fh), (size)); \
+ snprintf(packet, MAX_PRINT_BUFF, "(%"PRIu64") Packet size %d: ", (device->device_fh), (size)); \
for (index = 0; index < (size); index++) { \
- rte_snprintf(packet + strnlen(packet, MAX_PRINT_BUFF), MAX_PRINT_BUFF - strnlen(packet, MAX_PRINT_BUFF), \
+ snprintf(packet + strnlen(packet, MAX_PRINT_BUFF), MAX_PRINT_BUFF - strnlen(packet, MAX_PRINT_BUFF), \
"%02hhx ", pkt_addr[index]); \
} \
- rte_snprintf(packet + strnlen(packet, MAX_PRINT_BUFF), MAX_PRINT_BUFF - strnlen(packet, MAX_PRINT_BUFF), "\n"); \
+ snprintf(packet + strnlen(packet, MAX_PRINT_BUFF), MAX_PRINT_BUFF - strnlen(packet, MAX_PRINT_BUFF), "\n"); \
\
LOG_DEBUG(VHOST_DATA, "%s", packet); \
} while(0)
+ num_switching_cores * MAX_PKT_BURST;
for (queue_id = 0; queue_id < MAX_QUEUES; queue_id++) {
- rte_snprintf(pool_name, sizeof(pool_name),
+ snprintf(pool_name, sizeof(pool_name),
"rxmbuf_pool_%u", queue_id);
- rte_snprintf(ring_name, sizeof(ring_name),
+ snprintf(ring_name, sizeof(ring_name),
"rxmbuf_ring_%u", queue_id);
setup_mempool_tbl(rte_socket_id(), queue_id,
pool_name, ring_name, nb_mbuf);
+ num_switching_cores * MAX_PKT_BURST;
for (queue_id = 0; queue_id < MAX_QUEUES; queue_id++) {
- rte_snprintf(pool_name, sizeof(pool_name),
+ snprintf(pool_name, sizeof(pool_name),
"txmbuf_pool_%u", queue_id);
- rte_snprintf(ring_name, sizeof(ring_name),
+ snprintf(ring_name, sizeof(ring_name),
"txmbuf_ring_%u", queue_id);
setup_mempool_tbl(rte_socket_id(),
(queue_id + MAX_QUEUES),
* of userspace vhost which we can then add devices to separately.
*/
if (strncmp(base_name, default_cdev, PATH_MAX)!=0) {
- rte_snprintf(device_name, PATH_MAX, "DEVNAME=%s-%d", base_name, index);
- rte_snprintf(char_device_name, PATH_MAX, "/dev/%s-%d", base_name, index);
+ snprintf(device_name, PATH_MAX, "DEVNAME=%s-%d", base_name, index);
+ snprintf(char_device_name, PATH_MAX, "/dev/%s-%d", base_name, index);
} else {
- rte_snprintf(device_name, PATH_MAX, "DEVNAME=%s", base_name);
- rte_snprintf(char_device_name, PATH_MAX, "/dev/%s", base_name);
+ snprintf(device_name, PATH_MAX, "DEVNAME=%s", base_name);
+ snprintf(char_device_name, PATH_MAX, "/dev/%s", base_name);
}
/* Check if device already exists. */
char *end = NULL;
/* Path where mem files are located. */
- rte_snprintf (procdir, PATH_MAX, "/proc/%u/fd/", pid);
+ snprintf (procdir, PATH_MAX, "/proc/%u/fd/", pid);
/* Maps file used to locate mem file. */
- rte_snprintf (mapfile, PATH_MAX, "/proc/%u/maps", pid);
+ snprintf (mapfile, PATH_MAX, "/proc/%u/maps", pid);
fmap = fopen(mapfile, "r");
if (fmap == NULL) {
/* Read the fd directory contents. */
while (NULL != (dptr = readdir(dp))) {
- rte_snprintf (memfile, PATH_MAX, "/proc/%u/fd/%s", pid, dptr->d_name);
+ snprintf (memfile, PATH_MAX, "/proc/%u/fd/%s", pid, dptr->d_name);
realpath(memfile, resolved_path);
if (resolved_path == NULL) {
RTE_LOG(ERR, VHOST_CONFIG, "(%"PRIu64") Failed to resolve fd directory\n", dev->device_fh);
/* Max number of devices. Limited by vmdq. */
#define MAX_DEVICES 64
-/* Size of buffers used for rte_snprintfs. */
+/* Size of buffers used for snprintfs. */
#define MAX_PRINT_BUFF 6072
char packet[MAX_PRINT_BUFF]; \
\
if ((header)) \
- rte_snprintf(packet, MAX_PRINT_BUFF, "(%"PRIu64") Header size %d: ", (device->device_fh), (size)); \
+ snprintf(packet, MAX_PRINT_BUFF, "(%"PRIu64") Header size %d: ", (device->device_fh), (size)); \
else \
- rte_snprintf(packet, MAX_PRINT_BUFF, "(%"PRIu64") Packet size %d: ", (device->device_fh), (size)); \
+ snprintf(packet, MAX_PRINT_BUFF, "(%"PRIu64") Packet size %d: ", (device->device_fh), (size)); \
for (index = 0; index < (size); index++) { \
- rte_snprintf(packet + strnlen(packet, MAX_PRINT_BUFF), MAX_PRINT_BUFF - strnlen(packet, MAX_PRINT_BUFF), \
+ snprintf(packet + strnlen(packet, MAX_PRINT_BUFF), MAX_PRINT_BUFF - strnlen(packet, MAX_PRINT_BUFF), \
"%02hhx ", pkt_addr[index]); \
} \
- rte_snprintf(packet + strnlen(packet, MAX_PRINT_BUFF), MAX_PRINT_BUFF - strnlen(packet, MAX_PRINT_BUFF), "\n"); \
+ snprintf(packet + strnlen(packet, MAX_PRINT_BUFF), MAX_PRINT_BUFF - strnlen(packet, MAX_PRINT_BUFF), "\n"); \
\
LOG_DEBUG(VHOST_DATA, "%s", packet); \
} while(0)
continue;
for (j = 0; j < RTE_MAX_ETHPORTS; j++) {
- rte_snprintf(node, PATH_MAX, "%s%d", VIRTIO_START, j);
- rte_snprintf(path, PATH_MAX, XEN_VM_NODE_FMT,
+ snprintf(node, PATH_MAX, "%s%d", VIRTIO_START, j);
+ snprintf(path, PATH_MAX, XEN_VM_NODE_FMT,
dom_id, node);
th = xs_transaction_start(watch.xs);
int ret = -1;
errno = 0;
- rte_snprintf(path, sizeof(path),
+ snprintf(path, sizeof(path),
XEN_VM_ROOTNODE_FMT"/%d_"XEN_GVA_SUFFIX,
mempool->dom_id, mempool->pool_idx);
while (1) {
/* check if null terminated */
- rte_snprintf(path, sizeof(path),
+ snprintf(path, sizeof(path),
XEN_VM_ROOTNODE_FMT"/%d_"XEN_MEMPOOL_SUFFIX,
guest->dom_id,
guest->pool_num);
int pg_sz = getpagesize();
char *end;
- rte_snprintf(path, sizeof(path),
+ snprintf(path, sizeof(path),
XEN_VM_ROOTNODE_FMT"/%d_"XEN_VRINGFLAG_SUFFIX,
vring->dom_id, vring->virtio_idx);
uint32_t len;
int ret = -1;
- rte_snprintf(path, sizeof(path),
+ snprintf(path, sizeof(path),
XEN_VM_ROOTNODE_FMT"/%d_"XEN_ADDR_SUFFIX,
vring->dom_id, vring->virtio_idx);
struct xen_vring *vring = NULL;
/*check if null terminated */
- rte_snprintf(path, sizeof(path),
+ snprintf(path, sizeof(path),
XEN_VM_ROOTNODE_FMT"/%d_"XEN_RXVRING_SUFFIX,
guest->dom_id,
virtio_idx);
goto err;
/*check if null terminated */
- rte_snprintf(path, sizeof(path),
+ snprintf(path, sizeof(path),
XEN_VM_ROOTNODE_FMT"/%d_"XEN_TXVRING_SUFFIX,
guest->dom_id,
virtio_idx);
return NULL;
}
- rte_snprintf(name, sizeof(name), "ACL_%s", param->name);
+ snprintf(name, sizeof(name), "ACL_%s", param->name);
/* calculate amount of memory required for pattern set. */
sz = sizeof(*ctx) + param->max_rule_num * param->rule_size;
ctx->max_rules = param->max_rule_num;
ctx->rule_sz = param->rule_size;
ctx->socket_id = param->socket_id;
- rte_snprintf(ctx->name, sizeof(ctx->name), "%s", param->name);
+ snprintf(ctx->name, sizeof(ctx->name), "%s", param->name);
TAILQ_INSERT_TAIL(acl_list, ctx, next);
/*
* rte_string related
*/
-#define rte_snprintf(str, len, frmt, args...) snprintf(str, len, frmt, ##args)
+#define snprintf(str, len, frmt, args...) snprintf(str, len, frmt, ##args)
/*
* rte_log related
goto error1;
}
- rte_snprintf(cfg->sections[curr_section]->name,
+ snprintf(cfg->sections[curr_section]->name,
sizeof(cfg->sections[0]->name),
"%s", &buffer[1]);
} else {
struct rte_cfgfile_entry *entry = sect->entries[
curr_entry];
- rte_snprintf(entry->name, sizeof(entry->name), "%s",
+ snprintf(entry->name, sizeof(entry->name), "%s",
split[0]);
- rte_snprintf(entry->value, sizeof(entry->value), "%s",
+ snprintf(entry->value, sizeof(entry->value), "%s",
split[1]);
_strip(entry->name, strnlen(entry->name,
sizeof(entry->name)));
int i;
for (i = 0; i < cfg->num_sections && i < max_sections; i++)
- rte_snprintf(sections[i], CFG_NAME_LEN, "%s",
+ snprintf(sections[i], CFG_NAME_LEN, "%s",
cfg->sections[i]->name);
return i;
{
if (!cl || !prompt)
return;
- rte_snprintf(cl->prompt, sizeof(cl->prompt), "%s", prompt);
+ snprintf(cl->prompt, sizeof(cl->prompt), "%s", prompt);
}
struct cmdline *
}
#ifdef RTE_LIBRTE_CMDLINE_DEBUG
- rte_snprintf(debug_buf, (linelen>64 ? 64 : linelen), "%s", buf);
+ snprintf(debug_buf, (linelen>64 ? 64 : linelen), "%s", buf);
debug_printf("Parse line : len=%d, <%s>\n", linelen, debug_buf);
#endif
if (!strncmp(partial_tok, tmpbuf,
partial_tok_len)) {
if (comp_len == -1) {
- rte_snprintf(comp_buf, sizeof(comp_buf),
+ snprintf(comp_buf, sizeof(comp_buf),
"%s", tmpbuf + partial_tok_len);
comp_len =
strnlen(tmpbuf + partial_tok_len,
if ((unsigned)(comp_len + 1) > size)
return 0;
- rte_snprintf(dst, size, "%s", comp_buf);
+ snprintf(dst, size, "%s", comp_buf);
dst[comp_len] = 0;
return 2;
}
sizeof(tmpbuf));
help_str = inst->help_str;
if (help_str)
- rte_snprintf(dst, size, "[%s]: %s", tmpbuf,
+ snprintf(dst, size, "[%s]: %s", tmpbuf,
help_str);
else
- rte_snprintf(dst, size, "[%s]: No help",
+ snprintf(dst, size, "[%s]: No help",
tmpbuf);
}
else {
- rte_snprintf(dst, size, "[RETURN]");
+ snprintf(dst, size, "[RETURN]");
}
return 1;
}
continue;
}
(*state)++;
- l=rte_snprintf(dst, size, "%s", tmpbuf);
+ l=snprintf(dst, size, "%s", tmpbuf);
if (l>=0 && token_hdr.ops->get_help) {
token_hdr.ops->get_help(token_p, tmpbuf,
sizeof(tmpbuf));
help_str = inst->help_str;
if (help_str)
- rte_snprintf(dst+l, size-l, "[%s]: %s",
+ snprintf(dst+l, size-l, "[%s]: %s",
tmpbuf, help_str);
else
- rte_snprintf(dst+l, size-l,
+ snprintf(dst+l, size-l,
"[%s]: No help", tmpbuf);
}
(token_len != ETHER_ADDRSTRLENSHORT - 1))
return -1;
- rte_snprintf(ether_str, token_len+1, "%s", buf);
+ snprintf(ether_str, token_len+1, "%s", buf);
tmp = my_ether_aton(ether_str);
if (tmp == NULL)
{
int ret;
- ret = rte_snprintf(dstbuf, size, "Ethernet address");
+ ret = snprintf(dstbuf, size, "Ethernet address");
if (ret < 0)
return -1;
return 0;
if (token_len >= INET6_ADDRSTRLEN+4)
return -1;
- rte_snprintf(ip_str, token_len+1, "%s", buf);
+ snprintf(ip_str, token_len+1, "%s", buf);
/* convert the network prefix */
if (tk2->ipaddr_data.flags & CMDLINE_IPADDR_NETWORK) {
switch (tk2->ipaddr_data.flags) {
case CMDLINE_IPADDR_V4:
- rte_snprintf(dstbuf, size, "IPv4");
+ snprintf(dstbuf, size, "IPv4");
break;
case CMDLINE_IPADDR_V6:
- rte_snprintf(dstbuf, size, "IPv6");
+ snprintf(dstbuf, size, "IPv6");
break;
case CMDLINE_IPADDR_V4|CMDLINE_IPADDR_V6:
- rte_snprintf(dstbuf, size, "IPv4/IPv6");
+ snprintf(dstbuf, size, "IPv4/IPv6");
break;
case CMDLINE_IPADDR_NETWORK|CMDLINE_IPADDR_V4:
- rte_snprintf(dstbuf, size, "IPv4 network");
+ snprintf(dstbuf, size, "IPv4 network");
break;
case CMDLINE_IPADDR_NETWORK|CMDLINE_IPADDR_V6:
- rte_snprintf(dstbuf, size, "IPv6 network");
+ snprintf(dstbuf, size, "IPv6 network");
break;
case CMDLINE_IPADDR_NETWORK|CMDLINE_IPADDR_V4|CMDLINE_IPADDR_V6:
- rte_snprintf(dstbuf, size, "IPv4/IPv6 network");
+ snprintf(dstbuf, size, "IPv4/IPv6 network");
break;
default:
- rte_snprintf(dstbuf, size, "IPaddr (bad flags)");
+ snprintf(dstbuf, size, "IPaddr (bad flags)");
break;
}
return 0;
/* if (nd.type >= (sizeof(num_help)/sizeof(const char *))) */
/* return -1; */
- ret = rte_snprintf(dstbuf, size, "%s", num_help[nd.type]);
+ ret = snprintf(dstbuf, size, "%s", num_help[nd.type]);
if (ret < 0)
return -1;
dstbuf[size-1] = '\0';
if (token_len >= PORTLIST_TOKEN_SIZE)
return (-1);
- rte_snprintf(portlist_str, token_len+1, "%s", buf);
+ snprintf(portlist_str, token_len+1, "%s", buf);
if (pl) {
pl->map = 0;
char *dstbuf, unsigned int size)
{
int ret;
- ret = rte_snprintf(dstbuf, size, "range of ports as 3,4-6,8-19,20");
+ ret = snprintf(dstbuf, size, "range of ports as 3,4-6,8-19,20");
if (ret < 0)
return -1;
return 0;
if (res) {
/* we are sure that token_len is < STR_TOKEN_SIZE-1 */
- rte_snprintf(res, STR_TOKEN_SIZE, "%s", buf);
+ snprintf(res, STR_TOKEN_SIZE, "%s", buf);
*((char *)res + token_len) = 0;
}
if (s) {
if (get_next_token(s))
- rte_snprintf(dstbuf, size, MULTISTRING_HELP);
+ snprintf(dstbuf, size, MULTISTRING_HELP);
else
- rte_snprintf(dstbuf, size, FIXEDSTRING_HELP);
+ snprintf(dstbuf, size, FIXEDSTRING_HELP);
} else
- rte_snprintf(dstbuf, size, ANYSTRING_HELP);
+ snprintf(dstbuf, size, ANYSTRING_HELP);
return 0;
}
return NULL;
}
- rte_snprintf(mz_name, sizeof(mz_name), RTE_DISTRIB_PREFIX"%s", name);
+ snprintf(mz_name, sizeof(mz_name), RTE_DISTRIB_PREFIX"%s", name);
mz = rte_memzone_reserve(mz_name, sizeof(*d), socket_id, NO_FLAGS);
if (mz == NULL) {
rte_errno = ENOMEM;
}
d = mz->addr;
- rte_snprintf(d->name, sizeof(d->name), "%s", name);
+ snprintf(d->name, sizeof(d->name), "%s", name);
d->num_workers = num_workers;
rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
return -1;
}
- rte_snprintf(physaddr_str, sizeof(physaddr_str), "hw.contigmem"
+ snprintf(physaddr_str, sizeof(physaddr_str), "hw.contigmem"
".physaddr.%d", j);
error = sysctlbyname(physaddr_str, &physaddr, &sysctl_size,
NULL, 0);
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return (pci_uio_map_secondary(dev));
- rte_snprintf(devname, sizeof(devname), "/dev/uio@pci:%u:%u:%u",
+ snprintf(devname, sizeof(devname), "/dev/uio@pci:%u:%u:%u",
dev->addr.bus, dev->addr.devid, dev->addr.function);
if (access(devname, O_RDWR) < 0) {
return (-1);
}
- rte_snprintf(uio_res->path, sizeof(uio_res->path), "%s", devname);
+ snprintf(uio_res->path, sizeof(uio_res->path), "%s", devname);
memcpy(&uio_res->pci_addr, &dev->addr, sizeof(uio_res->pci_addr));
if (getuid() != 0 && home_dir != NULL)
directory = home_dir;
- rte_snprintf(buffer, sizeof(buffer) - 1, RUNTIME_CONFIG_FMT, directory,
+ snprintf(buffer, sizeof(buffer) - 1, RUNTIME_CONFIG_FMT, directory,
internal_config.hugefile_prefix);
return buffer;
}
if (getuid() != 0 && home_dir != NULL)
directory = home_dir;
- rte_snprintf(buffer, sizeof(buffer) - 1, HUGEPAGE_INFO_FMT, directory,
+ snprintf(buffer, sizeof(buffer) - 1, HUGEPAGE_INFO_FMT, directory,
internal_config.hugefile_prefix);
return buffer;
}
static inline const char *
eal_get_hugefile_path(char *buffer, size_t buflen, const char *hugedir, int f_id)
{
- rte_snprintf(buffer, buflen, HUGEFILE_FMT, hugedir,
+ snprintf(buffer, buflen, HUGEFILE_FMT, hugedir,
internal_config.hugefile_prefix, f_id);
buffer[buflen - 1] = '\0';
return buffer;
static inline const char *
eal_get_hugefile_temp_path(char *buffer, size_t buflen, const char *hugedir, int f_id)
{
- rte_snprintf(buffer, buflen, TEMP_HUGEFILE_FMT, hugedir,
+ snprintf(buffer, buflen, TEMP_HUGEFILE_FMT, hugedir,
internal_config.hugefile_prefix, f_id);
buffer[buflen - 1] = '\0';
return buffer;
/* since some implementations of strerror_r throw an error
* themselves if errnum is too big, we handle that case here */
if (errnum > RTE_MAX_ERRNO)
- rte_snprintf(RTE_PER_LCORE(retval), RETVAL_SZ,
+ snprintf(RTE_PER_LCORE(retval), RETVAL_SZ,
#ifdef RTE_EXEC_ENV_BSDAPP
"Unknown error: %d", errnum);
#else
ofs = 0;
while (ofs < len) {
/* format the line in the buffer, then use printf to output to screen */
- out = rte_snprintf(line, LINE_LEN, "%08X:", ofs);
+ out = snprintf(line, LINE_LEN, "%08X:", ofs);
for (i = 0; ((ofs + i) < len) && (i < 16); i++)
- out += rte_snprintf(line+out, LINE_LEN - out, " %02X", (data[ofs+i] & 0xff));
+ out += snprintf(line+out, LINE_LEN - out, " %02X", (data[ofs+i] & 0xff));
for(; i <= 16; i++)
- out += rte_snprintf(line+out, LINE_LEN - out, " | ");
+ out += snprintf(line+out, LINE_LEN - out, " | ");
for(i = 0; (ofs < len) && (i < 16); i++, ofs++) {
unsigned char c = data[ofs];
if ( (c < ' ') || (c > '~'))
c = '.';
- out += rte_snprintf(line+out, LINE_LEN - out, "%c", c);
+ out += snprintf(line+out, LINE_LEN - out, "%c", c);
}
fprintf(f, "%s\n", line);
}
out = 0;
line[out] = '\0';
}
- out += rte_snprintf(line+out, LINE_LEN - out, "%02x%s",
+ out += snprintf(line+out, LINE_LEN - out, "%02x%s",
(data[i] & 0xff), ((i+1) < len)? ":" : "");
}
if ( out > 0 )
/* fill the zone in config */
struct rte_memzone *mz = &mcfg->memzone[mcfg->memzone_idx++];
- rte_snprintf(mz->name, sizeof(mz->name), "%s", name);
+ snprintf(mz->name, sizeof(mz->name), "%s", name);
mz->phys_addr = memseg_physaddr;
mz->addr = memseg_addr;
mz->len = requested_len;
#endif
/**
- * Safer version of snprintf that writes up to buflen characters to
- * the output buffer and ensures that the resultant string is null-terminated,
- * that is, it writes at most buflen-1 actual string characters to buffer. The
- * return value is the number of characters which should be written to the
- * buffer, so string truncation can be detected by the caller by checking if
- * the return value is greater than or equal to the buflen.
+ * This functio is deprecated and just for backward compatibility.
+ * It is just an alternate version of snprintf.
*
* @param buffer
* The buffer into which the output is to be written
*/
int
rte_snprintf(char *buffer, int buflen, const char *format, ...)
- __attribute__((format(printf,3,4)));
+ __attribute__((format(printf,3,4)))
+ __attribute__((deprecated));
/**
* Takes string "string" parameter and splits it at character "delim"
const char *nr_rsvd_file = "resv_hugepages";
/* first, check how many reserved pages kernel reports */
- rte_snprintf(path, sizeof(path), "%s/%s/%s",
+ snprintf(path, sizeof(path), "%s/%s/%s",
sys_dir_path, subdir, nr_rsvd_file);
if (eal_parse_sysfs_value(path, &resv_pages) < 0)
memset(path, 0, sizeof(path));
- rte_snprintf(path, sizeof(path), "%s/%s/%s",
+ snprintf(path, sizeof(path), "%s/%s/%s",
sys_dir_path, subdir, nr_hp_file);
if (eal_parse_sysfs_value(path, &num_pages) < 0)
sizeof(struct rte_ivshmem_metadata_entry));
/* copy path */
- rte_snprintf(ivshmem_config->segment[idx].path, path_len, "%s", path);
+ snprintf(ivshmem_config->segment[idx].path, path_len, "%s", path);
idx++;
}
int fd;
/* build ivshmem config file path */
- rte_snprintf(path, sizeof(path), IVSHMEM_CONFIG_PATH,
+ snprintf(path, sizeof(path), IVSHMEM_CONFIG_PATH,
internal_config.hugefile_prefix);
fd = open(path, O_CREAT | O_RDWR, 0600);
int fd;
/* build ivshmem config file path */
- rte_snprintf(path, sizeof(path), IVSHMEM_CONFIG_PATH,
+ snprintf(path, sizeof(path), IVSHMEM_CONFIG_PATH,
internal_config.hugefile_prefix);
fd = open(path, O_RDONLY);
continue;
/* construct pci device path */
- rte_snprintf(path, sizeof(path), IVSHMEM_RESOURCE_PATH,
+ snprintf(path, sizeof(path), IVSHMEM_RESOURCE_PATH,
dev->addr.domain, dev->addr.bus, dev->addr.devid,
dev->addr.function);
dev->addr.bus, dev->addr.devid, dev->addr.function);
ivshmem_config->pci_devs[ivshmem_config->pci_devs_idx].ioremap_addr = res->phys_addr;
- rte_snprintf(ivshmem_config->pci_devs[ivshmem_config->pci_devs_idx].path,
+ snprintf(ivshmem_config->pci_devs[ivshmem_config->pci_devs_idx].path,
sizeof(ivshmem_config->pci_devs[ivshmem_config->pci_devs_idx].path),
"%s", path);
cpu_detected(unsigned lcore_id)
{
char path[PATH_MAX];
- int len = rte_snprintf(path, sizeof(path), SYS_CPU_DIR
+ int len = snprintf(path, sizeof(path), SYS_CPU_DIR
"/"CORE_ID_FILE, lcore_id);
if (len <= 0 || (unsigned)len >= sizeof(path))
return 0;
struct dirent *e;
char *endptr = NULL;
- int len = rte_snprintf(path, sizeof(path),
+ int len = snprintf(path, sizeof(path),
SYS_CPU_DIR, lcore_id);
if (len <= 0 || (unsigned)len >= sizeof(path))
goto err;
"for lcore %u - using physical package id instead\n",
lcore_id);
- len = rte_snprintf(path, sizeof(path), SYS_CPU_DIR "/%s",
+ len = snprintf(path, sizeof(path), SYS_CPU_DIR "/%s",
lcore_id, PHYS_PKG_FILE);
if (len <= 0 || (unsigned)len >= sizeof(path))
goto err;
char path[PATH_MAX];
unsigned long id;
- int len = rte_snprintf(path, sizeof(path), SYS_CPU_DIR "/%s", lcore_id, CORE_ID_FILE);
+ int len = snprintf(path, sizeof(path), SYS_CPU_DIR "/%s", lcore_id, CORE_ID_FILE);
if (len <= 0 || (unsigned)len >= sizeof(path))
goto err;
if (eal_parse_sysfs_value(path, &id) != 0)
return -1;
}
- rte_snprintf(hugepg_tbl[page_idx].filepath, MAX_HUGEPAGE_PATH, "%s",
+ snprintf(hugepg_tbl[page_idx].filepath, MAX_HUGEPAGE_PATH, "%s",
filepath);
physaddr = rte_mem_virt2phy(vma_addr);
return 0;
}
- rte_snprintf(hugedir_str, sizeof(hugedir_str),
+ snprintf(hugedir_str, sizeof(hugedir_str),
"%s/", hpi->hugedir);
/* parse numa map */
struct rte_pci_addr *loc = &dev->addr;
/* open /sys/bus/pci/devices/AAAA:BB:CC.D/driver */
- rte_snprintf(filename, sizeof(filename),
+ snprintf(filename, sizeof(filename),
SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/driver/unbind",
loc->domain, loc->bus, loc->devid, loc->function);
if (f == NULL) /* device was not bound */
return 0;
- n = rte_snprintf(buf, sizeof(buf), PCI_PRI_FMT "\n",
+ n = snprintf(buf, sizeof(buf), PCI_PRI_FMT "\n",
loc->domain, loc->bus, loc->devid, loc->function);
if ((n < 0) || (n >= (int)sizeof(buf))) {
- RTE_LOG(ERR, EAL, "%s(): rte_snprintf failed\n", __func__);
+ RTE_LOG(ERR, EAL, "%s(): snprintf failed\n", __func__);
goto error;
}
if (fwrite(buf, n, 1, f) == 0) {
dev->addr.function = function;
/* get vendor id */
- rte_snprintf(filename, sizeof(filename), "%s/vendor", dirname);
+ snprintf(filename, sizeof(filename), "%s/vendor", dirname);
if (eal_parse_sysfs_value(filename, &tmp) < 0) {
free(dev);
return -1;
dev->id.vendor_id = (uint16_t)tmp;
/* get device id */
- rte_snprintf(filename, sizeof(filename), "%s/device", dirname);
+ snprintf(filename, sizeof(filename), "%s/device", dirname);
if (eal_parse_sysfs_value(filename, &tmp) < 0) {
free(dev);
return -1;
dev->id.device_id = (uint16_t)tmp;
/* get subsystem_vendor id */
- rte_snprintf(filename, sizeof(filename), "%s/subsystem_vendor",
+ snprintf(filename, sizeof(filename), "%s/subsystem_vendor",
dirname);
if (eal_parse_sysfs_value(filename, &tmp) < 0) {
free(dev);
dev->id.subsystem_vendor_id = (uint16_t)tmp;
/* get subsystem_device id */
- rte_snprintf(filename, sizeof(filename), "%s/subsystem_device",
+ snprintf(filename, sizeof(filename), "%s/subsystem_device",
dirname);
if (eal_parse_sysfs_value(filename, &tmp) < 0) {
free(dev);
/* get max_vfs */
dev->max_vfs = 0;
- rte_snprintf(filename, sizeof(filename), "%s/max_vfs", dirname);
+ snprintf(filename, sizeof(filename), "%s/max_vfs", dirname);
if (!access(filename, F_OK) &&
eal_parse_sysfs_value(filename, &tmp) == 0) {
dev->max_vfs = (uint16_t)tmp;
}
/* get numa node */
- rte_snprintf(filename, sizeof(filename), "%s/numa_node",
+ snprintf(filename, sizeof(filename), "%s/numa_node",
dirname);
if (access(filename, R_OK) != 0) {
/* if no NUMA support just set node to 0 */
}
/* parse resources */
- rte_snprintf(filename, sizeof(filename), "%s/resource", dirname);
+ snprintf(filename, sizeof(filename), "%s/resource", dirname);
if (pci_parse_sysfs_resource(filename, dev) < 0) {
RTE_LOG(ERR, EAL, "%s(): cannot parse resource\n", __func__);
free(dev);
&bus, &devid, &function) != 0)
continue;
- rte_snprintf(dirname, sizeof(dirname), "%s/%s", SYSFS_PCI_DEVICES,
+ snprintf(dirname, sizeof(dirname), "%s/%s", SYSFS_PCI_DEVICES,
e->d_name);
if (pci_scan_one(dirname, domain, bus, devid, function) < 0)
goto error;
strncmp(RTE_PCI_EXTENDED_TAG, "off", 3) != 0)
return 0;
- rte_snprintf(filename, sizeof(filename),
+ snprintf(filename, sizeof(filename),
SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/" "extended_tag",
loc->domain, loc->bus, loc->devid, loc->function);
f = fopen(filename, "rw+");
if (!max_size)
return 0;
- rte_snprintf(filename, sizeof(filename),
+ snprintf(filename, sizeof(filename),
SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/" "max_read_request_size",
loc->domain, loc->bus, loc->devid, loc->function);
f = fopen(filename, "rw+");
return -1;
fgets(buf, sizeof(buf), f);
- rte_snprintf(param, sizeof(param), "%d", max_size);
+ snprintf(param, sizeof(param), "%d", max_size);
/* check if the size to be set is the same as current */
if (strcmp(buf, param) == 0) {
for (i = 0; i != nb_maps; i++) {
/* check if map directory exists */
- rte_snprintf(dirname, sizeof(dirname),
+ snprintf(dirname, sizeof(dirname),
"%s/maps/map%u", devname, i);
if (access(dirname, F_OK) != 0)
break;
/* get mapping offset */
- rte_snprintf(filename, sizeof(filename),
+ snprintf(filename, sizeof(filename),
"%s/offset", dirname);
if (pci_parse_sysfs_value(filename, &offset) < 0) {
RTE_LOG(ERR, EAL,
}
/* get mapping size */
- rte_snprintf(filename, sizeof(filename),
+ snprintf(filename, sizeof(filename),
"%s/size", dirname);
if (pci_parse_sysfs_value(filename, &size) < 0) {
RTE_LOG(ERR, EAL,
}
/* get mapping physical address */
- rte_snprintf(filename, sizeof(filename),
+ snprintf(filename, sizeof(filename),
"%s/addr", dirname);
if (pci_parse_sysfs_value(filename, &maps[i].phaddr) < 0) {
RTE_LOG(ERR, EAL,
/* get the name of the sysfs file that contains the major and minor
* of the uio device and read its content */
- rte_snprintf(filename, sizeof(filename), "%s/dev", sysfs_uio_path);
+ snprintf(filename, sizeof(filename), "%s/dev", sysfs_uio_path);
f = fopen(filename, "r");
if (f == NULL) {
fclose(f);
/* create the char device "mknod /dev/uioX c major minor" */
- rte_snprintf(filename, sizeof(filename), "/dev/uio%u", uio_num);
+ snprintf(filename, sizeof(filename), "/dev/uio%u", uio_num);
dev = makedev(major, minor);
ret = mknod(filename, S_IFCHR | S_IRUSR | S_IWUSR, dev);
if (f == NULL) {
/* depending on kernel version, uio can be located in uio/uioX
* or uio:uioX */
- rte_snprintf(dirname, sizeof(dirname),
+ snprintf(dirname, sizeof(dirname),
SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/uio",
loc->domain, loc->bus, loc->devid, loc->function);
dir = opendir(dirname);
if (dir == NULL) {
/* retry with the parent directory */
- rte_snprintf(dirname, sizeof(dirname),
+ snprintf(dirname, sizeof(dirname),
SYSFS_PCI_DEVICES "/" PCI_PRI_FMT,
loc->domain, loc->bus, loc->devid, loc->function);
dir = opendir(dirname);
errno = 0;
uio_num = strtoull(e->d_name + shortprefix_len, &endptr, 10);
if (errno == 0 && endptr != (e->d_name + shortprefix_len)) {
- rte_snprintf(dstbuf, buflen, "%s/uio%u", dirname, uio_num);
+ snprintf(dstbuf, buflen, "%s/uio%u", dirname, uio_num);
break;
}
errno = 0;
uio_num = strtoull(e->d_name + longprefix_len, &endptr, 10);
if (errno == 0 && endptr != (e->d_name + longprefix_len)) {
- rte_snprintf(dstbuf, buflen, "%s/uio:uio%u", dirname, uio_num);
+ snprintf(dstbuf, buflen, "%s/uio:uio%u", dirname, uio_num);
break;
}
}
"skipping\n", loc->domain, loc->bus, loc->devid, loc->function);
return 1;
}
- rte_snprintf(devname, sizeof(devname), "/dev/uio%u", uio_num);
+ snprintf(devname, sizeof(devname), "/dev/uio%u", uio_num);
/* save fd if in primary process */
dev->intr_handle.fd = open(devname, O_RDWR);
return -1;
}
- rte_snprintf(uio_res->path, sizeof(uio_res->path), "%s", devname);
+ snprintf(uio_res->path, sizeof(uio_res->path), "%s", devname);
memcpy(&uio_res->pci_addr, &dev->addr, sizeof(uio_res->pci_addr));
/* collect info about device mappings */
/* if primary, try to open the group */
if (internal_config.process_type == RTE_PROC_PRIMARY) {
- rte_snprintf(filename, sizeof(filename),
+ snprintf(filename, sizeof(filename),
VFIO_GROUP_FMT, iommu_group_no);
vfio_group_fd = open(filename, O_RDWR);
if (vfio_group_fd < 0) {
memset(filename, 0, sizeof(filename));
/* try to find out IOMMU group for this device */
- rte_snprintf(linkname, sizeof(linkname),
+ snprintf(linkname, sizeof(linkname),
SYSFS_PCI_DEVICES "/%s/iommu_group", pci_addr);
ret = readlink(linkname, filename, sizeof(filename));
dev->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
/* store PCI address string */
- rte_snprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT,
+ snprintf(pci_addr, sizeof(pci_addr), PCI_PRI_FMT,
loc->domain, loc->bus, loc->devid, loc->function);
/* get group number */
dir = home_dir;
/* use current prefix as file path */
- rte_snprintf(buffer, bufsz, SOCKET_PATH_FMT, dir,
+ snprintf(buffer, bufsz, SOCKET_PATH_FMT, dir,
internal_config.hugefile_prefix);
}
static const char *file_name;
file_name = "memsize";
- rte_snprintf(path, sizeof(path), "%s/%s",
+ snprintf(path, sizeof(path), "%s/%s",
sys_dir_path, file_name);
if (eal_parse_sysfs_value(path, &mem_size) < 0)
meminfo.size = mem_size;
/* construct memory mangement name for Dom0 */
- rte_snprintf(meminfo.name, DOM0_NAME_MAX, "%s-%s",
+ snprintf(meminfo.name, DOM0_NAME_MAX, "%s-%s",
internal_config.hugefile_prefix, DEFAUL_DOM0_NAME);
/* Notify kernel driver to allocate memory */
}
/* construct memory mangement name for Dom0 */
- rte_snprintf(name, DOM0_NAME_MAX, "%s-%s",
+ snprintf(name, DOM0_NAME_MAX, "%s-%s",
internal_config.hugefile_prefix, DEFAUL_DOM0_NAME);
/* attach to memory segments of primary process */
ret = ioctl(xen_fd, RTE_DOM0_IOCTL_ATTACH_TO_MEMSEG, name);
if (getuid() != 0 && home_dir != NULL)
directory = home_dir;
- rte_snprintf(buffer, sizeof(buffer) - 1, RUNTIME_CONFIG_FMT, directory,
+ snprintf(buffer, sizeof(buffer) - 1, RUNTIME_CONFIG_FMT, directory,
internal_config.hugefile_prefix);
return buffer;
}
if (getuid() != 0 && home_dir != NULL)
directory = home_dir;
- rte_snprintf(buffer, sizeof(buffer) - 1, HUGEPAGE_INFO_FMT, directory,
+ snprintf(buffer, sizeof(buffer) - 1, HUGEPAGE_INFO_FMT, directory,
internal_config.hugefile_prefix);
return buffer;
}
static inline const char *
eal_get_hugefile_path(char *buffer, size_t buflen, const char *hugedir, int f_id)
{
- rte_snprintf(buffer, buflen, HUGEFILE_FMT, hugedir,
+ snprintf(buffer, buflen, HUGEFILE_FMT, hugedir,
internal_config.hugefile_prefix, f_id);
buffer[buflen - 1] = '\0';
return buffer;
static inline const char *
eal_get_hugefile_temp_path(char *buffer, size_t buflen, const char *hugedir, int f_id)
{
- rte_snprintf(buffer, buflen, TEMP_HUGEFILE_FMT, hugedir,
+ snprintf(buffer, buflen, TEMP_HUGEFILE_FMT, hugedir,
internal_config.hugefile_prefix, f_id);
buffer[buflen - 1] = '\0';
return buffer;
return NULL;
}
- rte_snprintf(hash_name, sizeof(hash_name), "FBK_%s", params->name);
+ snprintf(hash_name, sizeof(hash_name), "FBK_%s", params->name);
rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
memset(ht, 0, mem_size);
/* Set up hash table context. */
- rte_snprintf(ht->name, sizeof(ht->name), "%s", params->name);
+ snprintf(ht->name, sizeof(ht->name), "%s", params->name);
ht->entries = params->entries;
ht->entries_per_bucket = params->entries_per_bucket;
ht->used_entries = 0;
return NULL;
}
- rte_snprintf(hash_name, sizeof(hash_name), "HT_%s", params->name);
+ snprintf(hash_name, sizeof(hash_name), "HT_%s", params->name);
/* Calculate hash dimensions */
num_buckets = params->entries / params->bucket_entries;
}
/* Setup hash context */
- rte_snprintf(h->name, sizeof(h->name), "%s", params->name);
+ snprintf(h->name, sizeof(h->name), "%s", params->name);
h->entries = params->entries;
h->bucket_entries = params->bucket_entries;
h->key_len = params->key_len;
}
/* calculate offset and copy the file path */
- rte_snprintf(e->filepath, RTE_PTR_DIFF(path_end, start) + 1, "%s", start);
+ snprintf(e->filepath, RTE_PTR_DIFF(path_end, start) + 1, "%s", start);
e->offset = virt_addr - start_addr;
static inline void
ivshmem_config_path(char *buffer, size_t bufflen, const char *name)
{
- rte_snprintf(buffer, bufflen, IVSHMEM_CONFIG_FILE_FMT, name);
+ snprintf(buffer, bufflen, IVSHMEM_CONFIG_FILE_FMT, name);
}
/* Metadata setup */
memset(ivshmem_config->metadata, 0, sizeof(struct rte_ivshmem_metadata));
ivshmem_config->metadata->magic_number = IVSHMEM_MAGIC;
- rte_snprintf(ivshmem_config->metadata->name,
+ snprintf(ivshmem_config->metadata->name,
sizeof(ivshmem_config->metadata->name), "%s", name);
rte_spinlock_unlock(&global_cfg_sl);
rte_spinlock_lock(&config->sl);
/* prepare metadata file path */
- rte_snprintf(cfg_file_path, sizeof(cfg_file_path), IVSHMEM_CONFIG_FILE_FMT,
+ snprintf(cfg_file_path, sizeof(cfg_file_path), IVSHMEM_CONFIG_FILE_FMT,
config->metadata->name);
ms_cache = config->memseg_cache;
entry = &ms_cache[iter];
/* Offset and sizes within the current pathname */
- tmplen = rte_snprintf(cmdline_ptr, remaining_len, IVSHMEM_QEMU_CMD_FD_FMT,
+ tmplen = snprintf(cmdline_ptr, remaining_len, IVSHMEM_QEMU_CMD_FD_FMT,
entry->filepath, entry->offset, entry->len);
shared_mem_size += entry->len;
zero_size = total_size - shared_mem_size - METADATA_SIZE_ALIGNED;
/* add /dev/zero to command-line to fill the space */
- tmplen = rte_snprintf(cmdline_ptr, remaining_len, IVSHMEM_QEMU_CMD_FD_FMT,
+ tmplen = snprintf(cmdline_ptr, remaining_len, IVSHMEM_QEMU_CMD_FD_FMT,
"/dev/zero",
(uint64_t)0x0,
zero_size);
}
/* add metadata file to the end of command-line */
- tmplen = rte_snprintf(cmdline_ptr, remaining_len, IVSHMEM_QEMU_CMD_FD_FMT,
+ tmplen = snprintf(cmdline_ptr, remaining_len, IVSHMEM_QEMU_CMD_FD_FMT,
cfg_file_path,
(uint64_t)0x0,
METADATA_SIZE_ALIGNED);
return -1;
}
/* complete the command-line */
- rte_snprintf(buffer, size,
+ snprintf(buffer, size,
IVSHMEM_QEMU_CMD_LINE_HEADER_FMT,
total_size >> 20,
cmdline);
memset(&conf, 0, sizeof(conf));
rte_eth_dev_info_get(port_id, &info);
- rte_snprintf(conf.name, sizeof(conf.name), "vEth%u", port_id);
+ snprintf(conf.name, sizeof(conf.name), "vEth%u", port_id);
conf.addr = info.pci_dev->addr;
conf.id = info.pci_dev->id;
conf.group_id = (uint16_t)port_id;
}
}
- rte_snprintf(intf_name, RTE_KNI_NAMESIZE, "%s", conf->name);
- rte_snprintf(mz_name, RTE_MEMZONE_NAMESIZE, "KNI_INFO_%s", intf_name);
+ snprintf(intf_name, RTE_KNI_NAMESIZE, "%s", conf->name);
+ snprintf(mz_name, RTE_MEMZONE_NAMESIZE, "KNI_INFO_%s", intf_name);
mz = kni_memzone_reserve(mz_name, sizeof(struct rte_kni),
SOCKET_ID_ANY, 0);
KNI_MZ_CHECK(mz == NULL);
dev_info.group_id = conf->group_id;
dev_info.mbuf_size = conf->mbuf_size;
- rte_snprintf(ctx->name, RTE_KNI_NAMESIZE, "%s", intf_name);
- rte_snprintf(dev_info.name, RTE_KNI_NAMESIZE, "%s", intf_name);
+ snprintf(ctx->name, RTE_KNI_NAMESIZE, "%s", intf_name);
+ snprintf(dev_info.name, RTE_KNI_NAMESIZE, "%s", intf_name);
RTE_LOG(INFO, KNI, "pci: %02x:%02x:%02x \t %02x:%02x\n",
dev_info.bus, dev_info.devid, dev_info.function,
dev_info.vendor_id, dev_info.device_id);
/* TX RING */
- rte_snprintf(obj_name, OBJNAMSIZ, "kni_tx_%s", intf_name);
+ snprintf(obj_name, OBJNAMSIZ, "kni_tx_%s", intf_name);
mz = kni_memzone_reserve(obj_name, KNI_FIFO_SIZE, SOCKET_ID_ANY, 0);
KNI_MZ_CHECK(mz == NULL);
ctx->tx_q = mz->addr;
dev_info.tx_phys = mz->phys_addr;
/* RX RING */
- rte_snprintf(obj_name, OBJNAMSIZ, "kni_rx_%s", intf_name);
+ snprintf(obj_name, OBJNAMSIZ, "kni_rx_%s", intf_name);
mz = kni_memzone_reserve(obj_name, KNI_FIFO_SIZE, SOCKET_ID_ANY, 0);
KNI_MZ_CHECK(mz == NULL);
ctx->rx_q = mz->addr;
dev_info.rx_phys = mz->phys_addr;
/* ALLOC RING */
- rte_snprintf(obj_name, OBJNAMSIZ, "kni_alloc_%s", intf_name);
+ snprintf(obj_name, OBJNAMSIZ, "kni_alloc_%s", intf_name);
mz = kni_memzone_reserve(obj_name, KNI_FIFO_SIZE, SOCKET_ID_ANY, 0);
KNI_MZ_CHECK(mz == NULL);
ctx->alloc_q = mz->addr;
dev_info.alloc_phys = mz->phys_addr;
/* FREE RING */
- rte_snprintf(obj_name, OBJNAMSIZ, "kni_free_%s", intf_name);
+ snprintf(obj_name, OBJNAMSIZ, "kni_free_%s", intf_name);
mz = kni_memzone_reserve(obj_name, KNI_FIFO_SIZE, SOCKET_ID_ANY, 0);
KNI_MZ_CHECK(mz == NULL);
ctx->free_q = mz->addr;
dev_info.free_phys = mz->phys_addr;
/* Request RING */
- rte_snprintf(obj_name, OBJNAMSIZ, "kni_req_%s", intf_name);
+ snprintf(obj_name, OBJNAMSIZ, "kni_req_%s", intf_name);
mz = kni_memzone_reserve(obj_name, KNI_FIFO_SIZE, SOCKET_ID_ANY, 0);
KNI_MZ_CHECK(mz == NULL);
ctx->req_q = mz->addr;
dev_info.req_phys = mz->phys_addr;
/* Response RING */
- rte_snprintf(obj_name, OBJNAMSIZ, "kni_resp_%s", intf_name);
+ snprintf(obj_name, OBJNAMSIZ, "kni_resp_%s", intf_name);
mz = kni_memzone_reserve(obj_name, KNI_FIFO_SIZE, SOCKET_ID_ANY, 0);
KNI_MZ_CHECK(mz == NULL);
ctx->resp_q = mz->addr;
dev_info.resp_phys = mz->phys_addr;
/* Req/Resp sync mem area */
- rte_snprintf(obj_name, OBJNAMSIZ, "kni_sync_%s", intf_name);
+ snprintf(obj_name, OBJNAMSIZ, "kni_sync_%s", intf_name);
mz = kni_memzone_reserve(obj_name, KNI_FIFO_SIZE, SOCKET_ID_ANY, 0);
KNI_MZ_CHECK(mz == NULL);
ctx->sync_addr = mz->addr;
dev_info.sync_phys = mz->phys_addr;
/* MBUF mempool */
- rte_snprintf(mz_name, sizeof(mz_name), RTE_MEMPOOL_OBJ_NAME,
+ snprintf(mz_name, sizeof(mz_name), RTE_MEMPOOL_OBJ_NAME,
pktmbuf_pool->name);
mz = rte_memzone_lookup(mz_name);
KNI_MZ_CHECK(mz == NULL);
if (!kni || !kni->in_use)
return -1;
- rte_snprintf(dev_info.name, sizeof(dev_info.name), "%s", kni->name);
+ snprintf(dev_info.name, sizeof(dev_info.name), "%s", kni->name);
if (ioctl(kni_fd, RTE_KNI_IOCTL_RELEASE, &dev_info) < 0) {
RTE_LOG(ERR, KNI, "Fail to release kni device\n");
return -1;
if (!name || !name[0])
return NULL;
- rte_snprintf(mz_name, RTE_MEMZONE_NAMESIZE, "KNI_INFO_%s", name);
+ snprintf(mz_name, RTE_MEMZONE_NAMESIZE, "KNI_INFO_%s", name);
mz = rte_memzone_lookup(mz_name);
if (!mz)
return NULL;
if (port_id >= RTE_MAX_ETHPORTS)
return NULL;
- rte_snprintf(name, RTE_MEMZONE_NAMESIZE, "vEth%u", port_id);
+ snprintf(name, RTE_MEMZONE_NAMESIZE, "vEth%u", port_id);
return rte_kni_get(name);
}
return NULL;
}
- rte_snprintf(mem_name, sizeof(mem_name), "LPM_%s", name);
+ snprintf(mem_name, sizeof(mem_name), "LPM_%s", name);
/* Determine the amount of memory to allocate. */
mem_size = sizeof(*lpm) + (sizeof(lpm->rules_tbl[0]) * max_rules);
/* Save user arguments. */
lpm->max_rules = max_rules;
- rte_snprintf(lpm->name, sizeof(lpm->name), "%s", name);
+ snprintf(lpm->name, sizeof(lpm->name), "%s", name);
TAILQ_INSERT_TAIL(lpm_list, lpm, next);
return NULL;
}
- rte_snprintf(mem_name, sizeof(mem_name), "LPM_%s", name);
+ snprintf(mem_name, sizeof(mem_name), "LPM_%s", name);
/* Determine the amount of memory to allocate. */
mem_size = sizeof(*lpm) + (sizeof(lpm->tbl8[0]) *
/* Save user arguments. */
lpm->max_rules = config->max_rules;
lpm->number_tbl8s = config->number_tbl8s;
- rte_snprintf(lpm->name, sizeof(lpm->name), "%s", name);
+ snprintf(lpm->name, sizeof(lpm->name), "%s", name);
TAILQ_INSERT_TAIL(lpm_list, lpm, next);
mz_size = block_size;
char mz_name[RTE_MEMZONE_NAMESIZE];
- rte_snprintf(mz_name, sizeof(mz_name), "MALLOC_S%u_HEAP_%u",
+ snprintf(mz_name, sizeof(mz_name), "MALLOC_S%u_HEAP_%u",
numa_socket, heap->mz_count++);
/* try getting a block. if we fail and we don't need as big a block
if (pa == NULL)
return mp;
- rte_snprintf(mz_name, sizeof(mz_name), RTE_MEMPOOL_OBJ_NAME, name);
+ snprintf(mz_name, sizeof(mz_name), RTE_MEMPOOL_OBJ_NAME, name);
mz = rte_memzone_reserve(mz_name, sz, socket_id, mz_flags);
if (mz == NULL) {
free(pa);
/* Ring functions will return appropriate errors if we are
* running as a secondary process etc., so no checks made
* in this function for that condition */
- rte_snprintf(rg_name, sizeof(rg_name), RTE_MEMPOOL_MZ_FORMAT, name);
+ snprintf(rg_name, sizeof(rg_name), RTE_MEMPOOL_MZ_FORMAT, name);
r = rte_ring_create(rg_name, rte_align32pow2(n+1), socket_id, rg_flags);
if (r == NULL)
goto exit;
mempool_size += page_size;
}
- rte_snprintf(mz_name, sizeof(mz_name), RTE_MEMPOOL_MZ_FORMAT, name);
+ snprintf(mz_name, sizeof(mz_name), RTE_MEMPOOL_MZ_FORMAT, name);
mz = rte_memzone_reserve(mz_name, mempool_size, socket_id, mz_flags);
/* init the mempool structure */
mp = startaddr;
memset(mp, 0, sizeof(*mp));
- rte_snprintf(mp->name, sizeof(mp->name), "%s", name);
+ snprintf(mp->name, sizeof(mp->name), "%s", name);
mp->phys_addr = mz->phys_addr;
mp->ring = r;
mp->size = n;
}
/* Save input parameters */
- rte_snprintf(p->name, RTE_PIPELINE_MAX_NAME_SZ, "%s", params->name);
+ snprintf(p->name, RTE_PIPELINE_MAX_NAME_SZ, "%s", params->name);
p->socket_id = params->socket_id;
p->offset_port_id = params->offset_port_id;
const struct rte_memzone *mz;
char z_name[RTE_MEMZONE_NAMESIZE];
- rte_snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
+ snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
dev->driver->pci_drv.name, ring_name, dev->data->port_id,
queue_id);
char z_name[RTE_MEMZONE_NAMESIZE];
const struct rte_memzone *mz;
- rte_snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
+ snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
dev->driver->pci_drv.name, ring_name,
dev->data->port_id, queue_id);
mz = rte_memzone_lookup(z_name);
return I40E_ERR_PARAM;
id++;
- rte_snprintf(z_name, sizeof(z_name), "i40e_dma_%"PRIu64, id);
+ snprintf(z_name, sizeof(z_name), "i40e_dma_%"PRIu64, id);
mz = rte_memzone_reserve_aligned(z_name, size, 0, 0, alignment);
if (!mz)
return I40E_ERR_NO_MEMORY;
char z_name[RTE_MEMZONE_NAMESIZE];
const struct rte_memzone *mz;
- rte_snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
+ snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
dev->driver->pci_drv.name, ring_name,
dev->data->port_id, queue_id);
mz = rte_memzone_lookup(z_name);
char z_name[RTE_MEMZONE_NAMESIZE];
const struct rte_memzone *mz;
- rte_snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
+ snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
dev->driver->pci_drv.name, ring_name,
dev->data->port_id, queue_id);
RTE_PMD_RING_MAX_TX_RINGS);
for (i = 0; i < num_rings; i++) {
- rte_snprintf(rng_name, sizeof(rng_name), "ETH_RXTX%u_%s", i, name);
+ snprintf(rng_name, sizeof(rng_name), "ETH_RXTX%u_%s", i, name);
rxtx[i] = (action == DEV_CREATE) ?
rte_ring_create(rng_name, 1024, numa_node,
RING_F_SP_ENQ|RING_F_SC_DEQ) :
RTE_PMD_RING_MAX_TX_RINGS);
for (i = 0; i < num_rings; i++) {
- rte_snprintf(rng_name, sizeof(rng_name), "ETH_RX%u_%s", i, name);
+ snprintf(rng_name, sizeof(rng_name), "ETH_RX%u_%s", i, name);
rx[i] = (action == DEV_CREATE) ?
rte_ring_create(rng_name, 1024, numa_node,
RING_F_SP_ENQ|RING_F_SC_DEQ) :
rte_ring_lookup(rng_name);
if (rx[i] == NULL)
return -1;
- rte_snprintf(rng_name, sizeof(rng_name), "ETH_TX%u_%s", i, name);
+ snprintf(rng_name, sizeof(rng_name), "ETH_TX%u_%s", i, name);
tx[i] = (action == DEV_CREATE) ?
rte_ring_create(rng_name, 1024, numa_node,
RING_F_SP_ENQ|RING_F_SC_DEQ):
goto out;
}
- rte_snprintf(info->list[info->count].name, sizeof(info->list[info->count].name), "%s", name);
+ snprintf(info->list[info->count].name, sizeof(info->list[info->count].name), "%s", name);
info->count++;
}
if (queue_type == VTNET_RQ) {
- rte_snprintf(vq_name, sizeof(vq_name), "port%d_rvq%d",
+ snprintf(vq_name, sizeof(vq_name), "port%d_rvq%d",
dev->data->port_id, queue_idx);
vq = rte_zmalloc(vq_name, sizeof(struct virtqueue) +
vq_size * sizeof(struct vq_desc_extra), CACHE_LINE_SIZE);
memcpy(vq->vq_name, vq_name, sizeof(vq->vq_name));
} else if (queue_type == VTNET_TQ) {
- rte_snprintf(vq_name, sizeof(vq_name), "port%d_tvq%d",
+ snprintf(vq_name, sizeof(vq_name), "port%d_tvq%d",
dev->data->port_id, queue_idx);
vq = rte_zmalloc(vq_name, sizeof(struct virtqueue) +
vq_size * sizeof(struct vq_desc_extra), CACHE_LINE_SIZE);
memcpy(vq->vq_name, vq_name, sizeof(vq->vq_name));
} else if (queue_type == VTNET_CQ) {
- rte_snprintf(vq_name, sizeof(vq_name), "port%d_cvq",
+ snprintf(vq_name, sizeof(vq_name), "port%d_cvq",
dev->data->port_id);
vq = rte_zmalloc(vq_name, sizeof(struct virtqueue) +
vq_size * sizeof(struct vq_desc_extra),
/*
* For each xmit packet, allocate a virtio_net_hdr
*/
- rte_snprintf(vq_name, sizeof(vq_name), "port%d_tvq%d_hdrzone",
+ snprintf(vq_name, sizeof(vq_name), "port%d_tvq%d_hdrzone",
dev->data->port_id, queue_idx);
vq->virtio_net_hdr_mz = rte_memzone_reserve_aligned(vq_name,
vq_size * sizeof(struct virtio_net_hdr),
vq_size * sizeof(struct virtio_net_hdr));
} else if (queue_type == VTNET_CQ) {
/* Allocate a page for control vq command, data and status */
- rte_snprintf(vq_name, sizeof(vq_name), "port%d_cvq_hdrzone",
+ snprintf(vq_name, sizeof(vq_name), "port%d_cvq_hdrzone",
dev->data->port_id);
vq->virtio_net_hdr_mz = rte_memzone_reserve_aligned(vq_name,
PAGE_SIZE, socket_id, 0, CACHE_LINE_SIZE);
/* depending on kernel version, uio can be located in uio/uioX
* or uio:uioX */
- rte_snprintf(dirname, sizeof(dirname),
+ snprintf(dirname, sizeof(dirname),
SYSFS_PCI_DEVICES "/" PCI_PRI_FMT "/uio",
loc->domain, loc->bus, loc->devid, loc->function);
dir = opendir(dirname);
if (dir == NULL) {
/* retry with the parent directory */
- rte_snprintf(dirname, sizeof(dirname),
+ snprintf(dirname, sizeof(dirname),
SYSFS_PCI_DEVICES "/" PCI_PRI_FMT,
loc->domain, loc->bus, loc->devid, loc->function);
dir = opendir(dirname);
errno = 0;
uio_num = strtoull(e->d_name + shortprefix_len, &endptr, 10);
if (errno == 0 && endptr != (e->d_name + shortprefix_len)) {
- rte_snprintf(buf, buflen, "%s/uio%u", dirname, uio_num);
+ snprintf(buf, buflen, "%s/uio%u", dirname, uio_num);
break;
}
errno = 0;
uio_num = strtoull(e->d_name + longprefix_len, &endptr, 10);
if (errno == 0 && endptr != (e->d_name + longprefix_len)) {
- rte_snprintf(buf, buflen, "%s/uio:uio%u", dirname,
+ snprintf(buf, buflen, "%s/uio:uio%u", dirname,
uio_num);
break;
}
return -1;
/* get portio size */
- rte_snprintf(filename, sizeof(filename),
+ snprintf(filename, sizeof(filename),
"%s/portio/port0/size", dirname);
if (parse_sysfs_value(filename, &size) < 0) {
PMD_INIT_LOG(ERR, "%s(): cannot parse size\n",
}
/* get portio start */
- rte_snprintf(filename, sizeof(filename),
+ snprintf(filename, sizeof(filename),
"%s/portio/port0/start", dirname);
if (parse_sysfs_value(filename, &start) < 0) {
PMD_INIT_LOG(ERR, "%s(): cannot parse portio start\n",
*/
virtqueue_disable_intr(vq);
- rte_snprintf(vq_name, sizeof(vq_name), "port_%d_rx_vq",
+ snprintf(vq_name, sizeof(vq_name), "port_%d_rx_vq",
dev->data->port_id);
PMD_INIT_LOG(DEBUG, "vq name: %s\n", vq->vq_name);
char z_name[RTE_MEMZONE_NAMESIZE];
const struct rte_memzone *mz;
- rte_snprintf(z_name, sizeof(z_name), "%s_%d_%s",
+ snprintf(z_name, sizeof(z_name), "%s_%d_%s",
dev->driver->pci_drv.name, dev->data->port_id, post_string);
mz = rte_memzone_lookup(z_name);
char z_name[RTE_MEMZONE_NAMESIZE];
const struct rte_memzone *mz;
- rte_snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
+ snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
dev->driver->pci_drv.name, ring_name,
dev->data->port_id, queue_id);
ring = &rxq->cmd_ring[i];
ring->rid = i;
- rte_snprintf(mem_name, sizeof(mem_name), "rx_ring_%d_buf_info", i);
+ snprintf(mem_name, sizeof(mem_name), "rx_ring_%d_buf_info", i);
ring->buf_info = rte_zmalloc(mem_name, ring->size * sizeof(vmxnet3_buf_info_t), CACHE_LINE_SIZE);
if (ring->buf_info == NULL) {
}
*(uint8_t *)ptr = MAP_FLAG;
- rte_snprintf(val_str, sizeof(val_str), "%u", gref_tmp);
- rte_snprintf(key_str, sizeof(key_str),
+ snprintf(val_str, sizeof(val_str), "%u", gref_tmp);
+ snprintf(key_str, sizeof(key_str),
DPDK_XENSTORE_PATH"%d"VRING_FLAG_STR, vtidx);
xenstore_write(key_str, val_str);
}
RTE_LOG(INFO, PMD, "%s: virtio %d is started\n", __func__, vtidx);
gntalloc_vring_flag(vtidx);
- rte_snprintf(key_str, sizeof(key_str), "%s%s%d",
+ snprintf(key_str, sizeof(key_str), "%s%s%d",
DPDK_XENSTORE_PATH, EVENT_TYPE_START_STR,
vtidx);
- rte_snprintf(val_str, sizeof(val_str), "1");
+ snprintf(val_str, sizeof(val_str), "1");
xenstore_write(key_str, val_str);
}
RTE_LOG(ERR, PMD, "%s: NULL pointer mac specified\n", __func__);
return -1;
}
- rv = rte_snprintf(key_str, sizeof(key_str),
+ rv = snprintf(key_str, sizeof(key_str),
DPDK_XENSTORE_PATH"%d_ether_addr", vtidx);
if (rv == -1)
return rv;
- rv = rte_snprintf(val_str, sizeof(val_str), "%02x:%02x:%02x:%02x:%02x:%02x",
+ rv = snprintf(val_str, sizeof(val_str), "%02x:%02x:%02x:%02x:%02x:%02x",
mac_addrs->addr_bytes[0],
mac_addrs->addr_bytes[1],
mac_addrs->addr_bytes[2],
}
if (queue_type == VTNET_RQ)
- rv = rte_snprintf(key_str, sizeof(key_str), DPDK_XENSTORE_PATH"%d"RXVRING_XENSTORE_STR, vtidx);
+ rv = snprintf(key_str, sizeof(key_str), DPDK_XENSTORE_PATH"%d"RXVRING_XENSTORE_STR, vtidx);
else
- rv = rte_snprintf(key_str, sizeof(key_str), DPDK_XENSTORE_PATH"%d"TXVRING_XENSTORE_STR, vtidx);
+ rv = snprintf(key_str, sizeof(key_str), DPDK_XENSTORE_PATH"%d"TXVRING_XENSTORE_STR, vtidx);
if (rv == -1 || xenstore_write(key_str, val_str) == -1) {
gntfree(va, size, start_index);
va = NULL;
/* Allocate memory for virtqueue. */
if (queue_type == VTNET_RQ) {
- rte_snprintf(vq_name, sizeof(vq_name), "port%d_rvq",
+ snprintf(vq_name, sizeof(vq_name), "port%d_rvq",
dev->data->port_id);
vq = rte_zmalloc(vq_name, sizeof(struct virtqueue) +
vq_size * sizeof(struct vq_desc_extra), CACHE_LINE_SIZE);
}
memcpy(vq->vq_name, vq_name, sizeof(vq->vq_name));
} else if(queue_type == VTNET_TQ) {
- rte_snprintf(vq_name, sizeof(vq_name), "port%d_tvq",
+ snprintf(vq_name, sizeof(vq_name), "port%d_tvq",
dev->data->port_id);
vq = rte_zmalloc(vq_name, sizeof(struct virtqueue) +
vq_size * sizeof(struct vq_desc_extra), CACHE_LINE_SIZE);
{
char store_path[PATH_MAX] = {0};
- if (rte_snprintf(store_path, sizeof(store_path),
+ if (snprintf(store_path, sizeof(store_path),
"%s%s", dompath, DPDK_XENSTORE_NODE) == -1)
return -1;
RTE_LOG(ERR, PMD, "%s: xenstore init failed\n", __func__);
return -1;
}
- rv = rte_snprintf(grant_path, sizeof(grant_path), "%s%s", dompath, key_str);
+ rv = snprintf(grant_path, sizeof(grant_path), "%s%s", dompath, key_str);
if (rv == -1) {
- RTE_LOG(ERR, PMD, "%s: rte_snprintf %s %s failed\n",
+ RTE_LOG(ERR, PMD, "%s: snprintf %s %s failed\n",
__func__, dompath, key_str);
return -1;
}
while (j < pg_num) {
if (first) {
- rv = rte_snprintf(val_str, str_size, "%u", gref_tmp[k]);
+ rv = snprintf(val_str, str_size, "%u", gref_tmp[k]);
first = 0;
} else {
- rte_snprintf(tmp_str, PATH_MAX, "%s", val_str);
- rv = rte_snprintf(val_str, str_size, "%s,%u", tmp_str, gref_tmp[k]);
+ snprintf(tmp_str, PATH_MAX, "%s", val_str);
+ rv = snprintf(val_str, str_size, "%s,%u", tmp_str, gref_tmp[k]);
}
k++;
if (rv == -1)
char key_str[PATH_MAX] = {0};
char val_str[PATH_MAX] = {0};
- rte_snprintf(val_str, sizeof(val_str), "");
+ snprintf(val_str, sizeof(val_str), "");
if (grant_node_create(pg_num, gref_arr, pa_arr, val_str, sizeof(val_str))) {
return -1;
}
- if (rte_snprintf(key_str, sizeof(key_str),
+ if (snprintf(key_str, sizeof(key_str),
DPDK_XENSTORE_PATH"%d"MEMPOOL_XENSTORE_STR, mempool_idx) == -1)
return -1;
if (xenstore_write(key_str, val_str) == -1)
return -1;
- if (rte_snprintf(key_str, sizeof(key_str),
+ if (snprintf(key_str, sizeof(key_str),
DPDK_XENSTORE_PATH"%d"MEMPOOL_VA_XENSTORE_STR, mempool_idx) == -1)
return -1;
- if (rte_snprintf(val_str, sizeof(val_str), "%p", (uintptr_t)mpool->elt_va_start) == -1)
+ if (snprintf(val_str, sizeof(val_str), "%p", (uintptr_t)mpool->elt_va_start) == -1)
return -1;
if (xenstore_write(key_str, val_str) == -1)
return -1;
char *s;
int val;
- rte_snprintf(fullpath, sizeof(fullpath), POWER_SYSFILE_GOVERNOR,
+ snprintf(fullpath, sizeof(fullpath), POWER_SYSFILE_GOVERNOR,
pi->lcore_id);
f = fopen(fullpath, "rw+");
FOPEN_OR_ERR_RET(f, ret);
goto out;
}
/* Save the original governor */
- rte_snprintf(pi->governor_ori, sizeof(pi->governor_ori), "%s", buf);
+ snprintf(pi->governor_ori, sizeof(pi->governor_ori), "%s", buf);
/* Write 'userspace' to the governor */
val = fseek(f, 0, SEEK_SET);
char *freqs[RTE_MAX_LCORE_FREQS];
char *s;
- rte_snprintf(fullpath, sizeof(fullpath), POWER_SYSFILE_AVAIL_FREQ,
+ snprintf(fullpath, sizeof(fullpath), POWER_SYSFILE_AVAIL_FREQ,
pi->lcore_id);
f = fopen(fullpath, "r");
FOPEN_OR_ERR_RET(f, ret);
uint32_t i, freq;
char *s;
- rte_snprintf(fullpath, sizeof(fullpath), POWER_SYSFILE_SETSPEED,
+ snprintf(fullpath, sizeof(fullpath), POWER_SYSFILE_SETSPEED,
pi->lcore_id);
f = fopen(fullpath, "rw+");
FOPEN_OR_ERR_RET(f, -1);
char *s;
int val;
- rte_snprintf(fullpath, sizeof(fullpath), POWER_SYSFILE_GOVERNOR,
+ snprintf(fullpath, sizeof(fullpath), POWER_SYSFILE_GOVERNOR,
pi->lcore_id);
f = fopen(fullpath, "rw+");
FOPEN_OR_ERR_RET(f, ret);
/* init the ring structure */
memset(r, 0, sizeof(*r));
- rte_snprintf(r->name, sizeof(r->name), "%s", name);
+ snprintf(r->name, sizeof(r->name), "%s", name);
r->flags = flags;
r->prod.watermark = count;
r->prod.sp_enqueue = !!(flags & RING_F_SP_ENQ);
return NULL;
}
- rte_snprintf(mz_name, sizeof(mz_name), "%s%s", RTE_RING_MZ_PREFIX, name);
+ snprintf(mz_name, sizeof(mz_name), "%s%s", RTE_RING_MZ_PREFIX, name);
rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
&acl->memory[action_table_size + acl_rule_list_size];
/* Initialization of internal fields */
- rte_snprintf(acl->name[0], RTE_ACL_NAMESIZE, "%s_a", p->name);
- rte_snprintf(acl->name[1], RTE_ACL_NAMESIZE, "%s_b", p->name);
+ snprintf(acl->name[0], RTE_ACL_NAMESIZE, "%s_a", p->name);
+ snprintf(acl->name[1], RTE_ACL_NAMESIZE, "%s_b", p->name);
acl->name_id = 1;
acl->acl_params.name = acl->name[acl->name_id];