Attempts to enq to a pktin queue or deq from a pktout queue are
programming errors, so abort.

Signed-off-by: Stuart Haslam <[email protected]>
---
(This code contribution is provided under the terms of agreement LES-LTM-21309)

 platform/linux-generic/odp_packet_io.c | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/platform/linux-generic/odp_packet_io.c 
b/platform/linux-generic/odp_packet_io.c
index f527e45..161f2ce 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -384,6 +384,9 @@ int pktout_enqueue(queue_entry_t *qentry, odp_buffer_hdr_t 
*buf_hdr)
 odp_buffer_hdr_t *pktout_dequeue(queue_entry_t *qentry)
 {
        (void)qentry;
+
+       ODP_ABORT("attempted dequeue from a pktout queue");
+
        return NULL;
 }
 
@@ -408,13 +411,19 @@ int pktout_deq_multi(queue_entry_t *qentry, 
odp_buffer_hdr_t *buf_hdr[],
        (void)buf_hdr;
        (void)num;
 
+       ODP_ABORT("attempted dequeue from a pktout queue");
+
        return 0;
 }
 
 int pktin_enqueue(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr)
 {
-       /* Use default action */
-       return queue_enq(qentry, buf_hdr);
+       (void)qentry;
+       (void)buf_hdr;
+
+       ODP_ABORT("attempted enqueue to a pktin queue");
+
+       return -1;
 }
 
 odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry)
@@ -445,8 +454,13 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry)
 
 int pktin_enq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], int 
num)
 {
-       /* Use default action */
-       return queue_enq_multi(qentry, buf_hdr, num);
+       (void)qentry;
+       (void)buf_hdr;
+       (void)num;
+
+       ODP_ABORT("attempted enqueue to a pktin queue");
+
+       return 0;
 }
 
 int pktin_deq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], int 
num)
-- 
2.1.1



_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to