bogdanPricope replied on github web page:

example/generator/odp_generator.c
line 314
@@ -742,6 +809,23 @@ 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) {
+                                       /* HW validation */
+                                       if (odp_packet_has_l3_error(pkt))
+                                               printf("HW detected L3 
error\n");
+                               } /* else SW validation */


Comment:
SW checking code was deliberately missed: this is a ‘load’ application and 
SW operations are avoided.

I added this code mainly to highlight how the csum errors detected by ODP 
implementation can be interpreted by application. We can keep it as ‘code 
example’ or remove this part since has no other benefit (packets with errors 
are freed immediately after this code sample).


https://github.com/Linaro/odp/pull/124#discussion_r136794147
updated_at 2017-09-04 10:41:29

Reply via email to