bogdanPricope replied on github web page: example/generator/odp_generator.c line 32 @@ -811,21 +809,14 @@ static int gen_recv_thread(void *arg) continue; for (i = 0, pkt_cnt = 0; i < ev_cnt; i++) { pkt = odp_packet_from_event(events[i]); - itf = &itfs[odp_pktio_index(odp_packet_input(pkt))]; - if (odp_packet_has_ipv4(pkt)) { - if (itf->config.pktin.bit.ipv4_chksum) { - if (odp_packet_has_l3_error(pkt)) - printf("HW detected L3 error\n"); - } - } + csum_status = odp_packet_l3_chksum_status(pkt); + if (csum_status == ODP_PACKET_CHKSUM_BAD) + printf("L3 checksum error detected.\n");
Comment: Prints were already there. We only changed the conditions for printing to highlight the new API. > muvarov wrote > common errors set for tcp and udp here. >> muvarov wrote >> too many ifs overcompicate function and makes it hard to read. Tcp packet >> and pktin_cfg->bit.udp_chksum=0 in settings will not to tcp 'if' bellow. >>> muvarov wrote >>> prints for fast path functions is bad thing. Bellow is print_pkts() which >>> does all printing. Or we need to move it here at least. Or better to move >>> out all printing from fast path. https://github.com/Linaro/odp/pull/269#discussion_r149672320 updated_at 2017-11-08 13:49:36