aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorAnders Roxell <anders.roxell@linaro.org>2014-09-02 20:38:00 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2014-09-02 22:56:11 +0400
commit8deea2005ad3f42eb5987171e0b3b1a428aac057 (patch)
tree43a49b97376396ff77ce13b486607c98ca4565cf /example
parent8e1bf298be449b8f91f25b96870732c433f4ddc0 (diff)
move helper functions and rename to prefix to odph_
Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Acked-by: Petri Savolainen <petri.savolainen@linaro.org> Reviewed-by: Stuart Haslam <stuart.haslam@arm.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'example')
-rw-r--r--example/Makefile.inc2
-rw-r--r--example/generator/odp_generator.c142
-rw-r--r--example/l2fwd/odp_l2fwd.c18
-rw-r--r--example/odp_example/odp_example.c10
-rw-r--r--example/packet/odp_pktio.c28
-rw-r--r--example/packet_netmap/odp_pktio_netmap.c32
-rw-r--r--example/timer/odp_timer_test.c10
7 files changed, 121 insertions, 121 deletions
diff --git a/example/Makefile.inc b/example/Makefile.inc
index b549001fc..4de2feb0b 100644
--- a/example/Makefile.inc
+++ b/example/Makefile.inc
@@ -5,6 +5,6 @@ AM_CFLAGS += \
-I$(srcdir) \
-I$(top_srcdir)/platform/@with_platform@/include/api \
-I$(top_srcdir)/platform/linux-generic/include/api \
- -I$(top_srcdir)/include
+ -I$(top_srcdir)/helper/include
AM_LDFLAGS += -L$(LIB)
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index 9fa9b377b..65c203492 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -18,12 +18,12 @@
#include <odp.h>
#include <odp_packet_io.h>
-#include <helper/odp_linux.h>
-#include <helper/odp_packet_helper.h>
-#include <helper/odp_eth.h>
-#include <helper/odp_ip.h>
-#include <helper/odp_udp.h>
-#include <helper/odp_icmp.h>
+#include <odph_linux.h>
+#include <odph_packet.h>
+#include <odph_eth.h>
+#include <odph_ip.h>
+#include <odph_udp.h>
+#include <odph_icmp.h>
#define MAX_WORKERS 32 /**< max number of works */
#define SHM_PKT_POOL_SIZE (512*2048) /**< pkt pool size */
@@ -47,8 +47,8 @@ typedef struct {
int if_count; /**< Number of interfaces to be used */
char **if_names; /**< Array of pointers to interface names */
odp_buffer_pool_t pool; /**< Buffer pool for packet IO */
- odp_ethaddr_t srcmac; /**< src mac addr */
- odp_ethaddr_t dstmac; /**< dest mac addr */
+ odph_ethaddr_t srcmac; /**< src mac addr */
+ odph_ethaddr_t dstmac; /**< dest mac addr */
unsigned int srcip; /**< src ip addr */
unsigned int dstip; /**< dest ip addr */
int mode; /**< work mode */
@@ -94,7 +94,7 @@ static void parse_args(int argc, char *argv[], appl_args_t *appl_args);
static void print_info(char *progname, appl_args_t *appl_args);
static void usage(char *progname);
static int scan_ip(char *buf, unsigned int *paddr);
-static int scan_mac(char *in, odp_ethaddr_t *des);
+static int scan_mac(char *in, odph_ethaddr_t *des);
static void tv_sub(struct timeval *recvtime, struct timeval *sendtime);
/**
@@ -146,7 +146,7 @@ static int scan_ip(char *buf, unsigned int *paddr)
* @param des mac for odp_packet
* @return 1 success, 0 failed
*/
-static int scan_mac(char *in, odp_ethaddr_t *des)
+static int scan_mac(char *in, odph_ethaddr_t *des)
{
int field;
int i;
@@ -173,9 +173,9 @@ static void pack_udp_pkt(odp_buffer_t obuf)
char *buf;
int max;
odp_packet_t pkt;
- odp_ethhdr_t *eth;
- odp_ipv4hdr_t *ip;
- odp_udphdr_t *udp;
+ odph_ethhdr_t *eth;
+ odph_ipv4hdr_t *ip;
+ odph_udphdr_t *udp;
unsigned short seq;
buf = odp_buffer_addr(obuf);
@@ -188,33 +188,33 @@ static void pack_udp_pkt(odp_buffer_t obuf)
pkt = odp_packet_from_buffer(obuf);
/* ether */
odp_packet_set_l2_offset(pkt, 0);
- eth = (odp_ethhdr_t *)buf;
- memcpy((char *)eth->src.addr, args->appl.srcmac.addr, ODP_ETHADDR_LEN);
- memcpy((char *)eth->dst.addr, args->appl.dstmac.addr, ODP_ETHADDR_LEN);
- eth->type = odp_cpu_to_be_16(ODP_ETHTYPE_IPV4);
+ eth = (odph_ethhdr_t *)buf;
+ memcpy((char *)eth->src.addr, args->appl.srcmac.addr, ODPH_ETHADDR_LEN);
+ memcpy((char *)eth->dst.addr, args->appl.dstmac.addr, ODPH_ETHADDR_LEN);
+ eth->type = odp_cpu_to_be_16(ODPH_ETHTYPE_IPV4);
/* ip */
- odp_packet_set_l3_offset(pkt, ODP_ETHHDR_LEN);
- ip = (odp_ipv4hdr_t *)(buf + ODP_ETHHDR_LEN);
+ odp_packet_set_l3_offset(pkt, ODPH_ETHHDR_LEN);
+ ip = (odph_ipv4hdr_t *)(buf + ODPH_ETHHDR_LEN);
ip->dst_addr = odp_cpu_to_be_32(args->appl.dstip);
ip->src_addr = odp_cpu_to_be_32(args->appl.srcip);
- ip->ver_ihl = ODP_IPV4 << 4 | ODP_IPV4HDR_IHL_MIN;
- ip->tot_len = odp_cpu_to_be_16(args->appl.payload + ODP_UDPHDR_LEN +
- ODP_IPV4HDR_LEN);
- ip->proto = ODP_IPPROTO_UDP;
+ ip->ver_ihl = ODPH_IPV4 << 4 | ODPH_IPV4HDR_IHL_MIN;
+ ip->tot_len = odp_cpu_to_be_16(args->appl.payload + ODPH_UDPHDR_LEN +
+ ODPH_IPV4HDR_LEN);
+ ip->proto = ODPH_IPPROTO_UDP;
seq = odp_atomic_fetch_add_u64(&counters.seq, 1) % 0xFFFF;
ip->id = odp_cpu_to_be_16(seq);
ip->chksum = 0;
- odp_ipv4_csum_update(pkt);
+ odph_ipv4_csum_update(pkt);
/* udp */
- odp_packet_set_l4_offset(pkt, ODP_ETHHDR_LEN + ODP_IPV4HDR_LEN);
- udp = (odp_udphdr_t *)(buf + ODP_ETHHDR_LEN + ODP_IPV4HDR_LEN);
+ odp_packet_set_l4_offset(pkt, ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN);
+ udp = (odph_udphdr_t *)(buf + ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN);
udp->src_port = 0;
udp->dst_port = 0;
- udp->length = odp_cpu_to_be_16(args->appl.payload + ODP_UDPHDR_LEN);
+ udp->length = odp_cpu_to_be_16(args->appl.payload + ODPH_UDPHDR_LEN);
udp->chksum = 0;
- udp->chksum = odp_cpu_to_be_16(odp_ipv4_udp_chksum(pkt));
- odp_packet_set_len(pkt, args->appl.payload + ODP_UDPHDR_LEN +
- ODP_IPV4HDR_LEN + ODP_ETHHDR_LEN);
+ udp->chksum = odp_cpu_to_be_16(odph_ipv4_udp_chksum(pkt));
+ odp_packet_set_len(pkt, args->appl.payload + ODPH_UDPHDR_LEN +
+ ODPH_IPV4HDR_LEN + ODPH_ETHHDR_LEN);
}
/**
@@ -227,9 +227,9 @@ static void pack_icmp_pkt(odp_buffer_t obuf)
char *buf;
int max;
odp_packet_t pkt;
- odp_ethhdr_t *eth;
- odp_ipv4hdr_t *ip;
- odp_icmphdr_t *icmp;
+ odph_ethhdr_t *eth;
+ odph_ipv4hdr_t *ip;
+ odph_icmphdr_t *icmp;
struct timeval tval;
uint8_t *tval_d;
unsigned short seq;
@@ -245,41 +245,41 @@ static void pack_icmp_pkt(odp_buffer_t obuf)
pkt = odp_packet_from_buffer(obuf);
/* ether */
odp_packet_set_l2_offset(pkt, 0);
- eth = (odp_ethhdr_t *)buf;
- memcpy((char *)eth->src.addr, args->appl.srcmac.addr, ODP_ETHADDR_LEN);
- memcpy((char *)eth->dst.addr, args->appl.dstmac.addr, ODP_ETHADDR_LEN);
- eth->type = odp_cpu_to_be_16(ODP_ETHTYPE_IPV4);
+ eth = (odph_ethhdr_t *)buf;
+ memcpy((char *)eth->src.addr, args->appl.srcmac.addr, ODPH_ETHADDR_LEN);
+ memcpy((char *)eth->dst.addr, args->appl.dstmac.addr, ODPH_ETHADDR_LEN);
+ eth->type = odp_cpu_to_be_16(ODPH_ETHTYPE_IPV4);
/* ip */
- odp_packet_set_l3_offset(pkt, ODP_ETHHDR_LEN);
- ip = (odp_ipv4hdr_t *)(buf + ODP_ETHHDR_LEN);
+ odp_packet_set_l3_offset(pkt, ODPH_ETHHDR_LEN);
+ ip = (odph_ipv4hdr_t *)(buf + ODPH_ETHHDR_LEN);
ip->dst_addr = odp_cpu_to_be_32(args->appl.dstip);
ip->src_addr = odp_cpu_to_be_32(args->appl.srcip);
- ip->ver_ihl = ODP_IPV4 << 4 | ODP_IPV4HDR_IHL_MIN;
- ip->tot_len = odp_cpu_to_be_16(args->appl.payload + ODP_ICMPHDR_LEN +
- ODP_IPV4HDR_LEN);
- ip->proto = ODP_IPPROTO_ICMP;
+ ip->ver_ihl = ODPH_IPV4 << 4 | ODPH_IPV4HDR_IHL_MIN;
+ ip->tot_len = odp_cpu_to_be_16(args->appl.payload + ODPH_ICMPHDR_LEN +
+ ODPH_IPV4HDR_LEN);
+ ip->proto = ODPH_IPPROTO_ICMP;
seq = odp_atomic_fetch_add_u64(&counters.seq, 1) % 0xffff;
ip->id = odp_cpu_to_be_16(seq);
ip->chksum = 0;
- odp_ipv4_csum_update(pkt);
+ odph_ipv4_csum_update(pkt);
/* icmp */
- icmp = (odp_icmphdr_t *)(buf + ODP_ETHHDR_LEN + ODP_IPV4HDR_LEN);
+ icmp = (odph_icmphdr_t *)(buf + ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN);
icmp->type = ICMP_ECHO;
icmp->code = 0;
icmp->un.echo.id = 0;
icmp->un.echo.sequence = ip->id;
- tval_d = (uint8_t *)(buf + ODP_ETHHDR_LEN + ODP_IPV4HDR_LEN +
- ODP_ICMPHDR_LEN);
+ tval_d = (uint8_t *)(buf + ODPH_ETHHDR_LEN + ODPH_IPV4HDR_LEN +
+ ODPH_ICMPHDR_LEN);
/* TODO This should be changed to use an
* ODP timer API once one exists. */
gettimeofday(&tval, NULL);
memcpy(tval_d, &tval, sizeof(struct timeval));
icmp->chksum = 0;
icmp->chksum = odp_chksum(icmp, args->appl.payload +
- ODP_ICMPHDR_LEN);
+ ODPH_ICMPHDR_LEN);
- odp_packet_set_len(pkt, args->appl.payload + ODP_ICMPHDR_LEN +
- ODP_IPV4HDR_LEN + ODP_ETHHDR_LEN);
+ odp_packet_set_len(pkt, args->appl.payload + ODPH_ICMPHDR_LEN +
+ ODPH_IPV4HDR_LEN + ODPH_ETHHDR_LEN);
}
/**
@@ -380,9 +380,9 @@ static void print_pkts(int thr, odp_packet_t pkt_tbl[], unsigned len)
{
odp_packet_t pkt;
char *buf;
- odp_ipv4hdr_t *ip;
- odp_udphdr_t *udp;
- odp_icmphdr_t *icmp;
+ odph_ipv4hdr_t *ip;
+ odph_udphdr_t *udp;
+ odph_icmphdr_t *icmp;
struct timeval tvrecv;
struct timeval tvsend;
double rtt;
@@ -401,27 +401,27 @@ static void print_pkts(int thr, odp_packet_t pkt_tbl[], unsigned len)
odp_atomic_inc_u64(&counters.ip);
rlen += sprintf(msg, "receive Packet proto:IP ");
buf = odp_buffer_addr(odp_buffer_from_packet(pkt));
- ip = (odp_ipv4hdr_t *)(buf + odp_packet_l3_offset(pkt));
+ ip = (odph_ipv4hdr_t *)(buf + odp_packet_l3_offset(pkt));
rlen += sprintf(msg + rlen, "id %d ",
odp_be_to_cpu_16(ip->id));
offset = odp_packet_l4_offset(pkt);
/* udp */
- if (ip->proto == ODP_IPPROTO_UDP) {
+ if (ip->proto == ODPH_IPPROTO_UDP) {
odp_atomic_inc_u64(&counters.udp);
- udp = (odp_udphdr_t *)(buf + offset);
+ udp = (odph_udphdr_t *)(buf + offset);
rlen += sprintf(msg + rlen, "UDP payload %d ",
odp_be_to_cpu_16(udp->length) -
- ODP_UDPHDR_LEN);
+ ODPH_UDPHDR_LEN);
}
/* icmp */
- if (ip->proto == ODP_IPPROTO_ICMP) {
- icmp = (odp_icmphdr_t *)(buf + offset);
+ if (ip->proto == ODPH_IPPROTO_ICMP) {
+ icmp = (odph_icmphdr_t *)(buf + offset);
/* echo reply */
if (icmp->type == ICMP_ECHOREPLY) {
odp_atomic_inc_u64(&counters.icmp);
- memcpy(&tvsend, buf + offset + ODP_ICMPHDR_LEN,
+ memcpy(&tvsend, buf + offset + ODPH_ICMPHDR_LEN,
sizeof(struct timeval));
/* TODO This should be changed to use an
* ODP timer API once one exists. */
@@ -499,13 +499,13 @@ static void *gen_recv_thread(void *arg)
pkt = odp_packet_from_buffer(buf);
/* Drop packets with errors */
if (odp_unlikely(odp_packet_error(pkt))) {
- odp_packet_free(pkt);
+ odph_packet_free(pkt);
continue;
}
print_pkts(thr, &pkt, 1);
- odp_packet_free(pkt);
+ odph_packet_free(pkt);
}
return arg;
@@ -515,7 +515,7 @@ static void *gen_recv_thread(void *arg)
*/
int main(int argc, char *argv[])
{
- odp_linux_pthread_t thread_tbl[MAX_WORKERS];
+ odph_linux_pthread_t thread_tbl[MAX_WORKERS];
odp_buffer_pool_t pool;
int thr_id;
int num_workers;
@@ -606,14 +606,14 @@ int main(int argc, char *argv[])
args->thread[1].pktio_dev = args->appl.if_names[0];
args->thread[1].pool = pool;
args->thread[1].mode = args->appl.mode;
- odp_linux_pthread_create(&thread_tbl[1], 1, 0,
- gen_recv_thread, &args->thread[1]);
+ odph_linux_pthread_create(&thread_tbl[1], 1, 0,
+ gen_recv_thread, &args->thread[1]);
args->thread[0].pktio_dev = args->appl.if_names[0];
args->thread[0].pool = pool;
args->thread[0].mode = args->appl.mode;
- odp_linux_pthread_create(&thread_tbl[0], 1, 0,
- gen_send_thread, &args->thread[0]);
+ odph_linux_pthread_create(&thread_tbl[0], 1, 0,
+ gen_send_thread, &args->thread[0]);
/* only wait send thread to join */
num_workers = 1;
@@ -644,14 +644,14 @@ int main(int argc, char *argv[])
* because each thread might get different arguments.
* Calls odp_thread_create(cpu) for each thread
*/
- odp_linux_pthread_create(&thread_tbl[i], 1,
- core, thr_run_func,
- &args->thread[i]);
+ odph_linux_pthread_create(&thread_tbl[i], 1,
+ core, thr_run_func,
+ &args->thread[i]);
}
}
/* Master thread waits for other threads to exit */
- odp_linux_pthread_join(thread_tbl, num_workers);
+ odph_linux_pthread_join(thread_tbl, num_workers);
printf("Exit\n\n");
return 0;
diff --git a/example/l2fwd/odp_l2fwd.c b/example/l2fwd/odp_l2fwd.c
index d74449ac5..6a38c1b6f 100644
--- a/example/l2fwd/odp_l2fwd.c
+++ b/example/l2fwd/odp_l2fwd.c
@@ -16,10 +16,10 @@
#include <unistd.h>
#include <odp.h>
-#include <helper/odp_linux.h>
-#include <helper/odp_packet_helper.h>
-#include <helper/odp_eth.h>
-#include <helper/odp_ip.h>
+#include <odph_linux.h>
+#include <odph_packet.h>
+#include <odph_eth.h>
+#include <odph_ip.h>
/** @def MAX_WORKERS
* @brief Maximum number of worker threads
@@ -313,7 +313,7 @@ static void *pktio_ifburst_thread(void *arg)
*/
int main(int argc, char *argv[])
{
- odp_linux_pthread_t thread_tbl[MAX_WORKERS];
+ odph_linux_pthread_t thread_tbl[MAX_WORKERS];
odp_buffer_pool_t pool;
int thr_id;
void *pool_base;
@@ -446,12 +446,12 @@ int main(int argc, char *argv[])
thr_run_func = pktio_ifburst_thread;
else /* APPL_MODE_PKT_QUEUE */
thr_run_func = pktio_queue_thread;
- odp_linux_pthread_create(&thread_tbl[i], 1, core, thr_run_func,
- &gbl_args->thread[i]);
+ odph_linux_pthread_create(&thread_tbl[i], 1, core, thr_run_func,
+ &gbl_args->thread[i]);
}
/* Master thread waits for other threads to exit */
- odp_linux_pthread_join(thread_tbl, num_workers);
+ odph_linux_pthread_join(thread_tbl, num_workers);
printf("Exit\n\n");
@@ -479,7 +479,7 @@ static int drop_err_pkts(odp_packet_t pkt_tbl[], unsigned len)
pkt = pkt_tbl[i];
if (odp_unlikely(odp_packet_error(pkt))) {
- odp_packet_free(pkt); /* Drop */
+ odph_packet_free(pkt); /* Drop */
pkt_cnt--;
} else if (odp_unlikely(i != j++)) {
pkt_tbl[j-1] = pkt;
diff --git a/example/odp_example/odp_example.c b/example/odp_example/odp_example.c
index f0bdf29ec..40d237bb7 100644
--- a/example/odp_example/odp_example.c
+++ b/example/odp_example/odp_example.c
@@ -17,7 +17,7 @@
#include <odp.h>
/* ODP helper for Linux apps */
-#include <helper/odp_linux.h>
+#include <odph_linux.h>
/* Needs librt*/
#include <time.h>
@@ -933,7 +933,7 @@ static void parse_args(int argc, char *argv[], test_args_t *args)
*/
int main(int argc, char *argv[])
{
- odp_linux_pthread_t thread_tbl[MAX_WORKERS];
+ odph_linux_pthread_t thread_tbl[MAX_WORKERS];
test_args_t args;
int thr_id;
int num_workers;
@@ -1067,11 +1067,11 @@ int main(int argc, char *argv[])
odp_barrier_init_count(&test_barrier, num_workers);
/* Create and launch worker threads */
- odp_linux_pthread_create(thread_tbl, num_workers, first_core,
- run_thread, NULL);
+ odph_linux_pthread_create(thread_tbl, num_workers, first_core,
+ run_thread, NULL);
/* Wait for worker threads to exit */
- odp_linux_pthread_join(thread_tbl, num_workers);
+ odph_linux_pthread_join(thread_tbl, num_workers);
printf("ODP example complete\n\n");
diff --git a/example/packet/odp_pktio.c b/example/packet/odp_pktio.c
index f247bd057..88ce575fc 100644
--- a/example/packet/odp_pktio.c
+++ b/example/packet/odp_pktio.c
@@ -16,10 +16,10 @@
#include <unistd.h>
#include <odp.h>
-#include <helper/odp_linux.h>
-#include <helper/odp_packet_helper.h>
-#include <helper/odp_eth.h>
-#include <helper/odp_ip.h>
+#include <odph_linux.h>
+#include <odph_packet.h>
+#include <odph_eth.h>
+#include <odph_ip.h>
/** @def MAX_WORKERS
* @brief Maximum number of worker threads
@@ -301,7 +301,7 @@ static void *pktio_ifburst_thread(void *arg)
*/
int main(int argc, char *argv[])
{
- odp_linux_pthread_t thread_tbl[MAX_WORKERS];
+ odph_linux_pthread_t thread_tbl[MAX_WORKERS];
odp_buffer_pool_t pool;
int thr_id;
int num_workers;
@@ -401,12 +401,12 @@ int main(int argc, char *argv[])
* because each thread might get different arguments.
* Calls odp_thread_create(cpu) for each thread
*/
- odp_linux_pthread_create(&thread_tbl[i], 1, core, thr_run_func,
- &args->thread[i]);
+ odph_linux_pthread_create(&thread_tbl[i], 1, core, thr_run_func,
+ &args->thread[i]);
}
/* Master thread waits for other threads to exit */
- odp_linux_pthread_join(thread_tbl, num_workers);
+ odph_linux_pthread_join(thread_tbl, num_workers);
printf("Exit\n\n");
@@ -434,7 +434,7 @@ static int drop_err_pkts(odp_packet_t pkt_tbl[], unsigned len)
pkt = pkt_tbl[i];
if (odp_unlikely(odp_packet_error(pkt))) {
- odp_packet_free(pkt); /* Drop */
+ odph_packet_free(pkt); /* Drop */
pkt_cnt--;
} else if (odp_unlikely(i != j++)) {
pkt_tbl[j-1] = pkt;
@@ -454,16 +454,16 @@ static int drop_err_pkts(odp_packet_t pkt_tbl[], unsigned len)
static void swap_pkt_addrs(odp_packet_t pkt_tbl[], unsigned len)
{
odp_packet_t pkt;
- odp_ethhdr_t *eth;
- odp_ethaddr_t tmp_addr;
- odp_ipv4hdr_t *ip;
+ odph_ethhdr_t *eth;
+ odph_ethaddr_t tmp_addr;
+ odph_ipv4hdr_t *ip;
uint32be_t ip_tmp_addr; /* tmp ip addr */
unsigned i;
for (i = 0; i < len; ++i) {
pkt = pkt_tbl[i];
if (odp_packet_inflag_eth(pkt)) {
- eth = (odp_ethhdr_t *)odp_packet_l2(pkt);
+ eth = (odph_ethhdr_t *)odp_packet_l2(pkt);
tmp_addr = eth->dst;
eth->dst = eth->src;
@@ -471,7 +471,7 @@ static void swap_pkt_addrs(odp_packet_t pkt_tbl[], unsigned len)
if (odp_packet_inflag_ipv4(pkt)) {
/* IPv4 */
- ip = (odp_ipv4hdr_t *)odp_packet_l3(pkt);
+ ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt);
ip_tmp_addr = ip->src_addr;
ip->src_addr = ip->dst_addr;
diff --git a/example/packet_netmap/odp_pktio_netmap.c b/example/packet_netmap/odp_pktio_netmap.c
index c0eb2025a..cc2607bd0 100644
--- a/example/packet_netmap/odp_pktio_netmap.c
+++ b/example/packet_netmap/odp_pktio_netmap.c
@@ -21,11 +21,11 @@
#include <arpa/inet.h>
#include <odp.h>
-#include <helper/odp_linux.h>
-#include <helper/odp_packet_helper.h>
-#include <helper/odp_eth.h>
-#include <helper/odp_ip.h>
-#include <helper/odp_packet_helper.h>
+#include <odph_linux.h>
+#include <odph_packet.h>
+#include <odph_eth.h>
+#include <odph_ip.h>
+#include <odph_packet.h>
#include <odp_pktio_netmap.h>
@@ -194,7 +194,7 @@ static void *pktio_queue_thread(void *arg)
if (odp_packet_copy(pkt_copy, pkt) != 0) {
ODP_ERR("Packet copy failed!\n");
- odp_packet_free(pkt_copy);
+ odph_packet_free(pkt_copy);
} else {
swap_pkt_addrs(&pkt_copy, 1);
odp_queue_enq(outq_def,
@@ -219,7 +219,7 @@ static void *pktio_queue_thread(void *arg)
*/
int main(int argc, char *argv[])
{
- odp_linux_pthread_t thread_tbl[MAX_WORKERS];
+ odph_linux_pthread_t thread_tbl[MAX_WORKERS];
odp_buffer_pool_t pool;
int thr_id;
int num_workers;
@@ -360,12 +360,12 @@ int main(int argc, char *argv[])
* Create threads one-by-one instead of all-at-once,
* because each thread might get different arguments
*/
- odp_linux_pthread_create(&thread_tbl[i], 1, i,
- pktio_queue_thread, NULL);
+ odph_linux_pthread_create(&thread_tbl[i], 1, i,
+ pktio_queue_thread, NULL);
}
/* Master thread waits for other threads to exit */
- odp_linux_pthread_join(thread_tbl, num_workers);
+ odph_linux_pthread_join(thread_tbl, num_workers);
printf("Exit\n\n");
@@ -393,7 +393,7 @@ static int drop_err_pkts(odp_packet_t pkt_tbl[], unsigned len)
pkt = pkt_tbl[i];
if (odp_unlikely(odp_packet_error(pkt))) {
- odp_packet_free(pkt); /* Drop */
+ odph_packet_free(pkt); /* Drop */
pkt_cnt--;
} else if (odp_unlikely(i != j++)) {
pkt_tbl[j-1] = pkt;
@@ -412,16 +412,16 @@ static int drop_err_pkts(odp_packet_t pkt_tbl[], unsigned len)
static void swap_pkt_addrs(odp_packet_t pkt_tbl[], unsigned len)
{
odp_packet_t pkt;
- odp_ethhdr_t *eth;
- odp_ethaddr_t tmp_addr;
- odp_ipv4hdr_t *ip;
+ odph_ethhdr_t *eth;
+ odph_ethaddr_t tmp_addr;
+ odph_ipv4hdr_t *ip;
uint32be_t ip_tmp_addr; /* tmp ip addr */
unsigned i;
for (i = 0; i < len; ++i) {
pkt = pkt_tbl[i];
if (odp_packet_inflag_eth(pkt)) {
- eth = (odp_ethhdr_t *)odp_packet_l2(pkt);
+ eth = (odph_ethhdr_t *)odp_packet_l2(pkt);
tmp_addr = eth->dst;
eth->dst = eth->src;
@@ -429,7 +429,7 @@ static void swap_pkt_addrs(odp_packet_t pkt_tbl[], unsigned len)
if (odp_packet_inflag_ipv4(pkt)) {
/* IPv4 */
- ip = (odp_ipv4hdr_t *)odp_packet_l3(pkt);
+ ip = (odph_ipv4hdr_t *)odp_packet_l3(pkt);
ip_tmp_addr = ip->src_addr;
ip->src_addr = ip->dst_addr;
diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c
index bf1d7dfed..4168856ec 100644
--- a/example/timer/odp_timer_test.c
+++ b/example/timer/odp_timer_test.c
@@ -17,7 +17,7 @@
#include <odp.h>
/* ODP helper for Linux apps */
-#include <helper/odp_linux.h>
+#include <odph_linux.h>
/* GNU lib C */
#include <getopt.h>
@@ -242,7 +242,7 @@ static void parse_args(int argc, char *argv[], test_args_t *args)
*/
int main(int argc, char *argv[])
{
- odp_linux_pthread_t thread_tbl[MAX_WORKERS];
+ odph_linux_pthread_t thread_tbl[MAX_WORKERS];
test_args_t args;
int thr_id;
int num_workers;
@@ -373,11 +373,11 @@ int main(int argc, char *argv[])
odp_barrier_init_count(&test_barrier, num_workers);
/* Create and launch worker threads */
- odp_linux_pthread_create(thread_tbl, num_workers, first_core,
- run_thread, &args);
+ odph_linux_pthread_create(thread_tbl, num_workers, first_core,
+ run_thread, &args);
/* Wait for worker threads to exit */
- odp_linux_pthread_join(thread_tbl, num_workers);
+ odph_linux_pthread_join(thread_tbl, num_workers);
printf("ODP timer test complete\n\n");