@@ -221,7 +221,7 @@ odp_packet_t create_packet(bool vlan)
seqno = odp_atomic_fetch_inc_u32(&seq);
ip->id = odp_cpu_to_be_16(seqno);
ip->chksum = 0;
- odph_ipv4_csum_update(pkt);
+ ip->chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
offset += ODPH_IPV4HDR_LEN;
/* udp */
@@ -403,6 +403,9 @@ void test_cls_pmr_chain(void)
ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
parse_ipv4_string(CLS_PMR_CHAIN_SADDR, &addr, &mask);
ip->src_addr = odp_cpu_to_be_32(addr);
+ ip->chksum = 0;
+ ip->chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
+
udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
udp->src_port = odp_cpu_to_be_16(CLS_PMR_CHAIN_SPORT);
@@ -418,6 +421,8 @@ void test_cls_pmr_chain(void)
ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
parse_ipv4_string(CLS_PMR_CHAIN_SADDR, &addr, &mask);
ip->src_addr = odp_cpu_to_be_32(addr);
+ ip->chksum = 0;
+ ip->chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
enqueue_loop_interface(pkt);
pkt = receive_packet(&queue, ODP_TIME_SEC);
@@ -728,6 +733,9 @@ void test_pktio_pmr_match_set_cos(void)
ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
parse_ipv4_string(CLS_PMR_SET_SADDR, &addr, &mask);
ip->src_addr = odp_cpu_to_be_32(addr);
+ ip->chksum = 0;
+ ip->chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt));
+
udp = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
udp->src_port = odp_cpu_to_be_16(CLS_PMR_SET_SPORT);
enqueue_loop_interface(pkt);