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 9c0fc2112137a07b5265646338a4034662d299b3 (commit) from 0e2b3a3597d139df1ff5d3f0338aa5cf26e34a43 (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 9c0fc2112137a07b5265646338a4034662d299b3 Author: Balasubramanian Manoharan bala.manoharan@linaro.org Date: Thu Oct 27 18:30:55 2016 +0530
validation: classification: fix TCP/UDP checksum update
Fixes https://bugs.linaro.org/show_bug.cgi?id=2512
Signed-off-by: Balasubramanian Manoharan bala.manoharan@linaro.org Reviewed-by: Nikhil Agarwal nikhil.agarwal@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/common_plat/validation/api/classification/odp_classification_common.c b/test/common_plat/validation/api/classification/odp_classification_common.c index 7a42ac7..2923a71 100644 --- a/test/common_plat/validation/api/classification/odp_classification_common.c +++ b/test/common_plat/validation/api/classification/odp_classification_common.c @@ -11,6 +11,7 @@ #include <odp/helper/ip.h> #include <odp/helper/udp.h> #include <odp/helper/tcp.h> +#include "test_debug.h"
typedef struct cls_test_packet { odp_u32be_t magic; @@ -291,6 +292,8 @@ odp_packet_t create_packet_len(odp_pool_t pool, bool vlan, parse_ipv4_string(CLS_DEFAULT_SADDR, &addr, &mask); ip->src_addr = odp_cpu_to_be_32(addr); ip->ver_ihl = ODPH_IPV4 << 4 | ODPH_IPV4HDR_IHL_MIN; + odp_packet_has_ipv4_set(pkt, 1); + if (flag_udp) ip->tot_len = odp_cpu_to_be_16(ODPH_UDPHDR_LEN + payload_len + ODPH_IPV4HDR_LEN); @@ -318,14 +321,23 @@ odp_packet_t create_packet_len(odp_pool_t pool, bool vlan, udp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT); udp->length = odp_cpu_to_be_16(payload_len + ODPH_UDPHDR_LEN); udp->chksum = 0; + odp_packet_has_udp_set(pkt, 1); + if (odph_udp_tcp_chksum(pkt, ODPH_CHKSUM_GENERATE, NULL) != 0) { + LOG_ERR("odph_udp_tcp_chksum failed\n"); + return ODP_PACKET_INVALID; + } } else { odp_packet_l4_offset_set(pkt, offset); tcp = (odph_tcphdr_t *)odp_packet_l4_ptr(pkt, NULL); tcp->src_port = odp_cpu_to_be_16(CLS_DEFAULT_SPORT); tcp->dst_port = odp_cpu_to_be_16(CLS_DEFAULT_DPORT); tcp->hl = ODPH_TCPHDR_LEN / 4; - /* TODO: checksum field has to be updated */ tcp->cksm = 0; + odp_packet_has_tcp_set(pkt, 1); + if (odph_udp_tcp_chksum(pkt, ODPH_CHKSUM_GENERATE, NULL) != 0) { + LOG_ERR("odph_udp_tcp_chksum failed\n"); + return ODP_PACKET_INVALID; + } }
/* set pkt sequence number */ diff --git a/test/common_plat/validation/api/classification/odp_classification_test_pmr.c b/test/common_plat/validation/api/classification/odp_classification_test_pmr.c index c8bbf50..88fbf8f 100644 --- a/test/common_plat/validation/api/classification/odp_classification_test_pmr.c +++ b/test/common_plat/validation/api/classification/odp_classification_test_pmr.c @@ -717,6 +717,7 @@ void classification_test_pmr_term_dmac(void)
/* Other packets delivered to default queue */ pkt = create_packet(pkt_pool, false, &seq, false); + CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); memset(eth->dst.addr, 0, ODPH_ETHADDR_LEN); CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); @@ -1102,6 +1103,7 @@ static void classification_test_pmr_term_daddr(void) /* packet with dst ip address matching PMR rule to be received in the CoS queue*/ pkt = create_packet(pkt_pool, false, &seq, false); + CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL); odp_pktio_mac_addr(pktio, eth->src.addr, ODPH_ETHADDR_LEN); odp_pktio_mac_addr(pktio, eth->dst.addr, ODPH_ETHADDR_LEN); @@ -1122,6 +1124,7 @@ static void classification_test_pmr_term_daddr(void)
/* Other packets delivered to default queue */ pkt = create_packet(pkt_pool, false, &seq, false); + CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); seqno = cls_pkt_get_seq(pkt); CU_ASSERT(seqno != TEST_SEQ_INVALID); eth = (odph_ethhdr_t *)odp_packet_l2_ptr(pkt, NULL);
-----------------------------------------------------------------------
Summary of changes: .../api/classification/odp_classification_common.c | 14 +++++++++++++- .../api/classification/odp_classification_test_pmr.c | 3 +++ 2 files changed, 16 insertions(+), 1 deletion(-)
hooks/post-receive