This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via d7ec85bbba32e9747307bd1cd76a061a39e7c731 (commit) via a001621520f769f835ce963d1e7ef8c1af74ad66 (commit) via 33afa2d1d4f6df342214dd9d9e4aab4433da3d7d (commit) via 29e5037571610ee49830dd64a43a47a8ccbadb87 (commit) via 988ae5930a9db1ceb88e46a84a116e67b0108307 (commit) from 5a4502fc6bc53e6503169da3028f456b64811a0b (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit d7ec85bbba32e9747307bd1cd76a061a39e7c731 Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Jan 19 16:56:30 2018 +0200
linux-gen: byteorder: use inlined version internally
Use always (also in ABI compat build) inlined version of byteorder conversion functions.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_classification_inlines.h b/platform/linux-generic/include/odp_classification_inlines.h index c2e94c63..df664c70 100644 --- a/platform/linux-generic/include/odp_classification_inlines.h +++ b/platform/linux-generic/include/odp_classification_inlines.h @@ -19,6 +19,8 @@ extern "C" { #endif
#include <odp/api/debug.h> +#include <odp/api/byteorder.h> +#include <odp/api/plat/byteorder_inlines.h> #include <protocols/eth.h> #include <protocols/ip.h> #include <protocols/ipsec.h> @@ -68,7 +70,7 @@ static inline int verify_pmr_ipv4_saddr(const uint8_t *pkt_addr, if (!pkt_hdr->p.input_flags.ipv4) return 0; ip = (const _odp_ipv4hdr_t *)(pkt_addr + pkt_hdr->p.l3_offset); - ipaddr = odp_be_to_cpu_32(ip->src_addr); + ipaddr = _odp_be_to_cpu_32(ip->src_addr); if (term_value->match.value == (ipaddr & term_value->match.mask)) return 1;
@@ -84,7 +86,7 @@ static inline int verify_pmr_ipv4_daddr(const uint8_t *pkt_addr, if (!pkt_hdr->p.input_flags.ipv4) return 0; ip = (const _odp_ipv4hdr_t *)(pkt_addr + pkt_hdr->p.l3_offset); - ipaddr = odp_be_to_cpu_32(ip->dst_addr); + ipaddr = _odp_be_to_cpu_32(ip->dst_addr); if (term_value->match.value == (ipaddr & term_value->match.mask)) return 1;
@@ -100,7 +102,7 @@ static inline int verify_pmr_tcp_sport(const uint8_t *pkt_addr, if (!pkt_hdr->p.input_flags.tcp) return 0; tcp = (const _odp_tcphdr_t *)(pkt_addr + pkt_hdr->p.l4_offset); - sport = odp_be_to_cpu_16(tcp->src_port); + sport = _odp_be_to_cpu_16(tcp->src_port); if (term_value->match.value == (sport & term_value->match.mask)) return 1;
@@ -116,7 +118,7 @@ static inline int verify_pmr_tcp_dport(const uint8_t *pkt_addr, if (!pkt_hdr->p.input_flags.tcp) return 0; tcp = (const _odp_tcphdr_t *)(pkt_addr + pkt_hdr->p.l4_offset); - dport = odp_be_to_cpu_16(tcp->dst_port); + dport = _odp_be_to_cpu_16(tcp->dst_port); if (term_value->match.value == (dport & term_value->match.mask)) return 1;
@@ -132,7 +134,7 @@ static inline int verify_pmr_udp_dport(const uint8_t *pkt_addr, if (!pkt_hdr->p.input_flags.udp) return 0; udp = (const _odp_udphdr_t *)(pkt_addr + pkt_hdr->p.l4_offset); - dport = odp_be_to_cpu_16(udp->dst_port); + dport = _odp_be_to_cpu_16(udp->dst_port); if (term_value->match.value == (dport & term_value->match.mask)) return 1;
@@ -149,7 +151,7 @@ static inline int verify_pmr_udp_sport(const uint8_t *pkt_addr, if (!pkt_hdr->p.input_flags.udp) return 0; udp = (const _odp_udphdr_t *)(pkt_addr + pkt_hdr->p.l4_offset); - sport = odp_be_to_cpu_16(udp->src_port); + sport = _odp_be_to_cpu_16(udp->src_port); if (term_value->match.value == (sport & term_value->match.mask)) return 1;
@@ -169,9 +171,9 @@ static inline int verify_pmr_dmac(const uint8_t *pkt_addr,
eth = (const _odp_ethhdr_t *)(pkt_addr + pkt_hdr->p.l2_offset); memcpy(&dmac_be, eth->dst.addr, _ODP_ETHADDR_LEN); - dmac = odp_be_to_cpu_64(dmac_be); + dmac = _odp_be_to_cpu_64(dmac_be); /* since we are converting a 48 bit ethernet address from BE to cpu - format using odp_be_to_cpu_64() the last 16 bits needs to be right + format using _odp_be_to_cpu_64() the last 16 bits needs to be right shifted */ if (dmac_be != dmac) dmac = dmac >> (64 - (_ODP_ETHADDR_LEN * 8)); @@ -245,7 +247,7 @@ static inline int verify_pmr_vlan_id_0(const uint8_t *pkt_addr,
eth = (const _odp_ethhdr_t *)(pkt_addr + pkt_hdr->p.l2_offset); vlan = (const _odp_vlanhdr_t *)(eth + 1); - tci = odp_be_to_cpu_16(vlan->tci); + tci = _odp_be_to_cpu_16(vlan->tci); vlan_id = tci & 0x0fff;
if (term_value->match.value == (vlan_id & term_value->match.mask)) @@ -269,7 +271,7 @@ static inline int verify_pmr_vlan_id_x(const uint8_t *pkt_addr ODP_UNUSED, eth = (const _odp_ethhdr_t *)(pkt_addr + pkt_hdr->p.l2_offset); vlan = (const _odp_vlanhdr_t *)(eth + 1); vlan++; - tci = odp_be_to_cpu_16(vlan->tci); + tci = _odp_be_to_cpu_16(vlan->tci); vlan_id = tci & 0x0fff;
if (term_value->match.value == (vlan_id & term_value->match.mask)) @@ -289,11 +291,11 @@ static inline int verify_pmr_ipsec_spi(const uint8_t *pkt_addr, if (pkt_hdr->p.input_flags.ipsec_ah) { const _odp_ahhdr_t *ahhdr = (const _odp_ahhdr_t *)pkt_addr;
- spi = odp_be_to_cpu_32(ahhdr->spi); + spi = _odp_be_to_cpu_32(ahhdr->spi); } else if (pkt_hdr->p.input_flags.ipsec_esp) { const _odp_esphdr_t *esphdr = (const _odp_esphdr_t *)pkt_addr;
- spi = odp_be_to_cpu_32(esphdr->spi); + spi = _odp_be_to_cpu_32(esphdr->spi); } else { return 0; } @@ -343,7 +345,7 @@ static inline int verify_pmr_eth_type_0(const uint8_t *pkt_addr, return 0;
eth = (const _odp_ethhdr_t *)(pkt_addr + pkt_hdr->p.l2_offset); - ethtype = odp_be_to_cpu_16(eth->type); + ethtype = _odp_be_to_cpu_16(eth->type);
if (term_value->match.value == (ethtype & term_value->match.mask)) return 1; @@ -364,7 +366,7 @@ static inline int verify_pmr_eth_type_x(const uint8_t *pkt_addr,
eth = (const _odp_ethhdr_t *)(pkt_addr + pkt_hdr->p.l2_offset); vlan = (const _odp_vlanhdr_t *)(eth + 1); - ethtype = odp_be_to_cpu_16(vlan->type); + ethtype = _odp_be_to_cpu_16(vlan->type);
if (term_value->match.value == (ethtype & term_value->match.mask)) return 1; diff --git a/platform/linux-generic/include/protocols/thash.h b/platform/linux-generic/include/protocols/thash.h index c938e67e..6b07d4e4 100644 --- a/platform/linux-generic/include/protocols/thash.h +++ b/platform/linux-generic/include/protocols/thash.h @@ -67,10 +67,10 @@ void thash_load_ipv6_addr(const _odp_ipv6hdr_t *ipv6,
for (i = 0; i < 4; i++) { *(tuple->v6.src_addr.u32 + i) = - odp_be_to_cpu_32(*(ipv6->src_addr.u32 + i)); + _odp_be_to_cpu_32(*(ipv6->src_addr.u32 + i));
*(tuple->v6.dst_addr.u32 + i) = - odp_be_to_cpu_32(*(ipv6->dst_addr.u32 + i)); + _odp_be_to_cpu_32(*(ipv6->dst_addr.u32 + i)); } }
@@ -83,9 +83,9 @@ uint32_t thash_softrss(uint32_t *tuple, uint8_t len, for (j = 0; j < len; j++) { for (i = 0; i < 32; i++) { if (tuple[j] & (1 << (31 - i))) { - ret ^= odp_cpu_to_be_32(((const uint32_t *) + ret ^= _odp_cpu_to_be_32(((const uint32_t *) key.u32)[j]) << i | (uint32_t)((uint64_t) - (odp_cpu_to_be_32(((const uint32_t *)key.u32) + (_odp_cpu_to_be_32(((const uint32_t *)key.u32) [j + 1])) >> (32 - i)); } } diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index 27643092..5aa3b84a 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -1103,7 +1103,7 @@ cos_t *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, const uint8_t *pkt_addr, packet_hdr_has_eth(hdr)) { eth = (const _odp_ethhdr_t *)(pkt_addr + hdr->p.l2_offset); vlan = (const _odp_vlanhdr_t *)(eth + 1); - qos = odp_be_to_cpu_16(vlan->tci); + qos = _odp_be_to_cpu_16(vlan->tci); qos = ((qos >> 13) & 0x07); cos = l2_cos->cos[qos]; } diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index b023d308..521627f1 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -10,6 +10,8 @@ #include <odp/api/chksum.h>
#include <odp/api/plat/packet_inlines.h> +#include <odp/api/byteorder.h> +#include <odp/api/plat/byteorder_inlines.h>
#include <odp_debug_internal.h> #include <odp_packet_internal.h> @@ -304,11 +306,11 @@ static int ipsec_parse_ipv4(ipsec_state_t *state, odp_packet_t pkt) odp_packet_copy_to_mem(pkt, state->ip_offset, _ODP_IPV4HDR_LEN, &ipv4hdr);
- if (_ODP_IPV4HDR_IS_FRAGMENT(odp_be_to_cpu_16(ipv4hdr.frag_offset))) + if (_ODP_IPV4HDR_IS_FRAGMENT(_odp_be_to_cpu_16(ipv4hdr.frag_offset))) return -1;
state->ip_hdr_len = ipv4_hdr_len(&ipv4hdr); - state->ip_tot_len = odp_be_to_cpu_16(ipv4hdr.tot_len); + state->ip_tot_len = _odp_be_to_cpu_16(ipv4hdr.tot_len); state->ip_next_hdr = ipv4hdr.proto; state->ip_next_hdr_offset = state->ip_offset + _ODP_IPV4HDR_PROTO_OFFSET; @@ -329,7 +331,7 @@ static int ipsec_parse_ipv6(ipsec_state_t *state, odp_packet_t pkt) state->ip_next_hdr = ipv6hdr.next_hdr; state->ip_next_hdr_offset = state->ip_offset + _ODP_IPV6HDR_NHDR_OFFSET; /* FIXME: Jumbo frames */ - state->ip_tot_len = odp_be_to_cpu_16(ipv6hdr.payload_len) + + state->ip_tot_len = _odp_be_to_cpu_16(ipv6hdr.payload_len) + _ODP_IPV6HDR_LEN; memcpy(state->ipv6_addr, &ipv6hdr.dst_addr, _ODP_IPV6ADDR_LEN);
@@ -432,8 +434,8 @@ static int ipsec_in_esp(odp_packet_t *pkt, odp_packet_copy_to_mem(*pkt, ipsec_offset, _ODP_UDPHDR_LEN, &udp);
- if (udp.dst_port != odp_cpu_to_be_16(_ODP_UDP_IPSEC_PORT) || - udp.length != odp_cpu_to_be_16(ip_data_len)) { + if (udp.dst_port != _odp_cpu_to_be_16(_ODP_UDP_IPSEC_PORT) || + udp.length != _odp_cpu_to_be_16(ip_data_len)) { status->error.proto = 1; return -1; } @@ -450,7 +452,7 @@ static int ipsec_in_esp(odp_packet_t *pkt, }
ipsec_sa = ipsec_get_sa(sa, ODP_IPSEC_ESP, - odp_be_to_cpu_32(esp.spi), + _odp_be_to_cpu_32(esp.spi), state->is_ipv4 ? ODP_IPSEC_IPV4 : ODP_IPSEC_IPV6, &state->ipv4_addr, status); @@ -481,7 +483,7 @@ static int ipsec_in_esp(odp_packet_t *pkt,
state->esp.aad.spi = esp.spi; state->esp.aad.seq_no = esp.seq_no; - state->in.seq_no = odp_be_to_cpu_32(esp.seq_no); + state->in.seq_no = _odp_be_to_cpu_32(esp.seq_no);
param->aad_ptr = (uint8_t *)&state->esp.aad;
@@ -546,7 +548,7 @@ static int ipsec_in_ah(odp_packet_t *pkt, }
ipsec_sa = ipsec_get_sa(sa, ODP_IPSEC_AH, - odp_be_to_cpu_32(ah.spi), + _odp_be_to_cpu_32(ah.spi), state->is_ipv4 ? ODP_IPSEC_IPV4 : ODP_IPSEC_IPV6, &state->ipv4_addr, status); @@ -587,11 +589,11 @@ static int ipsec_in_ah(odp_packet_t *pkt, state->ah_ipv6.ver_tc_flow = ipv6hdr->ver_tc_flow; state->ah_ipv6.hop_limit = ipv6hdr->hop_limit; ipv6hdr->ver_tc_flow = - odp_cpu_to_be_32(6 << _ODP_IPV6HDR_VERSION_SHIFT); + _odp_cpu_to_be_32(6 << _ODP_IPV6HDR_VERSION_SHIFT); ipv6hdr->hop_limit = 0; }
- state->in.seq_no = odp_be_to_cpu_32(ah.seq_no); + state->in.seq_no = _odp_be_to_cpu_32(ah.seq_no);
param->auth_range.offset = state->ip_offset; param->auth_range.length = state->ip_tot_len; @@ -794,7 +796,7 @@ static ipsec_sa_t *ipsec_in_single(odp_packet_t pkt, _odp_ipv4hdr_t *ipv4hdr = odp_packet_l3_ptr(pkt, NULL);
if (ODP_IPSEC_MODE_TRANSPORT == ipsec_sa->mode) - ipv4hdr->tot_len = odp_cpu_to_be_16(state.ip_tot_len); + ipv4hdr->tot_len = _odp_cpu_to_be_16(state.ip_tot_len); else ipv4hdr->ttl -= ipsec_sa->dec_ttl; _odp_ipv4_csum_update(pkt); @@ -803,8 +805,8 @@ static ipsec_sa_t *ipsec_in_single(odp_packet_t pkt,
if (ODP_IPSEC_MODE_TRANSPORT == ipsec_sa->mode) ipv6hdr->payload_len = - odp_cpu_to_be_16(state.ip_tot_len - - _ODP_IPV6HDR_LEN); + _odp_cpu_to_be_16(state.ip_tot_len - + _ODP_IPV6HDR_LEN); else ipv6hdr->hop_limit -= ipsec_sa->dec_ttl; } else { @@ -849,7 +851,7 @@ static int ipsec_out_tunnel_parse_ipv4(ipsec_state_t *state, ipsec_sa_t *ipsec_sa) { _odp_ipv4hdr_t *ipv4hdr = state->ip; - uint16_t flags = odp_be_to_cpu_16(ipv4hdr->frag_offset); + uint16_t flags = _odp_be_to_cpu_16(ipv4hdr->frag_offset);
ipv4hdr->ttl -= ipsec_sa->dec_ttl; state->out_tunnel.ip_tos = ipv4hdr->tos; @@ -894,7 +896,7 @@ static int ipsec_out_tunnel_ipv4(odp_packet_t *pkt, state->ip_tot_len = odp_packet_len(*pkt) - state->ip_offset; state->ip_tot_len += _ODP_IPV4HDR_LEN;
- out_ip.tot_len = odp_cpu_to_be_16(state->ip_tot_len); + out_ip.tot_len = _odp_cpu_to_be_16(state->ip_tot_len); /* No need to convert to BE: ID just should not be duplicated */ out_ip.id = odp_atomic_fetch_add_u32(&ipsec_sa->out.tun_ipv4.hdr_id, 1); @@ -902,7 +904,7 @@ static int ipsec_out_tunnel_ipv4(odp_packet_t *pkt, flags = state->out_tunnel.ip_df; else flags = ((uint16_t)ipsec_sa->out.tun_ipv4.df) << 14; - out_ip.frag_offset = odp_cpu_to_be_16(flags); + out_ip.frag_offset = _odp_cpu_to_be_16(flags); out_ip.ttl = ipsec_sa->out.tun_ipv4.ttl; /* Will be filled later by packet checksum update */ out_ip.chksum = 0; @@ -957,7 +959,7 @@ static int ipsec_out_tunnel_ipv6(odp_packet_t *pkt, out_ip.ver_tc_flow = odp_cpu_to_be_32(ver);
state->ip_tot_len = odp_packet_len(*pkt) - state->ip_offset; - out_ip.payload_len = odp_cpu_to_be_16(state->ip_tot_len); + out_ip.payload_len = _odp_cpu_to_be_16(state->ip_tot_len); state->ip_tot_len += _ODP_IPV6HDR_LEN;
out_ip.hop_limit = ipsec_sa->out.tun_ipv6.hlimit; @@ -1062,10 +1064,10 @@ static int ipsec_out_esp(odp_packet_t *pkt, if (ipsec_sa->udp_encap) { hdr_len += _ODP_UDPHDR_LEN; proto = _ODP_IPPROTO_UDP; - udphdr.src_port = odp_cpu_to_be_16(_ODP_UDP_IPSEC_PORT); - udphdr.dst_port = odp_cpu_to_be_16(_ODP_UDP_IPSEC_PORT); - udphdr.length = odp_cpu_to_be_16(ip_data_len + - hdr_len + trl_len); + udphdr.src_port = _odp_cpu_to_be_16(_ODP_UDP_IPSEC_PORT); + udphdr.dst_port = _odp_cpu_to_be_16(_ODP_UDP_IPSEC_PORT); + udphdr.length = _odp_cpu_to_be_16(ip_data_len + + hdr_len + trl_len); udphdr.chksum = 0; /* should be 0 by RFC */ }
@@ -1082,8 +1084,8 @@ static int ipsec_out_esp(odp_packet_t *pkt, param->override_iv_ptr = state->iv;
memset(&esp, 0, sizeof(esp)); - esp.spi = odp_cpu_to_be_32(ipsec_sa->spi); - esp.seq_no = odp_cpu_to_be_32(ipsec_seq_no(ipsec_sa)); + esp.spi = _odp_cpu_to_be_32(ipsec_sa->spi); + esp.seq_no = _odp_cpu_to_be_32(ipsec_seq_no(ipsec_sa));
state->esp.aad.spi = esp.spi; state->esp.aad.seq_no = esp.seq_no; @@ -1099,12 +1101,12 @@ static int ipsec_out_esp(odp_packet_t *pkt, if (state->is_ipv4) { _odp_ipv4hdr_t *ipv4hdr = state->ip;
- ipv4hdr->tot_len = odp_cpu_to_be_16(state->ip_tot_len); + ipv4hdr->tot_len = _odp_cpu_to_be_16(state->ip_tot_len); } else { _odp_ipv6hdr_t *ipv6hdr = state->ip;
- ipv6hdr->payload_len = odp_cpu_to_be_16(state->ip_tot_len - - _ODP_IPV6HDR_LEN); + ipv6hdr->payload_len = _odp_cpu_to_be_16(state->ip_tot_len - + _ODP_IPV6HDR_LEN); }
if (odp_packet_extend_tail(pkt, trl_len, NULL, NULL) < 0 || @@ -1187,8 +1189,8 @@ static int ipsec_out_ah(odp_packet_t *pkt, }
memset(&ah, 0, sizeof(ah)); - ah.spi = odp_cpu_to_be_32(ipsec_sa->spi); - ah.seq_no = odp_cpu_to_be_32(ipsec_seq_no(ipsec_sa)); + ah.spi = _odp_cpu_to_be_32(ipsec_sa->spi); + ah.seq_no = _odp_cpu_to_be_32(ipsec_seq_no(ipsec_sa)); ah.next_header = state->ip_next_hdr;
odp_packet_copy_from_mem(*pkt, state->ip_next_hdr_offset, 1, &proto); @@ -1205,20 +1207,20 @@ static int ipsec_out_ah(odp_packet_t *pkt, ipv4hdr->ttl = 0; hdr_len = IPSEC_PAD_LEN(hdr_len, 4); state->ip_tot_len += hdr_len; - ipv4hdr->tot_len = odp_cpu_to_be_16(state->ip_tot_len); + ipv4hdr->tot_len = _odp_cpu_to_be_16(state->ip_tot_len); } else { _odp_ipv6hdr_t *ipv6hdr = state->ip;
state->ah_ipv6.ver_tc_flow = ipv6hdr->ver_tc_flow; state->ah_ipv6.hop_limit = ipv6hdr->hop_limit; ipv6hdr->ver_tc_flow = - odp_cpu_to_be_32(6 << _ODP_IPV6HDR_VERSION_SHIFT); + _odp_cpu_to_be_32(6 << _ODP_IPV6HDR_VERSION_SHIFT); ipv6hdr->hop_limit = 0;
hdr_len = IPSEC_PAD_LEN(hdr_len, 8); state->ip_tot_len += hdr_len; - ipv6hdr->payload_len = odp_cpu_to_be_16(state->ip_tot_len - - _ODP_IPV6HDR_LEN); + ipv6hdr->payload_len = _odp_cpu_to_be_16(state->ip_tot_len - + _ODP_IPV6HDR_LEN); }
ah.ah_len = hdr_len / 4 - 2; diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 77765fb8..a4cd05f6 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -12,6 +12,7 @@ #include <odp_debug_internal.h> #include <odp/api/hints.h> #include <odp/api/byteorder.h> +#include <odp/api/plat/byteorder_inlines.h>
#include <protocols/eth.h> #include <protocols/ip.h> @@ -1964,16 +1965,16 @@ static inline uint16_t parse_eth(packet_parser_t *prs, const uint8_t **parseptr, eth = (const _odp_ethhdr_t *)*parseptr;
/* Handle Ethernet broadcast/multicast addresses */ - macaddr0 = odp_be_to_cpu_16(*((const uint16_t *)(const void *)eth)); + macaddr0 = _odp_be_to_cpu_16(*((const uint16_t *)(const void *)eth)); prs->input_flags.eth_mcast = (macaddr0 & 0x0100) == 0x0100;
if (macaddr0 == 0xffff) { macaddr2 = - odp_be_to_cpu_16(*((const uint16_t *) - (const void *)eth + 1)); + _odp_be_to_cpu_16(*((const uint16_t *) + (const void *)eth + 1)); macaddr4 = - odp_be_to_cpu_16(*((const uint16_t *) - (const void *)eth + 2)); + _odp_be_to_cpu_16(*((const uint16_t *) + (const void *)eth + 2)); prs->input_flags.eth_bcast = (macaddr2 == 0xffff) && (macaddr4 == 0xffff); } else { @@ -1981,7 +1982,7 @@ static inline uint16_t parse_eth(packet_parser_t *prs, const uint8_t **parseptr, }
/* Get Ethertype */ - ethtype = odp_be_to_cpu_16(eth->type); + ethtype = _odp_be_to_cpu_16(eth->type); *offset += sizeof(*eth); *parseptr += sizeof(*eth);
@@ -1992,8 +1993,8 @@ static inline uint16_t parse_eth(packet_parser_t *prs, const uint8_t **parseptr, prs->error_flags.snap_len = 1; return 0; } - ethtype = odp_be_to_cpu_16(*((const uint16_t *)(uintptr_t) - (parseptr + 6))); + ethtype = _odp_be_to_cpu_16(*((const uint16_t *)(uintptr_t) + (parseptr + 6))); *offset += 8; *parseptr += 8; } @@ -2004,7 +2005,7 @@ static inline uint16_t parse_eth(packet_parser_t *prs, const uint8_t **parseptr, prs->input_flags.vlan = 1;
vlan = (const _odp_vlanhdr_t *)*parseptr; - ethtype = odp_be_to_cpu_16(vlan->type); + ethtype = _odp_be_to_cpu_16(vlan->type); *offset += sizeof(_odp_vlanhdr_t); *parseptr += sizeof(_odp_vlanhdr_t); } @@ -2012,7 +2013,7 @@ static inline uint16_t parse_eth(packet_parser_t *prs, const uint8_t **parseptr, if (ethtype == _ODP_ETHTYPE_VLAN) { prs->input_flags.vlan = 1; vlan = (const _odp_vlanhdr_t *)*parseptr; - ethtype = odp_be_to_cpu_16(vlan->type); + ethtype = _odp_be_to_cpu_16(vlan->type); *offset += sizeof(_odp_vlanhdr_t); *parseptr += sizeof(_odp_vlanhdr_t); } @@ -2030,8 +2031,8 @@ static inline uint8_t parse_ipv4(packet_parser_t *prs, const uint8_t **parseptr, uint8_t ver = _ODP_IPV4HDR_VER(ipv4->ver_ihl); uint8_t ihl = _ODP_IPV4HDR_IHL(ipv4->ver_ihl); uint16_t frag_offset; - uint32_t dstaddr = odp_be_to_cpu_32(ipv4->dst_addr); - uint32_t l3_len = odp_be_to_cpu_16(ipv4->tot_len); + uint32_t dstaddr = _odp_be_to_cpu_32(ipv4->dst_addr); + uint32_t l3_len = _odp_be_to_cpu_16(ipv4->tot_len);
if (odp_unlikely(ihl < _ODP_IPV4HDR_IHL_MIN) || odp_unlikely(ver != 4) || @@ -2051,7 +2052,7 @@ static inline uint8_t parse_ipv4(packet_parser_t *prs, const uint8_t **parseptr, * OR * "fragment offset" field is nonzero (all fragments except the first) */ - frag_offset = odp_be_to_cpu_16(ipv4->frag_offset); + frag_offset = _odp_be_to_cpu_16(ipv4->frag_offset); if (odp_unlikely(_ODP_IPV4HDR_IS_FRAGMENT(frag_offset))) prs->input_flags.ipfrag = 1;
@@ -2071,12 +2072,12 @@ static inline uint8_t parse_ipv6(packet_parser_t *prs, const uint8_t **parseptr, { const _odp_ipv6hdr_t *ipv6 = (const _odp_ipv6hdr_t *)*parseptr; const _odp_ipv6hdr_ext_t *ipv6ext; - uint32_t dstaddr0 = odp_be_to_cpu_32(ipv6->dst_addr.u8[0]); - uint32_t l3_len = odp_be_to_cpu_16(ipv6->payload_len) + - _ODP_IPV6HDR_LEN; + uint32_t dstaddr0 = _odp_be_to_cpu_32(ipv6->dst_addr.u8[0]); + uint32_t l3_len = _odp_be_to_cpu_16(ipv6->payload_len) + + _ODP_IPV6HDR_LEN;
/* Basic sanity checks on IPv6 header */ - if ((odp_be_to_cpu_32(ipv6->ver_tc_flow) >> 28) != 6 || + if ((_odp_be_to_cpu_32(ipv6->ver_tc_flow) >> 28) != 6 || l3_len > frame_len - *offset) { prs->error_flags.ip_err = 1; return 0; @@ -2106,7 +2107,7 @@ static inline uint8_t parse_ipv6(packet_parser_t *prs, const uint8_t **parseptr, *offset < seg_len);
if (*offset >= prs->l3_offset + - odp_be_to_cpu_16(ipv6->payload_len)) { + _odp_be_to_cpu_16(ipv6->payload_len)) { prs->error_flags.ip_err = 1; return 0; } @@ -2150,12 +2151,12 @@ static inline void parse_udp(packet_parser_t *prs, const uint8_t **parseptr, uint32_t *offset) { const _odp_udphdr_t *udp = (const _odp_udphdr_t *)*parseptr; - uint32_t udplen = odp_be_to_cpu_16(udp->length); + uint32_t udplen = _odp_be_to_cpu_16(udp->length);
if (odp_unlikely(udplen < sizeof(_odp_udphdr_t))) prs->error_flags.udp_err = 1;
- if (odp_cpu_to_be_16(_ODP_UDP_IPSEC_PORT) == udp->dst_port && + if (_odp_cpu_to_be_16(_ODP_UDP_IPSEC_PORT) == udp->dst_port && udplen > 4) { uint32_t val;
diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index 556b2a1f..557e77ba 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -27,6 +27,7 @@ #include <protocols/ip.h> #include <odp_traffic_mngr_internal.h> #include <odp/api/plat/packet_inlines.h> +#include <odp/api/plat/byteorder_inlines.h>
/* Local vars */ static const @@ -1945,7 +1946,7 @@ static void egress_vlan_marking(tm_vlan_marking_t *vlan_marking, vlan_hdr_ptr = &vlan_hdr; }
- old_tci = odp_be_to_cpu_16(vlan_hdr_ptr->tci); + old_tci = _odp_be_to_cpu_16(vlan_hdr_ptr->tci); new_tci = old_tci; if (vlan_marking->drop_eligible_enabled) new_tci |= _ODP_VLANHDR_DEI_MASK; @@ -1953,7 +1954,7 @@ static void egress_vlan_marking(tm_vlan_marking_t *vlan_marking, if (new_tci == old_tci) return;
- vlan_hdr_ptr->tci = odp_cpu_to_be_16(new_tci); + vlan_hdr_ptr->tci = _odp_cpu_to_be_16(new_tci); if (split_hdr) odp_packet_copy_from_mem(odp_pkt, _ODP_ETHHDR_LEN, _ODP_VLANHDR_LEN, &vlan_hdr); @@ -2010,7 +2011,7 @@ static void egress_ipv4_tos_marking(tm_tos_marking_t *tos_marking, * in this specific case the carry out check does NOT need to be * repeated since it can be proven that the carry in sum cannot * cause another carry out. */ - old_chksum = (uint32_t)odp_be_to_cpu_16(ipv4_hdr_ptr->chksum); + old_chksum = (uint32_t)_odp_be_to_cpu_16(ipv4_hdr_ptr->chksum); ones_compl_sum = (~old_chksum) & 0xFFFF; tos_diff = ((uint32_t)new_tos) + ((~(uint32_t)old_tos) & 0xFFFF); ones_compl_sum += tos_diff; @@ -2019,7 +2020,7 @@ static void egress_ipv4_tos_marking(tm_tos_marking_t *tos_marking, (ones_compl_sum & 0xFFFF);
ipv4_hdr_ptr->tos = new_tos; - ipv4_hdr_ptr->chksum = odp_cpu_to_be_16((~ones_compl_sum) & 0xFFFF); + ipv4_hdr_ptr->chksum = _odp_cpu_to_be_16((~ones_compl_sum) & 0xFFFF); if (split_hdr) odp_packet_copy_from_mem(odp_pkt, l3_offset, _ODP_IPV4HDR_LEN, &ipv4_hdr); @@ -2050,7 +2051,7 @@ static void egress_ipv6_tc_marking(tm_tos_marking_t *tos_marking, ipv6_hdr_ptr = &ipv6_hdr; }
- old_ver_tc_flow = odp_be_to_cpu_32(ipv6_hdr_ptr->ver_tc_flow); + old_ver_tc_flow = _odp_be_to_cpu_32(ipv6_hdr_ptr->ver_tc_flow); old_tc = (old_ver_tc_flow & _ODP_IPV6HDR_TC_MASK) >> _ODP_IPV6HDR_TC_SHIFT; new_tc = old_tc; @@ -2071,7 +2072,7 @@ static void egress_ipv6_tc_marking(tm_tos_marking_t *tos_marking,
new_ver_tc_flow = (old_ver_tc_flow & ~_ODP_IPV6HDR_TC_MASK) | (new_tc << _ODP_IPV6HDR_TC_SHIFT); - ipv6_hdr_ptr->ver_tc_flow = odp_cpu_to_be_32(new_ver_tc_flow); + ipv6_hdr_ptr->ver_tc_flow = _odp_cpu_to_be_32(new_ver_tc_flow);
if (split_hdr) odp_packet_copy_from_mem(odp_pkt, l3_offset,
commit a001621520f769f835ce963d1e7ef8c1af74ad66 Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Jan 19 16:33:11 2018 +0200
linux-gen: byteorder: internal inline functions
Define inline functions for internal use. Implementation uses always internally inlined version. Application uses inlined version only in non ABI compatible mode.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 9b7ee37e..8585080d 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -24,6 +24,7 @@ odpapiplatincludedir= $(includedir)/odp/api/plat odpapiplatinclude_HEADERS = \ include/odp/api/plat/atomic_inlines.h \ include/odp/api/plat/byteorder_inlines.h \ + include/odp/api/plat/byteorder_inlines_api.h \ include/odp/api/plat/packet_flag_inlines.h \ include/odp/api/plat/packet_flag_inlines_api.h \ include/odp/api/plat/packet_inline_types.h \ diff --git a/platform/linux-generic/include-abi/odp/api/abi/byteorder.h b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h index da07c0eb..ee03a17b 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/byteorder.h +++ b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h @@ -77,6 +77,7 @@ typedef uint32_t __odp_bitwise odp_u32sum_t;
#define _ODP_INLINE static inline #include <odp/api/plat/byteorder_inlines.h> +#include <odp/api/plat/byteorder_inlines_api.h>
/** * @} diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h b/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h index 2f96863b..b559d4f0 100644 --- a/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/byteorder_inlines.h @@ -43,7 +43,7 @@ extern "C" { #define __odp_builtin_bswap16(u16) __builtin_bswap16(u16) #endif
-_ODP_INLINE uint16_t odp_be_to_cpu_16(odp_u16be_t be16) +static inline uint16_t _odp_be_to_cpu_16(odp_u16be_t be16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return __odp_builtin_bswap16((__odp_force uint16_t)be16); @@ -52,7 +52,7 @@ _ODP_INLINE uint16_t odp_be_to_cpu_16(odp_u16be_t be16) #endif }
-_ODP_INLINE uint32_t odp_be_to_cpu_32(odp_u32be_t be32) +static inline uint32_t _odp_be_to_cpu_32(odp_u32be_t be32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return __builtin_bswap32((__odp_force uint32_t)be32); @@ -61,7 +61,7 @@ _ODP_INLINE uint32_t odp_be_to_cpu_32(odp_u32be_t be32) #endif }
-_ODP_INLINE uint64_t odp_be_to_cpu_64(odp_u64be_t be64) +static inline uint64_t _odp_be_to_cpu_64(odp_u64be_t be64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return __builtin_bswap64((__odp_force uint64_t)be64); @@ -70,7 +70,7 @@ _ODP_INLINE uint64_t odp_be_to_cpu_64(odp_u64be_t be64) #endif }
-_ODP_INLINE odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16) +static inline odp_u16be_t _odp_cpu_to_be_16(uint16_t cpu16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u16be_t)__odp_builtin_bswap16(cpu16); @@ -79,7 +79,7 @@ _ODP_INLINE odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16) #endif }
-_ODP_INLINE odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32) +static inline odp_u32be_t _odp_cpu_to_be_32(uint32_t cpu32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u32be_t)__builtin_bswap32(cpu32); @@ -88,7 +88,7 @@ _ODP_INLINE odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32) #endif }
-_ODP_INLINE odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64) +static inline odp_u64be_t _odp_cpu_to_be_64(uint64_t cpu64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u64be_t)__builtin_bswap64(cpu64); @@ -97,7 +97,7 @@ _ODP_INLINE odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64) #endif }
-_ODP_INLINE uint16_t odp_le_to_cpu_16(odp_u16le_t le16) +static inline uint16_t _odp_le_to_cpu_16(odp_u16le_t le16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force uint16_t)le16; @@ -106,7 +106,7 @@ _ODP_INLINE uint16_t odp_le_to_cpu_16(odp_u16le_t le16) #endif }
-_ODP_INLINE uint32_t odp_le_to_cpu_32(odp_u32le_t le32) +static inline uint32_t _odp_le_to_cpu_32(odp_u32le_t le32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force uint32_t)le32; @@ -115,7 +115,7 @@ _ODP_INLINE uint32_t odp_le_to_cpu_32(odp_u32le_t le32) #endif }
-_ODP_INLINE uint64_t odp_le_to_cpu_64(odp_u64le_t le64) +static inline uint64_t _odp_le_to_cpu_64(odp_u64le_t le64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force uint64_t)le64; @@ -124,7 +124,7 @@ _ODP_INLINE uint64_t odp_le_to_cpu_64(odp_u64le_t le64) #endif }
-_ODP_INLINE odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16) +static inline odp_u16le_t _odp_cpu_to_le_16(uint16_t cpu16) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u16le_t)cpu16; @@ -133,7 +133,7 @@ _ODP_INLINE odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16) #endif }
-_ODP_INLINE odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32) +static inline odp_u32le_t _odp_cpu_to_le_32(uint32_t cpu32) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u32le_t)cpu32; @@ -142,7 +142,7 @@ _ODP_INLINE odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32) #endif }
-_ODP_INLINE odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64) +static inline odp_u64le_t _odp_cpu_to_le_64(uint64_t cpu64) { #if ODP_BYTE_ORDER == ODP_LITTLE_ENDIAN return (__odp_force odp_u64le_t)cpu64; diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_inlines_api.h b/platform/linux-generic/include/odp/api/plat/byteorder_inlines_api.h new file mode 100644 index 00000000..ef81d74d --- /dev/null +++ b/platform/linux-generic/include/odp/api/plat/byteorder_inlines_api.h @@ -0,0 +1,88 @@ +/* Copyright (c) 2018, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP byteorder + */ + +#ifndef ODP_PLAT_BYTEORDER_INLINES_API_H_ +#define ODP_PLAT_BYTEORDER_INLINES_API_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +_ODP_INLINE uint16_t odp_be_to_cpu_16(odp_u16be_t be16) +{ + return _odp_be_to_cpu_16(be16); +} + +_ODP_INLINE uint32_t odp_be_to_cpu_32(odp_u32be_t be32) +{ + return _odp_be_to_cpu_32(be32); +} + +_ODP_INLINE uint64_t odp_be_to_cpu_64(odp_u64be_t be64) +{ + return _odp_be_to_cpu_64(be64); +} + +_ODP_INLINE odp_u16be_t odp_cpu_to_be_16(uint16_t cpu16) +{ + return _odp_cpu_to_be_16(cpu16); +} + +_ODP_INLINE odp_u32be_t odp_cpu_to_be_32(uint32_t cpu32) +{ + return _odp_cpu_to_be_32(cpu32); +} + +_ODP_INLINE odp_u64be_t odp_cpu_to_be_64(uint64_t cpu64) +{ + return _odp_cpu_to_be_64(cpu64); +} + +_ODP_INLINE uint16_t odp_le_to_cpu_16(odp_u16le_t le16) +{ + return _odp_le_to_cpu_16(le16); +} + +_ODP_INLINE uint32_t odp_le_to_cpu_32(odp_u32le_t le32) +{ + return _odp_le_to_cpu_32(le32); +} + +_ODP_INLINE uint64_t odp_le_to_cpu_64(odp_u64le_t le64) +{ + return _odp_le_to_cpu_64(le64); +} + +_ODP_INLINE odp_u16le_t odp_cpu_to_le_16(uint16_t cpu16) +{ + return _odp_cpu_to_le_16(cpu16); +} + +_ODP_INLINE odp_u32le_t odp_cpu_to_le_32(uint32_t cpu32) +{ + return _odp_cpu_to_le_32(cpu32); +} + +_ODP_INLINE odp_u64le_t odp_cpu_to_le_64(uint64_t cpu64) +{ + return _odp_cpu_to_le_64(cpu64); +} + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/odp_byteorder.c b/platform/linux-generic/odp_byteorder.c index ff0b74b2..9cfb05d3 100644 --- a/platform/linux-generic/odp_byteorder.c +++ b/platform/linux-generic/odp_byteorder.c @@ -11,3 +11,4 @@ /* Include non-inlined versions of API functions */ #define _ODP_INLINE #include <odp/api/plat/byteorder_inlines.h> +#include <odp/api/plat/byteorder_inlines_api.h>
commit 33afa2d1d4f6df342214dd9d9e4aab4433da3d7d Author: Petri Savolainen petri.savolainen@linaro.org Date: Fri Jan 19 16:00:39 2018 +0200
linux-gen: remove static_inline header
This header file is not referenced anywhere. Remove it.
Signed-off-by: Petri Savolainen petri.savolainen@linaro.org Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp/api/plat/static_inline.h b/platform/linux-generic/include/odp/api/plat/static_inline.h deleted file mode 100644 index 633e2f27..00000000 --- a/platform/linux-generic/include/odp/api/plat/static_inline.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (c) 2016, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/** - * @file - * - * Macro for static inline functions - */ - -#ifndef ODP_PLAT_STATIC_INLINE_H_ -#define ODP_PLAT_STATIC_INLINE_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @internal - * @def ODP_ABI_COMPAT - * Control ABI compatibility - */ - -/** - * @internal - * @def _ODP_INLINE - * Define a function as inlined or not inlined (for ABI compatibility) - */ -#if 1 -#define ODP_ABI_COMPAT 1 -#define _ODP_INLINE -#else -#define ODP_ABI_COMPAT 0 -#define _ODP_INLINE static inline -#endif - -#ifdef __cplusplus -} -#endif - -#endif
commit 29e5037571610ee49830dd64a43a47a8ccbadb87 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Mon Jan 1 23:39:28 2018 +0300
travis: run tests with dynamically-linked tests
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bogdan Pricope bogdan.pricope@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/.travis.yml b/.travis.yml index b614668c..14bc1b14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -74,6 +74,7 @@ env: - CONF="--enable-schedule-iquery" - CONF="--enable-schedule-scalable" - CONF="--enable-dpdk-zero-copy" + - CONF="--disable-static-applications" - CROSS_ARCH="arm64" - CROSS_ARCH="armhf" CFLAGS="-march=armv7-a" - CROSS_ARCH="powerpc"
commit 988ae5930a9db1ceb88e46a84a116e67b0108307 Author: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Date: Sun Dec 31 04:11:34 2017 +0300
build: provide an option to link examples dynamically
Distributions won't like statically-linked binaries. Provide configure switch to link examples and tests dynamically.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bogdan Pricope bogdan.pricope@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/configure.ac b/configure.ac index 0c8799f1..56a422b4 100644 --- a/configure.ac +++ b/configure.ac @@ -182,6 +182,16 @@ AS_IF([test "${with_platform}" = "linux-generic"], AC_DEFINE_UNQUOTED([IMPLEMENTATION_NAME], ["$IMPLEMENTATION_NAME"], [Define to the name of the implementation])
+########################################################################## +# Build examples/tests dynamically +########################################################################## +AC_ARG_ENABLE([static-applications], + [AS_HELP_STRING([--disable-static-applications], + [disable static linking of examples and tests] + [ with ODP])], [], + [enable_static_applications=yes]) +AM_CONDITIONAL([STATIC_APPS], [test "x$enable_static_applications" != "xno"]) + ########################################################################## # Include m4 files ########################################################################## @@ -393,6 +403,7 @@ AC_MSG_RESULT([ Deprecated APIs: ${deprecated} debug: ${enable_debug} cunit: ${cunit_support} + static tests linkage: ${enable_static_applications} test_vald: ${test_vald} test_perf: ${test_perf} test_perf_proc: ${test_perf_proc} diff --git a/example/Makefile.inc b/example/Makefile.inc index 4a15ee7e..3c8060da 100644 --- a/example/Makefile.inc +++ b/example/Makefile.inc @@ -2,11 +2,21 @@ include $(top_srcdir)/Makefile.inc
TESTS_ENVIRONMENT = EXEEXT=${EXEEXT}
-LDADD = $(LIB)/libodp-linux.la $(LIB)/libodphelper.la $(DPDK_LIBS_LT) +LDADD = $(LIB)/libodp-linux.la $(LIB)/libodphelper.la + +# Do not link to DPDK twice in case of dynamic linking with ODP +if STATIC_APPS +LDADD += $(DPDK_LIBS_LT) +endif + AM_CFLAGS = \ -I$(srcdir) \ -I$(top_srcdir)/example \ $(ODP_INCLUDES) \ $(HELPER_INCLUDES)
+if STATIC_APPS AM_LDFLAGS = -L$(LIB) -static +else +AM_LDFLAGS = +endif diff --git a/platform/linux-generic/test/Makefile.am b/platform/linux-generic/test/Makefile.am index 97784a02..99934099 100644 --- a/platform/linux-generic/test/Makefile.am +++ b/platform/linux-generic/test/Makefile.am @@ -6,8 +6,7 @@ SUBDIRS = performance if test_vald TESTS = validation/api/pktio/pktio_run.sh \ validation/api/pktio/pktio_run_tap.sh \ - validation/api/shmem/shmem_linux$(EXEEXT) \ - ring/ring_main$(EXEEXT) + validation/api/shmem/shmem_linux$(EXEEXT)
SUBDIRS += validation/api/pktio\ validation/api/shmem\ diff --git a/platform/linux-generic/test/ring/Makefile.am b/platform/linux-generic/test/ring/Makefile.am index edaf4510..3f774342 100644 --- a/platform/linux-generic/test/ring/Makefile.am +++ b/platform/linux-generic/test/ring/Makefile.am @@ -1,3 +1,7 @@ +# ring test uses internal symbols from libodp-linux which are not available +# when linking test with libodp-linux.so +if STATIC_APPS + include $(top_srcdir)/test/Makefile.inc
test_PROGRAMS = ring_main @@ -6,7 +10,27 @@ ring_main_SOURCES = \ ring_suites.c ring_suites.h \ ring_basic.c ring_stress.c
+TESTS = ring_main$(EXEEXT) + PRELDADD += $(LIBCUNIT_COMMON)
-AM_CPPFLAGS += \ - -I$(top_srcdir)/platform/linux-generic/include +AM_CPPFLAGS += -I$(top_srcdir)/platform/linux-generic/include + +TESTNAME = linux-generic-ring + +TESTENV = tests-$(TESTNAME).env + +test_DATA = $(TESTENV) + +DISTCLEANFILES = $(TESTENV) +.PHONY: $(TESTENV) +$(TESTENV): + echo "TESTS="$(TESTS)"" > $@ + echo "$(TESTS_ENVIRONMENT)" >> $@ + echo "$(LOG_COMPILER)" >> $@ + +if test_installdir +installcheck-local: + $(DESTDIR)/$(testdir)/run-test.sh $(TESTNAME) +endif +endif diff --git a/test/Makefile.inc b/test/Makefile.inc index 83004f0c..55a493a8 100644 --- a/test/Makefile.inc +++ b/test/Makefile.inc @@ -11,16 +11,26 @@ LIBTHRMASK_COMMON = $(COMMON_DIR)/libthrmask_common.la #in the following line, the libs using the symbols should come before #the libs containing them! The includer is given a chance to add things #before libodp by setting PRELDADD before the inclusion. -LDADD = $(PRELDADD) $(LIBODP) $(DPDK_LIBS_LT) +LDADD = $(PRELDADD) $(LIBODP) PRELDADD =
AM_CPPFLAGS = \ $(ODP_INCLUDES) \ $(HELPER_INCLUDES) \ -I$(top_srcdir)/test/common + +# Do not link to DPDK twice in case of dynamic linking with ODP +if STATIC_APPS +LDADD += $(DPDK_LIBS_LT) +endif + AM_CFLAGS = $(CUNIT_CFLAGS)
+if STATIC_APPS AM_LDFLAGS = -L$(LIB) -static +else +AM_LDFLAGS = +endif
@VALGRIND_CHECK_RULES@
-----------------------------------------------------------------------
Summary of changes: .travis.yml | 1 + configure.ac | 11 +++ example/Makefile.inc | 12 ++- platform/linux-generic/Makefile.am | 1 + .../include-abi/odp/api/abi/byteorder.h | 1 + .../include/odp/api/plat/byteorder_inlines.h | 24 +++--- .../include/odp/api/plat/byteorder_inlines_api.h | 88 ++++++++++++++++++++++ .../include/odp/api/plat/static_inline.h | 43 ----------- .../include/odp_classification_inlines.h | 30 ++++---- platform/linux-generic/include/protocols/thash.h | 8 +- platform/linux-generic/odp_byteorder.c | 1 + platform/linux-generic/odp_classification.c | 2 +- platform/linux-generic/odp_ipsec.c | 66 ++++++++-------- platform/linux-generic/odp_packet.c | 41 +++++----- platform/linux-generic/odp_traffic_mngr.c | 13 ++-- platform/linux-generic/test/Makefile.am | 3 +- platform/linux-generic/test/ring/Makefile.am | 28 ++++++- test/Makefile.inc | 12 ++- 18 files changed, 247 insertions(+), 138 deletions(-) create mode 100644 platform/linux-generic/include/odp/api/plat/byteorder_inlines_api.h delete mode 100644 platform/linux-generic/include/odp/api/plat/static_inline.h
hooks/post-receive