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 6d23501cc7d67d9903efcc2c288276b79eef5044 (commit) via de7c1b2d50edf15815f8c908d09a5cffb1a4ae99 (commit) via 39c9f9f9d33ccebc2a371da45b7ac19d83ff4899 (commit) via fd0bfca978295d9a955e2034d7f2d6c937ce0403 (commit) via 94252435db7b5710be849454de3c6028c16fb0b9 (commit) via 01d0836470d4475db832ae5fe72bfc8b169ad079 (commit) via e9848f21aa601c6f37df574e8e3ce5da28ff58f7 (commit) from 6b581d0633209527f2fb3f63fcd5a4986f5c0891 (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 6d23501cc7d67d9903efcc2c288276b79eef5044 Author: Petri Savolainen petri.savolainen@nokia.com Date: Thu Jun 27 12:11:17 2019 +0300
travis: test build with lto
Added test cases for GCC build with Link Time Optimization (LTO). Compiler checks code over multiple files simultaneously and thus finds more errors / warnings.
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/.travis.yml b/.travis.yml index 9fbc1e47e..e07fadf61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,6 +58,10 @@ env: - CHECK=0 CONF="CFLAGS=-O0 --enable-debug --enable-debug-print" - CHECK=0 OS=ubuntu_18.04 CONF="CFLAGS=-O3" - CHECK=0 OS=ubuntu_18.04 CONF="CFLAGS=-O0 --enable-debug --enable-debug-print" + - CHECK=0 CONF="--enable-lto" + - CHECK=0 CONF="--enable-lto --disable-abi-compat" + - CHECK=0 OS=ubuntu_18.04 CONF="--enable-lto" + - CHECK=0 OS=ubuntu_18.04 CONF="--enable-lto --disable-abi-compat" - CHECK=0 ARCH=arm64 - CHECK=0 ARCH=armhf - CHECK=0 ARCH=powerpc @@ -85,6 +89,14 @@ matrix: env: CHECK=0 ARCH=arm64 - compiler: gcc env: CHECK=0 ARCH=i386 + - compiler: clang + env: CHECK=0 CONF="--enable-lto" + - compiler: clang + env: CHECK=0 CONF="--enable-lto --disable-abi-compat" + - compiler: clang + env: CHECK=0 OS=ubuntu_18.04 CONF="--enable-lto" + - compiler: clang + env: CHECK=0 OS=ubuntu_18.04 CONF="--enable-lto --disable-abi-compat"
install: - if [ ${NETMAP} -eq 1 ] ; then
commit de7c1b2d50edf15815f8c908d09a5cffb1a4ae99 Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Jun 26 13:47:36 2019 +0300
configure: add --enable-lto option
Added option to build with link time optimization (-flto flag).
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/configure.ac b/configure.ac index 536999386..a90993e41 100644 --- a/configure.ac +++ b/configure.ac @@ -238,6 +238,24 @@ AC_ARG_ENABLE([abi-compat], fi]) AM_CONDITIONAL(ODP_ABI_COMPAT, [test "x$ODP_ABI_COMPAT" = "x1"])
+########################################################################## +# Enable/disable link time optimization +########################################################################## +lto_enabled=no +AC_ARG_ENABLE([lto], + [AS_HELP_STRING([--enable-lto], + [Enable Link Time Optimization (LTO) in compiler and linker])], + [if test "x$enableval" = "xyes"; then + lto_enabled=yes + # Fat LTO object file contains GIMPLE bytecodes and the usual + # final code. There are less build problems (e.g. due to older + # binutils), but object files are larger. + ODP_LTO_FLAGS="-flto -ffat-lto-objects" + fi]) +AC_SUBST(ODP_LTO_FLAGS) + +ODP_CFLAGS="$ODP_CFLAGS $ODP_LTO_FLAGS" + ########################################################################## # Determine which platform to build for ########################################################################## @@ -383,6 +401,7 @@ AC_SUBST(ODP_DEPRECATED_API) ########################################################################## CFLAGS="$CFLAGS $ODP_CFLAGS" CXXFLAGS="$CXXFLAGS $ODP_CXXFLAGS" +LDFLAGS="$LDFLAGS $ODP_LTO_FLAGS"
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([include/Makefile @@ -436,7 +455,8 @@ AC_MSG_RESULT([ static libraries: ${enable_static} shared libraries: ${enable_shared} ABI compatible: ${abi_compat} - Deprecated APIs: ${deprecated} + link time optimization: ${lto_enabled} + deprecated APIs: ${deprecated} debug: ${enable_debug} cunit: ${cunit_support} static tests linkage: ${enable_static_applications}
commit 39c9f9f9d33ccebc2a371da45b7ac19d83ff4899 Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Jun 26 15:59:46 2019 +0300
test: fix variable may be used uninitialized warnings
Fix compiler warning: "X may be used uninitialized in this function". These warnings were found when building with link time optimization (-flto flag).
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/test/performance/odp_bench_packet.c b/test/performance/odp_bench_packet.c index 9b779e98c..c89e86d8d 100644 --- a/test/performance/odp_bench_packet.c +++ b/test/performance/odp_bench_packet.c @@ -519,6 +519,10 @@ static int bench_packet_alloc_free_multi(void) pkts = odp_packet_alloc_multi(gbl_args->pool, gbl_args->pkt.len, gbl_args->pkt_tbl, gbl_args->appl.burst_size); + + if (pkts < 0) + LOG_ABORT("Packet alloc failed\n"); + odp_packet_free_multi(gbl_args->pkt_tbl, pkts); } return i;
commit fd0bfca978295d9a955e2034d7f2d6c937ce0403 Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Jun 26 15:59:05 2019 +0300
example: fix variable may be used uninitialized warnings
Fix compiler warning: "X may be used uninitialized in this function". These warnings were found when building with link time optimization (-flto flag).
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/example/ipfragreass/odp_ipfragreass_helpers.c b/example/ipfragreass/odp_ipfragreass_helpers.c index e7755f242..ac737fe44 100644 --- a/example/ipfragreass/odp_ipfragreass_helpers.c +++ b/example/ipfragreass/odp_ipfragreass_helpers.c @@ -20,9 +20,9 @@ static void set_random_payload(odp_packet_t packet, uint32_t payload_offset, uint32_t size) { uint32_t i, j; - uint32_t bytes_remaining; unsigned char *buffer; unsigned char seed = rand() % (UINT8_MAX + 1); + uint32_t bytes_remaining = 0;
/* * Set the payload to a run of consecutive numbers from a random seed. @@ -99,11 +99,11 @@ int packet_memcmp(odp_packet_t a, odp_packet_t b, uint32_t offset_a, { uint32_t i = 0; void *data_a, *data_b; + uint32_t bytes_remaining_a = 0; + uint32_t bytes_remaining_b = 0;
while (i < length) { int status; - uint32_t bytes_remaining_a; - uint32_t bytes_remaining_b; uint32_t bytes_remaining;
data_a = odp_packet_offset(a, offset_a + i, &bytes_remaining_a,
commit 94252435db7b5710be849454de3c6028c16fb0b9 Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Jun 26 13:46:16 2019 +0300
validation: fix variable may be used uninitialized warnings
Fix compiler warning: "X may be used uninitialized in this function". These warnings were found when building with link time optimization (-flto flag).
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/test/validation/api/classification/odp_classification_common.c b/test/validation/api/classification/odp_classification_common.c index 9b5d8ec0e..80eb9e3c4 100644 --- a/test/validation/api/classification/odp_classification_common.c +++ b/test/validation/api/classification/odp_classification_common.c @@ -180,8 +180,15 @@ int parse_ipv4_string(const char *ipaddress, uint32_t *addr, uint32_t *mask) void enqueue_pktio_interface(odp_packet_t pkt, odp_pktio_t pktio) { odp_pktout_queue_t pktout; + int ret; + + ret = odp_pktout_queue(pktio, &pktout, 1); + + if (ret != 1) { + CU_FAIL_FATAL("No pktout queue"); + return; + }
- CU_ASSERT_FATAL(odp_pktout_queue(pktio, &pktout, 1) == 1); CU_ASSERT(odp_pktout_send(pktout, &pkt, 1) == 1); }
diff --git a/test/validation/api/ipsec/ipsec.c b/test/validation/api/ipsec/ipsec.c index 31776bd29..1b17f082e 100644 --- a/test/validation/api/ipsec/ipsec.c +++ b/test/validation/api/ipsec/ipsec.c @@ -398,6 +398,7 @@ void ipsec_sa_destroy(odp_ipsec_sa_t sa) { odp_event_t event; odp_ipsec_status_t status; + int ret;
CU_ASSERT_EQUAL(IPSEC_SA_CTX, odp_ipsec_sa_context(sa));
@@ -410,12 +411,15 @@ void ipsec_sa_destroy(odp_ipsec_sa_t sa)
CU_ASSERT_EQUAL(ODP_EVENT_IPSEC_STATUS, odp_event_type(event));
- CU_ASSERT_EQUAL(ODP_IPSEC_OK, odp_ipsec_status(&status, event)); + ret = odp_ipsec_status(&status, event); + CU_ASSERT(ret == 0);
- CU_ASSERT_EQUAL(ODP_IPSEC_STATUS_SA_DISABLE, status.id); - CU_ASSERT_EQUAL(sa, status.sa); - CU_ASSERT_EQUAL(0, status.result); - CU_ASSERT_EQUAL(0, status.warn.all); + if (ret == 0) { + CU_ASSERT_EQUAL(ODP_IPSEC_STATUS_SA_DISABLE, status.id); + CU_ASSERT_EQUAL(sa, status.sa); + CU_ASSERT_EQUAL(0, status.result); + CU_ASSERT_EQUAL(0, status.warn.all); + }
odp_event_free(event); } @@ -570,11 +574,13 @@ static int ipsec_send_in_one(const ipsec_test_part *part, ODP_EVENT_PACKET_IPSEC); } } else { - odp_queue_t queue; odp_pktout_queue_t pktout; + odp_queue_t queue = ODP_QUEUE_INVALID;
- CU_ASSERT_EQUAL_FATAL(1, odp_pktout_queue(suite_context.pktio, - &pktout, 1)); + if (odp_pktout_queue(suite_context.pktio, &pktout, 1) != 1) { + CU_FAIL_FATAL("No pktout queue"); + return 0; + }
CU_ASSERT_EQUAL(1, odp_pktout_send(pktout, &pkt, 1)); CU_ASSERT_EQUAL_FATAL(1, @@ -662,9 +668,9 @@ static int ipsec_send_out_one(const ipsec_test_part *part, } } else { struct odp_ipsec_out_inline_param_t inline_param; - odp_queue_t queue; uint32_t hdr_len; uint8_t hdr[32]; + odp_queue_t queue = ODP_QUEUE_INVALID;
if (NULL != part->out[0].pkt_out) { hdr_len = part->out[0].pkt_out->l3_offset; diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index 0f019f6c9..352fa62c9 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -85,13 +85,16 @@ static void _packet_compare_data(odp_packet_t pkt1, odp_packet_t pkt2, uint32_t len = odp_packet_len(pkt1); uint32_t offset = 0; uint32_t seglen1, seglen2, cmplen; + void *pkt1map, *pkt2map; int ret;
CU_ASSERT_FATAL(len == odp_packet_len(pkt2));
while (len > 0) { - void *pkt1map = odp_packet_offset(pkt1, offset, &seglen1, NULL); - void *pkt2map = odp_packet_offset(pkt2, offset, &seglen2, NULL); + seglen1 = 0; + seglen2 = 0; + pkt1map = odp_packet_offset(pkt1, offset, &seglen1, NULL); + pkt2map = odp_packet_offset(pkt2, offset, &seglen2, NULL);
CU_ASSERT_PTR_NOT_NULL_FATAL(pkt1map); CU_ASSERT_PTR_NOT_NULL_FATAL(pkt2map); @@ -787,7 +790,7 @@ static void packet_test_layer_offsets(void) { odp_packet_t pkt = test_packet; uint8_t *l2_addr, *l3_addr, *l4_addr; - uint32_t seg_len; + uint32_t seg_len = 0; const uint32_t l2_off = 2; const uint32_t l3_off = l2_off + 14; const uint32_t l4_off = l3_off + 14; @@ -1342,6 +1345,7 @@ static void _packet_compare_offset(odp_packet_t pkt1, uint32_t off1, odp_packet_t pkt2, uint32_t off2, uint32_t len, int line) { + void *pkt1map, *pkt2map; uint32_t seglen1, seglen2, cmplen; int ret;
@@ -1350,8 +1354,10 @@ static void _packet_compare_offset(odp_packet_t pkt1, uint32_t off1, return;
while (len > 0) { - void *pkt1map = odp_packet_offset(pkt1, off1, &seglen1, NULL); - void *pkt2map = odp_packet_offset(pkt2, off2, &seglen2, NULL); + seglen1 = 0; + seglen2 = 0; + pkt1map = odp_packet_offset(pkt1, off1, &seglen1, NULL); + pkt2map = odp_packet_offset(pkt2, off2, &seglen2, NULL);
CU_ASSERT_PTR_NOT_NULL_FATAL(pkt1map); CU_ASSERT_PTR_NOT_NULL_FATAL(pkt2map); @@ -2221,9 +2227,9 @@ static void packet_test_offset(void) { odp_packet_t pkt = test_packet; uint32_t seg_len, full_seg_len; - odp_packet_seg_t seg; uint8_t *ptr, *start_ptr; uint32_t offset; + odp_packet_seg_t seg = ODP_PACKET_SEG_INVALID;
ptr = odp_packet_offset(pkt, 0, &seg_len, &seg); CU_ASSERT(seg != ODP_PACKET_SEG_INVALID); diff --git a/test/validation/api/pktio/pktio.c b/test/validation/api/pktio/pktio.c index 15f58e95a..ae7ccbb6b 100644 --- a/test/validation/api/pktio/pktio.c +++ b/test/validation/api/pktio/pktio.c @@ -550,12 +550,18 @@ static int get_packets(pktio_info_t *pktio_rx, odp_packet_t pkt_tbl[], odp_event_t evt_tbl[num]; int num_evts = 0; int num_pkts = 0; - int i; + int i, ret;
if (pktio_rx->in_mode == ODP_PKTIN_MODE_DIRECT) { odp_pktin_queue_t pktin;
- CU_ASSERT_FATAL(odp_pktin_queue(pktio_rx->id, &pktin, 1) == 1); + ret = odp_pktin_queue(pktio_rx->id, &pktin, 1); + + if (ret != 1) { + CU_FAIL_FATAL("No pktin queues"); + return -1; + } + return odp_pktin_recv(pktin, pkt_tbl, num); }
@@ -837,7 +843,7 @@ static void test_txrx(odp_pktin_mode_t in_mode, int num_pkts, /* create pktios and associate input/output queues */ for (i = 0; i < num_ifaces; ++i) { odp_pktout_queue_t pktout; - odp_queue_t queue; + odp_queue_t queue = ODP_QUEUE_INVALID; odp_pktout_mode_t out_mode = ODP_PKTOUT_MODE_DIRECT;
if (mode == TXRX_MODE_MULTI_EVENT) @@ -859,7 +865,6 @@ static void test_txrx(odp_pktin_mode_t in_mode, int num_pkts, CU_ASSERT_FATAL(odp_pktout_queue(io->id, &pktout, 1) == 1); io->pktout = pktout; - queue = ODP_QUEUE_INVALID; }
io->queue_out = queue; diff --git a/test/validation/api/pool/pool.c b/test/validation/api/pool/pool.c index 0dbdd0ddf..c3def1b05 100644 --- a/test/validation/api/pool/pool.c +++ b/test/validation/api/pool/pool.c @@ -216,6 +216,7 @@ static void pool_test_info_packet(void) pool = odp_pool_create(pool_name, ¶m); CU_ASSERT_FATAL(pool != ODP_POOL_INVALID);
+ memset(&info, 0, sizeof(odp_pool_info_t)); CU_ASSERT_FATAL(odp_pool_info(pool, &info) == 0);
CU_ASSERT(strncmp(pool_name, info.name, sizeof(pool_name)) == 0); @@ -262,7 +263,8 @@ static void pool_test_info_data_range(void)
for (i = 0; i < num; i++) { uintptr_t pkt_data, pkt_data_end; - uint32_t offset = 0, seg_len; + uint32_t offset = 0; + uint32_t seg_len = 0; uint32_t pkt_len = odp_packet_len(pkt[i]);
while (offset < pkt_len) { diff --git a/test/validation/api/traffic_mngr/traffic_mngr.c b/test/validation/api/traffic_mngr/traffic_mngr.c index 9b9e73b71..f18957d24 100644 --- a/test/validation/api/traffic_mngr/traffic_mngr.c +++ b/test/validation/api/traffic_mngr/traffic_mngr.c @@ -648,8 +648,9 @@ static int get_ip_tos(odp_packet_t odp_pkt, uint8_t *tos_ptr) { odph_ipv4hdr_t *ipv4_hdr; odph_ipv6hdr_t *ipv6_hdr; - uint32_t hdr_len, ver_tc_flow; + uint32_t ver_tc_flow; uint8_t tos, tc; + uint32_t hdr_len = 0;
if (odp_packet_has_ipv4(odp_pkt)) { ipv4_hdr = odp_packet_l3_ptr(odp_pkt, &hdr_len); @@ -2243,6 +2244,7 @@ static void check_threshold_profile(char *threshold_name, { odp_tm_threshold_params_t threshold_params; odp_tm_threshold_t profile; + int ret;
profile = odp_tm_thresholds_lookup(threshold_name); CU_ASSERT(profile != ODP_TM_INVALID); @@ -2251,7 +2253,12 @@ static void check_threshold_profile(char *threshold_name, if (profile == threshold_profiles[threshold_idx - 1]) return;
- odp_tm_thresholds_params_read(profile, &threshold_params); + ret = odp_tm_thresholds_params_read(profile, &threshold_params); + CU_ASSERT(ret == 0); + + if (ret) + return; + CU_ASSERT(threshold_params.max_pkts == threshold_idx * MIN_PKT_THRESHOLD); CU_ASSERT(threshold_params.max_bytes == @@ -2307,6 +2314,7 @@ static void check_wred_profile(char *wred_name, { odp_tm_wred_params_t wred_params; odp_tm_wred_t profile; + int ret;
profile = odp_tm_wred_lookup(wred_name); CU_ASSERT(profile != ODP_TM_INVALID); @@ -2314,7 +2322,12 @@ static void check_wred_profile(char *wred_name, if (profile != wred_profiles[wred_idx - 1][color]) return;
- odp_tm_wred_params_read(profile, &wred_params); + ret = odp_tm_wred_params_read(profile, &wred_params); + CU_ASSERT(ret == 0); + + if (ret) + return; + CU_ASSERT(wred_params.min_threshold == wred_idx * MIN_WRED_THRESH); CU_ASSERT(wred_params.med_threshold == wred_idx * MED_WRED_THRESH); CU_ASSERT(wred_params.med_drop_prob == wred_idx * MED_DROP_PROB);
commit 01d0836470d4475db832ae5fe72bfc8b169ad079 Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Jun 26 15:57:43 2019 +0300
helper: fix variable may be used uninitialized warnings
Fix compiler warning: "X may be used uninitialized in this function". These warnings were found when building with link time optimization (-flto flag).
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/helper/chksum.c b/helper/chksum.c index 7c7c20a2f..c3e712421 100644 --- a/helper/chksum.c +++ b/helper/chksum.c @@ -106,9 +106,10 @@ static inline int odph_process_l4_hdr(odp_packet_t odp_pkt, odph_udphdr_t *udp_hdr_ptr; odph_tcphdr_t *tcp_hdr_ptr; odp_bool_t split_l4_hdr, is_tcp; - uint32_t l4_offset, l4_len, hdr_len, pkt_chksum_offset; + uint32_t l4_offset, l4_len, pkt_chksum_offset; uint16_t *pkt_chksum_ptr; uint8_t *l4_ptr; + uint32_t hdr_len = 0;
/* Parse the TCP/UDP header. */ l4_offset = odp_packet_l4_offset(odp_pkt); @@ -185,9 +186,10 @@ static inline int odph_process_l3_hdr(odp_packet_t odp_pkt, odph_ipv6hdr_t *ipv6_hdr_ptr, ipv6_hdr; odp_bool_t split_l3_hdr; swap_buf_t swap_buf; - uint32_t l3_offset, l4_offset, l3_hdrs_len, hdr_len, addrs_len; + uint32_t l3_offset, l4_offset, l3_hdrs_len, addrs_len; uint32_t protocol, l3_len, l4_len, idx, ipv6_payload_len, sum; uint16_t *addrs_ptr; + uint32_t hdr_len = 0;
/* The following computation using the l3 and l4 offsets handles both * the case of IPv4 options and IPv6 extension headers uniformly. */ @@ -271,11 +273,12 @@ int odph_udp_tcp_chksum(odp_packet_t odp_pkt, odph_l4_hdr_t udp_tcp_hdr; odp_bool_t split_l4_hdr, is_tcp, is_last; odp_bool_t has_odd_byte_in; - uint32_t l4_len, sum, ones_compl_sum, remaining_seg_len; + uint32_t l4_len, sum, ones_compl_sum; uint32_t data_len, pkt_chksum_offset, offset; uint16_t *pkt_chksum_ptr, chksum; uint8_t *data_ptr, odd_byte_in_out; int rc, ret_code; + uint32_t remaining_seg_len = 0;
/* First parse and process the l4 header */ rc = odph_process_l4_hdr(odp_pkt, op, &udp_tcp_hdr, chksum_ptr, &l4_len, @@ -364,7 +367,7 @@ static uint32_t odph_packet_crc32c(odp_packet_t pkt, return sum;
while (length > 0) { - uint32_t seg_len; + uint32_t seg_len = 0; void *data = odp_packet_offset(pkt, offset, &seg_len, NULL);
if (seg_len > length)
commit e9848f21aa601c6f37df574e8e3ce5da28ff58f7 Author: Petri Savolainen petri.savolainen@nokia.com Date: Wed Jun 26 13:41:15 2019 +0300
linux-gen: fix variable may be used uninitialized warnings
Fix compiler warning: "X may be used uninitialized in this function". These warnings were found when building with link time optimization (-flto flag).
Signed-off-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/platform/linux-generic/odp_ipsec.c b/platform/linux-generic/odp_ipsec.c index 8430d707c..cd1baa51a 100644 --- a/platform/linux-generic/odp_ipsec.c +++ b/platform/linux-generic/odp_ipsec.c @@ -1876,7 +1876,7 @@ int odp_ipsec_out_inline(const odp_packet_t pkt_in[], int num_in, odp_pktout_queue_t pkqueue;
if (odp_pktout_queue(inline_param[in_pkt].pktio, - &pkqueue, 1) < 0) { + &pkqueue, 1) <= 0) { status.error.alg = 1; goto err; } diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index 1bf0469e7..bb3c46a7b 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -1642,6 +1642,11 @@ int odp_pktin_event_queue(odp_pktio_t pktio, odp_queue_t queues[], int num) return -1; }
+ if (num < 0) { + ODP_DBG("Bad param: num %i\n", num); + return -1; + } + mode = entry->s.param.in_mode;
if (mode == ODP_PKTIN_MODE_DISABLED) @@ -1653,8 +1658,11 @@ int odp_pktin_event_queue(odp_pktio_t pktio, odp_queue_t queues[], int num)
num_queues = entry->s.num_in_queue;
- if (queues && num > 0) { - for (i = 0; i < num && i < num_queues; i++) + if (queues) { + if (num_queues < num) + num = num_queues; + + for (i = 0; i < num; i++) queues[i] = entry->s.in_queue[i].queue; }
@@ -1674,6 +1682,11 @@ int odp_pktin_queue(odp_pktio_t pktio, odp_pktin_queue_t queues[], int num) return -1; }
+ if (num < 0) { + ODP_DBG("Bad param: num %i\n", num); + return -1; + } + mode = entry->s.param.in_mode;
if (mode == ODP_PKTIN_MODE_DISABLED) @@ -1684,8 +1697,11 @@ int odp_pktin_queue(odp_pktio_t pktio, odp_pktin_queue_t queues[], int num)
num_queues = entry->s.num_in_queue;
- if (queues && num > 0) { - for (i = 0; i < num && i < num_queues; i++) + if (queues) { + if (num_queues < num) + num = num_queues; + + for (i = 0; i < num; i++) queues[i] = entry->s.in_queue[i].pktin; }
diff --git a/platform/linux-generic/odp_schedule_scalable.c b/platform/linux-generic/odp_schedule_scalable.c index d6d6d9ef6..a9e86cc56 100644 --- a/platform/linux-generic/odp_schedule_scalable.c +++ b/platform/linux-generic/odp_schedule_scalable.c @@ -777,7 +777,7 @@ static int poll_pktin(sched_elem_t *elem, odp_event_t ev[], int num_evts) /* For ordered queues only */ reorder_context_t *rctx; reorder_window_t *rwin = NULL; - uint32_t sn; + uint32_t sn = 0; uint32_t idx;
if (is_ordered(elem)) { diff --git a/platform/linux-generic/odp_traffic_mngr.c b/platform/linux-generic/odp_traffic_mngr.c index 23982dce0..19fdd7797 100644 --- a/platform/linux-generic/odp_traffic_mngr.c +++ b/platform/linux-generic/odp_traffic_mngr.c @@ -503,8 +503,8 @@ static void *tm_common_profile_create(const char *name, _odp_int_name_kind_t handle_kind; _odp_int_name_t name_tbl_id; tm_handle_t profile_handle; - uint32_t idx; void *object_ptr; + uint32_t idx = 0;
/* Note that alloc_entry_in_tbl will zero out all of the memory that it * allocates, so an additional memset here is unnecessary. */ @@ -2052,8 +2052,8 @@ static void egress_vlan_marking(tm_vlan_marking_t *vlan_marking, _odp_vlanhdr_t vlan_hdr, *vlan_hdr_ptr; _odp_ethhdr_t *ether_hdr_ptr; odp_bool_t split_hdr; - uint32_t hdr_len; uint16_t old_tci, new_tci; + uint32_t hdr_len = 0;
ether_hdr_ptr = odp_packet_l2_ptr(odp_pkt, &hdr_len); vlan_hdr_ptr = (_odp_vlanhdr_t *)(ether_hdr_ptr + 1); @@ -2091,8 +2091,9 @@ static void egress_ipv4_tos_marking(tm_tos_marking_t *tos_marking, { _odp_ipv4hdr_t ipv4_hdr, *ipv4_hdr_ptr; odp_bool_t split_hdr; - uint32_t hdr_len, l3_offset, old_chksum, ones_compl_sum, tos_diff; + uint32_t l3_offset, old_chksum, ones_compl_sum, tos_diff; uint8_t old_tos, new_tos, ecn; + uint32_t hdr_len = 0;
l3_offset = odp_packet_l3_offset(odp_pkt); ipv4_hdr_ptr = odp_packet_l3_ptr(odp_pkt, &hdr_len); @@ -2157,8 +2158,9 @@ static void egress_ipv6_tc_marking(tm_tos_marking_t *tos_marking, { _odp_ipv6hdr_t ipv6_hdr, *ipv6_hdr_ptr; odp_bool_t split_hdr; - uint32_t hdr_len, old_ver_tc_flow, new_ver_tc_flow, l3_offset; + uint32_t old_ver_tc_flow, new_ver_tc_flow, l3_offset; uint8_t old_tc, new_tc, ecn; + uint32_t hdr_len = 0;
l3_offset = odp_packet_l3_offset(odp_pkt); ipv6_hdr_ptr = odp_packet_l3_ptr(odp_pkt, &hdr_len); diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index cee97f2c4..cae838e83 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -442,10 +442,9 @@ static uint32_t _tx_pkt_to_iovec(odp_packet_t pkt, uint32_t pkt_len = odp_packet_len(pkt); uint32_t offset = 0; uint32_t iov_count = 0; + uint32_t seglen = 0;
while (offset < pkt_len) { - uint32_t seglen; - iovecs[iov_count].iov_base = odp_packet_offset(pkt, offset, &seglen, NULL); iovecs[iov_count].iov_len = seglen;
-----------------------------------------------------------------------
Summary of changes: .travis.yml | 12 +++++++++++ configure.ac | 22 +++++++++++++++++++- example/ipfragreass/odp_ipfragreass_helpers.c | 6 +++--- helper/chksum.c | 11 ++++++---- platform/linux-generic/odp_ipsec.c | 2 +- platform/linux-generic/odp_packet_io.c | 24 ++++++++++++++++++---- platform/linux-generic/odp_schedule_scalable.c | 2 +- platform/linux-generic/odp_traffic_mngr.c | 10 +++++---- platform/linux-generic/pktio/socket.c | 3 +-- test/performance/odp_bench_packet.c | 4 ++++ .../api/classification/odp_classification_common.c | 9 +++++++- test/validation/api/ipsec/ipsec.c | 24 ++++++++++++++-------- test/validation/api/packet/packet.c | 18 ++++++++++------ test/validation/api/pktio/pktio.c | 13 ++++++++---- test/validation/api/pool/pool.c | 4 +++- test/validation/api/traffic_mngr/traffic_mngr.c | 19 ++++++++++++++--- 16 files changed, 139 insertions(+), 44 deletions(-)
hooks/post-receive