aboutsummaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMatias Elo <matias.elo@nokia.com>2023-04-18 09:57:58 +0300
committerMatias Elo <matias.elo@nokia.com>2023-04-20 10:14:11 +0300
commite8ebd17c66201e38a240629de87fddff3741c3ce (patch)
tree06bb9c83a58996db4c69be3a7e3891ed64254c08 /platform
parent04655dc8891711aea41a3b6d1dedd1d16d8ca786 (diff)
linux-gen: pktio: don't try to receive packets from inactive input queues
Don't try to receive packets from inactive pktio devices when using plain event input queues. Direct and scheduled packet input modes already check pktio device status before polling for new packets. This fixes a crash with DPDK v22.11. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Diffstat (limited to 'platform')
-rw-r--r--platform/linux-generic/odp_packet_io.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index 78cd93885..48bbe38fc 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -1108,6 +1108,9 @@ static _odp_event_hdr_t *pktin_dequeue(odp_queue_t queue)
if (_odp_queue_fn->orig_deq_multi(queue, &event_hdr, 1) == 1)
return event_hdr;
+ if (odp_unlikely(entry->state != PKTIO_STATE_STARTED))
+ return 0;
+
pkts = pktin_recv_buf(entry, pktin_index, hdr_tbl, QUEUE_MULTI_MAX);
if (pkts <= 0)
@@ -1153,7 +1156,7 @@ static int pktin_deq_multi(odp_queue_t queue, _odp_event_hdr_t *event_hdr[],
/** queue already has number of requested buffers,
* do not do receive in that case.
*/
- if (nbr == num)
+ if (nbr == num || odp_unlikely(entry->state != PKTIO_STATE_STARTED))
return nbr;
pkts = pktin_recv_buf(entry, pktin_index, hdr_tbl, QUEUE_MULTI_MAX);