Hi Bala,

While looking at this, I realized I don't understand something: we pass the received packets to classification, and it enqueues them to queues. But we also return the number of received packets, along with the handles to those packets, which requires a quite different behavior from the caller of odp_pktin_recv(): it can't actually use those handles, as those packets are on a queue already. Am I missing something? Or should we mention this in the function description?

Regards,

Zoltan

On 13/04/16 15:20, Zoltan Kiss wrote:
diff --git a/platform/linux-generic/pktio/loop.c 
b/platform/linux-generic/pktio/loop.c
index 0ea6d0e..f6a8c1d 100644
--- a/platform/linux-generic/pktio/loop.c
+++ b/platform/linux-generic/pktio/loop.c
@@ -70,10 +70,13 @@ static int loopback_recv(pktio_entry_t *pktio_entry, 
odp_packet_t pkts[],
                        pkt_hdr = odp_packet_hdr(pkt);
                        packet_parse_reset(pkt_hdr);
                        packet_parse_l2(pkt_hdr);
-                       if (0 > _odp_packet_classifier(pktio_entry, pkt)) {
-                               pkts[j++] = pkt;
+                       if (!_odp_packet_classifier(pktio_entry, pkt)) {
                                pktio_entry->s.stats.in_octets +=
-                                       odp_packet_len(pkts[i]);
+                                       odp_packet_len(pkt);
+                       } else {
+                               pktio_entry->s.stats.in_errors +=
+                                       odp_packet_len(pkt);
+                               odp_packet_free(pkt);
                        }
                }
                nbr = j;
_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to