From: Stuart Haslam <[email protected]> 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]> Reviewed-by: Taras Kondratiuk <[email protected]> Signed-off-by: Maxim Uvarov <[email protected]> --- v2: use ODP_UNUSED platform/linux-generic/odp_packet_io.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index f69d6b1..52125fc 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -535,9 +535,9 @@ int pktout_enqueue(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr) return (nbr == len ? 0 : -1); } -odp_buffer_hdr_t *pktout_dequeue(queue_entry_t *qentry) +odp_buffer_hdr_t *pktout_dequeue(queue_entry_t *qentry ODP_UNUSED) { - (void)qentry; + ODP_ABORT("attempted dequeue from a pktout queue"); return NULL; } @@ -555,20 +555,19 @@ int pktout_enq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], return (nbr == num ? 0 : -1); } -int pktout_deq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], - int num) +int pktout_deq_multi(queue_entry_t *qentry ODP_UNUSED, + odp_buffer_hdr_t *buf_hdr[] ODP_UNUSED, + int num ODP_UNUSED) { - (void)qentry; - (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) +int pktin_enqueue(queue_entry_t *qentry ODP_UNUSED, + odp_buffer_hdr_t *buf_hdr ODP_UNUSED) { - /* Use default action */ - return queue_enq(qentry, buf_hdr); + ODP_ABORT("attempted enqueue to a pktin queue"); + return -1; } odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) @@ -603,10 +602,12 @@ odp_buffer_hdr_t *pktin_dequeue(queue_entry_t *qentry) return buf_hdr; } -int pktin_enq_multi(queue_entry_t *qentry, odp_buffer_hdr_t *buf_hdr[], int num) +int pktin_enq_multi(queue_entry_t *qentry ODP_UNUSED, + odp_buffer_hdr_t *buf_hdr[] ODP_UNUSED, + int num ODP_UNUSED) { - /* Use default action */ - return queue_enq_multi(qentry, buf_hdr, 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) -- 1.8.5.1.163.gd7aced9 _______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
