Reviewed-by: Balasubramanian Manoharan <[email protected]>
On 22 October 2015 at 18:11, <[email protected]> wrote: > From: Grigore Ion <[email protected]> > > odph_ipv4_csum_update should be used to update the checksum inside a pkt, > as it is used in all the other examples and tests different from > classification. Thus the prototype of the function should return void, > because the intention was to update a value not to return something. These > being said it is wrong(on LE platforms) to do a cpu_to_be conversion > and an assignment operation in classification_test(this is already done > inside). > > Signed-off-by: Grigore Ion <[email protected]> > --- > v1: > - patch updated to the last master (Maxim Uvarov) > > .../classification/odp_classification_tests.c | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/test/validation/classification/odp_classification_tests.c > b/test/validation/classification/odp_classification_tests.c > index ca81c51..da8d90c 100644 > --- a/test/validation/classification/odp_classification_tests.c > +++ b/test/validation/classification/odp_classification_tests.c > @@ -252,7 +252,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; > - ip->chksum = odp_cpu_to_be_16(odph_ipv4_csum_update(pkt)); > + ip->chksum = odph_ipv4_csum_update(pkt); > offset += ODPH_IPV4HDR_LEN; > > /* udp */ > @@ -458,7 +458,7 @@ void test_cls_pmr_chain(void) > 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)); > + ip->chksum = 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); > @@ -476,7 +476,7 @@ void test_cls_pmr_chain(void) > 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)); > + ip->chksum = odph_ipv4_csum_update(pkt); > > enqueue_loop_interface(pkt); > pkt = receive_packet(&queue, ODP_TIME_SEC); > @@ -796,7 +796,7 @@ void test_pktio_pmr_match_set_cos(void) > 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)); > + ip->chksum = 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); > -- > 1.7.3.4 > > _______________________________________________ > lng-odp mailing list > [email protected] > https://lists.linaro.org/mailman/listinfo/lng-odp _______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
