summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2014-06-24 11:15:28 -0700
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-06-27 02:31:24 +0200
commit6f41fe75e2dd8dd38f7bea7b9501edd4f9b72fa5 (patch)
tree38546261dbaf75edcf31bc3ccdad61f84f666590 /examples
parente8ed6c78177fbbafa326d9efc590a51705848200 (diff)
downloaddpdk-6f41fe75e2dd8dd38f7bea7b9501edd4f9b72fa5.zip
dpdk-6f41fe75e2dd8dd38f7bea7b9501edd4f9b72fa5.tar.gz
dpdk-6f41fe75e2dd8dd38f7bea7b9501edd4f9b72fa5.tar.xz
eal: deprecate rte_snprintf
The function rte_snprintf serves no useful purpose. It is the same as snprintf() for all valid inputs. Deprecate it and replace all uses in current code. Leave the tests for the deprecated function in place. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/cmdline/commands.c10
-rw-r--r--examples/cmdline/parse_obj_list.c4
-rw-r--r--examples/dpdk_qat/crypto.c2
-rw-r--r--examples/dpdk_qat/main.c4
-rw-r--r--examples/exception_path/main.c8
-rw-r--r--examples/ip_fragmentation/main.c8
-rw-r--r--examples/ip_pipeline/config.c2
-rw-r--r--examples/ip_pipeline/init.c2
-rw-r--r--examples/ip_reassembly/main.c6
-rw-r--r--examples/kni/main.c6
-rw-r--r--examples/l2fwd-ivshmem/host/host.c6
-rw-r--r--examples/l3fwd-acl/main.c6
-rw-r--r--examples/l3fwd-power/main.c10
-rw-r--r--examples/l3fwd-vf/main.c8
-rwxr-xr-xexamples/l3fwd/main.c12
-rw-r--r--examples/load_balancer/config.c2
-rw-r--r--examples/load_balancer/init.c8
-rw-r--r--examples/multi_process/client_server_mp/mp_server/main.c2
-rw-r--r--examples/multi_process/client_server_mp/shared/common.h2
-rw-r--r--examples/multi_process/simple_mp/mp_commands.c2
-rw-r--r--examples/multi_process/symmetric_mp/main.c4
-rw-r--r--examples/netmap_compat/bridge/bridge.c4
-rw-r--r--examples/netmap_compat/lib/compat_netmap.c2
-rwxr-xr-xexamples/qos_sched/args.c2
-rwxr-xr-xexamples/qos_sched/cfg_file.c22
-rwxr-xr-xexamples/qos_sched/init.c8
-rw-r--r--examples/quota_watermark/qw/init.c2
-rw-r--r--examples/vhost/main.c20
-rw-r--r--examples/vhost/vhost-net-cdev.c8
-rw-r--r--examples/vhost/virtio-net.c6
-rw-r--r--examples/vhost_xen/main.c10
-rw-r--r--examples/vhost_xen/vhost_monitor.c4
-rw-r--r--examples/vhost_xen/xenstore_parse.c12
33 files changed, 107 insertions, 107 deletions
diff --git a/examples/cmdline/commands.c b/examples/cmdline/commands.c
index fe82be5..8c6c11b 100644
--- a/examples/cmdline/commands.c
+++ b/examples/cmdline/commands.c
@@ -134,10 +134,10 @@ static void cmd_obj_del_show_parsed(void *parsed_result,
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) {
@@ -199,15 +199,15 @@ static void cmd_obj_add_parsed(void *parsed_result,
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",
diff --git a/examples/cmdline/parse_obj_list.c b/examples/cmdline/parse_obj_list.c
index 45a26ef..2625ca3 100644
--- a/examples/cmdline/parse_obj_list.c
+++ b/examples/cmdline/parse_obj_list.c
@@ -148,7 +148,7 @@ int complete_get_elt_obj_list(cmdline_parse_token_hdr_t *tk,
return -1;
if (dstbuf)
- rte_snprintf(dstbuf, size, "%s", o->name);
+ snprintf(dstbuf, size, "%s", o->name);
return 0;
}
@@ -157,6 +157,6 @@ int complete_get_elt_obj_list(cmdline_parse_token_hdr_t *tk,
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;
}
diff --git a/examples/dpdk_qat/crypto.c b/examples/dpdk_qat/crypto.c
index 2f8ba3d..577ab32 100644
--- a/examples/dpdk_qat/crypto.c
+++ b/examples/dpdk_qat/crypto.c
@@ -665,7 +665,7 @@ per_core_crypto_init(uint32_t lcore_id)
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);
diff --git a/examples/dpdk_qat/main.c b/examples/dpdk_qat/main.c
index 71c0396..d61db4c 100644
--- a/examples/dpdk_qat/main.c
+++ b/examples/dpdk_qat/main.c
@@ -543,7 +543,7 @@ parse_config(const char *q_arg)
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++) {
@@ -654,7 +654,7 @@ init_mem(void)
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),
diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c
index 3ece2ac..0204116 100644
--- a/examples/exception_path/main.c
+++ b/examples/exception_path/main.c
@@ -229,7 +229,7 @@ static int tap_create(char *name)
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) {
@@ -238,7 +238,7 @@ static int tap_create(char *name)
}
if (name)
- rte_snprintf(name, IFNAMSIZ, "%s", ifr.ifr_name);
+ snprintf(name, IFNAMSIZ, "%s", ifr.ifr_name);
return fd;
}
@@ -253,7 +253,7 @@ main_loop(__attribute__((unused)) void *arg)
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)",
@@ -286,7 +286,7 @@ main_loop(__attribute__((unused)) void *arg)
}
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)",
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 3172ad5..72cd2b2 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -786,7 +786,7 @@ init_mem(void)
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,
@@ -804,7 +804,7 @@ init_mem(void)
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,
@@ -821,7 +821,7 @@ init_mem(void)
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) {
@@ -833,7 +833,7 @@ init_mem(void)
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) {
diff --git a/examples/ip_pipeline/config.c b/examples/ip_pipeline/config.c
index 86be3a8..2af0b00 100644
--- a/examples/ip_pipeline/config.c
+++ b/examples/ip_pipeline/config.c
@@ -239,7 +239,7 @@ app_install_cfgfile(const char *file_name)
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);
diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
index 947e152..d00027f 100644
--- a/examples/ip_pipeline/init.c
+++ b/examples/ip_pipeline/init.c
@@ -427,7 +427,7 @@ app_init_rings(void)
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,
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 1b60e41..3bb6afd 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -954,7 +954,7 @@ setup_queue_tbl(struct rx_queue *rxq, uint32_t lcore, uint32_t queue)
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),
@@ -990,7 +990,7 @@ init_mem(void)
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) {
@@ -1002,7 +1002,7 @@ init_mem(void)
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) {
diff --git a/examples/kni/main.c b/examples/kni/main.c
index bc1f961..7df1b36 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -465,7 +465,7 @@ parse_config(const char *arg)
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");
@@ -793,12 +793,12 @@ kni_alloc(uint8_t port_id)
/* 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;
diff --git a/examples/l2fwd-ivshmem/host/host.c b/examples/l2fwd-ivshmem/host/host.c
index 712f1ea..02e65b9 100644
--- a/examples/l2fwd-ivshmem/host/host.c
+++ b/examples/l2fwd-ivshmem/host/host.c
@@ -217,7 +217,7 @@ print_to_file(const char *cmdline, const char *config_name)
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);
@@ -871,7 +871,7 @@ int main(int argc, char **argv)
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)
@@ -880,7 +880,7 @@ int main(int argc, char **argv)
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)
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 5d1053f..9b2c21b 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -1204,7 +1204,7 @@ setup_acl(struct rte_acl_rule *route_base,
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);
@@ -1709,7 +1709,7 @@ parse_config(const char *q_arg)
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;
@@ -1894,7 +1894,7 @@ init_mem(unsigned nb_mbuf)
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,
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index ae9d3e5..57fc371 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -1149,7 +1149,7 @@ parse_config(const char *q_arg)
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;
@@ -1315,7 +1315,7 @@ setup_hash(int socketid)
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] =
@@ -1325,7 +1325,7 @@ setup_hash(int 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] =
@@ -1372,7 +1372,7 @@ setup_lpm(int 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)
@@ -1423,7 +1423,7 @@ init_mem(unsigned nb_mbuf)
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,
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index c199f0c..2ca5c21 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -763,7 +763,7 @@ parse_config(const char *q_arg)
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++){
@@ -868,7 +868,7 @@ setup_hash(int socketid)
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);
@@ -900,7 +900,7 @@ setup_lpm(int socketid)
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)
@@ -950,7 +950,7 @@ init_mem(unsigned nb_mbuf)
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,
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index e1754a9..73a039e 100755
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -1657,7 +1657,7 @@ parse_config(const char *q_arg)
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++){
@@ -1998,7 +1998,7 @@ setup_hash(int socketid)
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);
@@ -2007,7 +2007,7 @@ setup_hash(int 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] = rte_hash_create(&ipv6_l3fwd_hash_params);
@@ -2051,7 +2051,7 @@ setup_lpm(int 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)
@@ -2084,7 +2084,7 @@ setup_lpm(int socketid)
}
/* 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;
@@ -2144,7 +2144,7 @@ init_mem(unsigned nb_mbuf)
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),
diff --git a/examples/load_balancer/config.c b/examples/load_balancer/config.c
index 62990e4..6e2fad0 100644
--- a/examples/load_balancer/config.c
+++ b/examples/load_balancer/config.c
@@ -155,7 +155,7 @@ str_to_unsigned_array(
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;
diff --git a/examples/load_balancer/init.c b/examples/load_balancer/init.c
index 09ba3ff..2f00a70 100644
--- a/examples/load_balancer/init.c
+++ b/examples/load_balancer/init.c
@@ -146,7 +146,7 @@ app_init_mbuf_pools(void)
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,
@@ -187,7 +187,7 @@ app_init_lpm_tables(void)
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,
@@ -259,7 +259,7 @@ app_init_rings_rx(void)
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);
@@ -342,7 +342,7 @@ app_init_rings_tx(void)
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,
diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c
index 1eaf761..b3887b1 100644
--- a/examples/multi_process/client_server_mp/mp_server/main.c
+++ b/examples/multi_process/client_server_mp/mp_server/main.c
@@ -103,7 +103,7 @@ get_printable_mac_addr(uint8_t port)
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]);
diff --git a/examples/multi_process/client_server_mp/shared/common.h b/examples/multi_process/client_server_mp/shared/common.h
index 16efd2e..631c463 100644
--- a/examples/multi_process/client_server_mp/shared/common.h
+++ b/examples/multi_process/client_server_mp/shared/common.h
@@ -78,7 +78,7 @@ get_rx_queue_name(unsigned id)
* 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;
}
diff --git a/examples/multi_process/simple_mp/mp_commands.c b/examples/multi_process/simple_mp/mp_commands.c
index c64ebdd..bf882c9 100644
--- a/examples/multi_process/simple_mp/mp_commands.c
+++ b/examples/multi_process/simple_mp/mp_commands.c
@@ -79,7 +79,7 @@ static void cmd_send_parsed(void *parsed_result,
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);
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index d40223e..b8f31b3 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -347,10 +347,10 @@ lcore_main(void *arg __rte_unused)
/* 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);
diff --git a/examples/netmap_compat/bridge/bridge.c b/examples/netmap_compat/bridge/bridge.c
index d9c892c..898277e 100644
--- a/examples/netmap_compat/bridge/bridge.c
+++ b/examples/netmap_compat/bridge/bridge.c
@@ -234,7 +234,7 @@ netmap_port_open(uint32_t idx)
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;
@@ -244,7 +244,7 @@ netmap_port_open(uint32_t idx)
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;
diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c
index 190151e..44b3f8e 100644
--- a/examples/netmap_compat/lib/compat_netmap.c
+++ b/examples/netmap_compat/lib/compat_netmap.c
@@ -324,7 +324,7 @@ netmap_regif(struct nmreq *req, uint32_t idx, uint8_t port)
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 */
diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index 42ef5f9..ddf9ba4 100755
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -143,7 +143,7 @@ app_cpu_core_count(void)
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;
diff --git a/examples/qos_sched/cfg_file.c b/examples/qos_sched/cfg_file.c
index f726458..05a8caf 100755
--- a/examples/qos_sched/cfg_file.c
+++ b/examples/qos_sched/cfg_file.c
@@ -152,7 +152,7 @@ cfg_load(const char *filename, int flags)
goto error1;
}
- rte_snprintf(cfg->sections[curr_section]->name,
+ snprintf(cfg->sections[curr_section]->name,
sizeof(cfg->sections[0]->name),
"%s", &buffer[1]);
}
@@ -189,8 +189,8 @@ cfg_load(const char *filename, int flags)
}
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)));
}
@@ -249,7 +249,7 @@ cfg_sections(struct cfg_file *cfg, char *sections[], int max_sections)
{
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;
}
@@ -355,7 +355,7 @@ cfg_load_port(struct cfg_file *cfg, struct rte_sched_port_params *port_params)
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;
@@ -371,7 +371,7 @@ cfg_load_port(struct cfg_file *cfg, struct rte_sched_port_params *port_params)
}
/* 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;
@@ -387,7 +387,7 @@ cfg_load_port(struct cfg_file *cfg, struct rte_sched_port_params *port_params)
}
/* 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;
@@ -404,7 +404,7 @@ cfg_load_port(struct cfg_file *cfg, struct rte_sched_port_params *port_params)
}
/* 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;
@@ -440,7 +440,7 @@ cfg_load_pipe(struct cfg_file *cfg, struct rte_sched_pipe_params *pipe_params)
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)
@@ -533,7 +533,7 @@ cfg_load_subport(struct cfg_file *cfg, struct rte_sched_subport_params *subport_
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");
@@ -592,7 +592,7 @@ cfg_load_subport(struct cfg_file *cfg, struct rte_sched_subport_params *subport_
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;
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index cc4c2c9..cbfd63f 100755
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -248,7 +248,7 @@ app_init_sched_port(uint32_t portid, uint32_t socketid)
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);
@@ -319,7 +319,7 @@ int app_init(void)
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,
@@ -327,7 +327,7 @@ int app_init(void)
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,
@@ -337,7 +337,7 @@ int app_init(void)
/* 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),
diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c
index d163d7f..a7f8c85 100644
--- a/examples/quota_watermark/qw/init.c
+++ b/examples/quota_watermark/qw/init.c
@@ -152,7 +152,7 @@ void init_ring(int lcore_id, uint8_t port_id)
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);
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index e0fc2c9..193aa25 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -143,7 +143,7 @@
/* 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. */
@@ -498,7 +498,7 @@ us_vhost_parse_basename(const char *q_arg)
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;
}
@@ -837,14 +837,14 @@ static unsigned check_ports_num(unsigned nb_ports)
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)
@@ -2992,9 +2992,9 @@ MAIN(int argc, char *argv[])
+ 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);
@@ -3005,9 +3005,9 @@ MAIN(int argc, char *argv[])
+ 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),
diff --git a/examples/vhost/vhost-net-cdev.c b/examples/vhost/vhost-net-cdev.c
index ef42e88..8cf806a 100644
--- a/examples/vhost/vhost-net-cdev.c
+++ b/examples/vhost/vhost-net-cdev.c
@@ -325,11 +325,11 @@ register_cuse_device(const char *base_name, int index, struct vhost_net_device_o
* 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. */
diff --git a/examples/vhost/virtio-net.c b/examples/vhost/virtio-net.c
index 9be959f..801607a 100644
--- a/examples/vhost/virtio-net.c
+++ b/examples/vhost/virtio-net.c
@@ -136,9 +136,9 @@ host_memory_map (struct virtio_net *dev, struct virtio_memory *mem, pid_t pid, u
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) {
@@ -224,7 +224,7 @@ host_memory_map (struct virtio_net *dev, struct virtio_memory *mem, pid_t pid, u
/* 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);
diff --git a/examples/vhost_xen/main.c b/examples/vhost_xen/main.c
index 94c69ee..b275747 100644
--- a/examples/vhost_xen/main.c
+++ b/examples/vhost_xen/main.c
@@ -110,7 +110,7 @@
/* 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
@@ -538,14 +538,14 @@ static unsigned check_ports_num(unsigned nb_ports)
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)
diff --git a/examples/vhost_xen/vhost_monitor.c b/examples/vhost_xen/vhost_monitor.c
index b9c1cb5..6994c9c 100644
--- a/examples/vhost_xen/vhost_monitor.c
+++ b/examples/vhost_xen/vhost_monitor.c
@@ -434,8 +434,8 @@ static void virtio_init(void)
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);
diff --git a/examples/vhost_xen/xenstore_parse.c b/examples/vhost_xen/xenstore_parse.c
index b8acd3e..fdd69b2 100644
--- a/examples/vhost_xen/xenstore_parse.c
+++ b/examples/vhost_xen/xenstore_parse.c
@@ -400,7 +400,7 @@ parse_mpool_va(struct xen_mempool *mempool)
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);
@@ -484,7 +484,7 @@ parse_mempoolnode(struct xen_guest *guest)
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);
@@ -541,7 +541,7 @@ xen_map_vringflag(struct xen_vring *vring)
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);
@@ -669,7 +669,7 @@ xen_parse_etheraddr(struct xen_vring *vring)
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);
@@ -695,7 +695,7 @@ parse_vringnode(struct xen_guest *guest, uint32_t 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);
@@ -706,7 +706,7 @@ parse_vringnode(struct xen_guest *guest, uint32_t 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);